0% found this document useful (0 votes)
377 views205 pages

Smartplant Programing

Uploaded by

Gopi B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
377 views205 pages

Smartplant Programing

Uploaded by

Gopi B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 205

 

SmartPlant 3D Programming I
Student Workbook

Version 2007 SP4 February 2008 N/A


 

Copyright
Copyright © 2004-2008 Intergraph Corporation. All Rights Reserved.
Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license
agreement; contains confidential and proprietary information of Intergraph and/or third parties which is protected by
copyright law, trade secret law, and international treaty, and may not be provided or otherwise made available
without proper authorization.
Portions of this software are owned by Spatial Corp. © 1986-2008. All Rights Reserved.

Restricted Rights Legend


Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies:
This was developed at private expense and is “restricted computer software” submitted with restricted rights in
accordance with subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at
52.227-19 of the Federal Acquisition Regulations (“FAR”) and its successors, and is unpublished and all rights are
reserved under the copyright laws of the United States. For units of the Department of Defense (“DoD”): This is
“commercial computer software” as defined at DFARS 252.227-7014 and the rights of the Government are as
specified at DFARS 227.7202-3. 
Unpublished – rights reserved under the copyright laws of the United States.  
Intergraph Corporation
Huntsville, Alabama 35894-0001

Warranties and Liabilities


All warranties given by Intergraph Corporation about equipment or software are set forth in your purchase contract,
and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or
amendment of such warranties. Intergraph believes the information in this publication is accurate as of its
publication date.
The information and the software discussed in this document are subject to change without notice and are subject to
applicable technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in
this document.
The software discussed in this document is furnished under a license and may be used or copied only in accordance
with the terms of this license.
No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by
Intergraph or its affiliated companies. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL
EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.
Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and
symbol data. Users should verify for themselves that the data is accurate and suitable for ttheir
heir project work.

Trademarks
Intergraph, the Intergraph logo, PDS, SmartPlant, FrameWorks, I-Convert, I-Export, I-Sketch, SmartMarine,
IntelliShip, INtools, ISOGEN, MARIAN, SmartSketch, SPOOLGEN, SupportManager, and SupportModeler are
trademarks or registered trademarks of Intergraph Corporation or its subsidiaries in the United States and other
countries. Microsoft and Windows are registered trademarks of Microsoft Corporation. ACIS is a registered
trademark of SPATIAL TECHNOLOGY, INC. Infragistics, Presentation Layer Framework, ActiveTreeView Ctrl,
ProtoViewCtl, ActiveThreed Ctrl, ActiveListBar Ctrl, ActiveSplitter, ActiveToolbars Ctrl, ActiveToolbars Plus Ctrl,
and ProtoView are trademarks of Infragistics, Inc. Portions of 2D DCM, 3D DCM, and HLM from D-Cubed
Limited are incorporated. All rights reserved. Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks
of Oracle Corporation and/or its affiliates. Other brands and product names are trademarks of their respective
owners.
 

Table of Contents
INTRODUCTION.....................................................................................................................................5  

UNDERSTANDING
UNDERSTANDING SMART
SMART PLANT 3D DATA
DATA MODEL..........
MODEL.....................................
...................................................... .......... 6 
.....................................

LAB 1: CREATE A QUERY THAT RETURNS ALL P PART


ART CLASSES OF TYPE SHAPESCLASS
DEFINED IN THE CATALOG
CATALOG DATABASE.......................................
DATABASE.................................................................. .......................... 17 
.....................................................

LAB 2: CREATE A QUERY TO FIND OUT THE TOTAL NUMBER OF PART CLASSES IN THE
CATALOG DATABASE
DATABASE ......................................................
........................... ......................................................
...................................................... ............ 23 
.......................................

LAB 3: CREATE A QUERY TO LIST ALL SMART EQUIPMENT PARTS IN THE CATALOG
DATABASE
DATABA SE ......................................................
........................... ......................................................
......................................................
..................................................... .... 25 
..............................

LAB 4: LIST ALL


ALL EQUIPMENT
EQUIPMENT SHA
SHAPES
PES LOCATED IIN
N THE PALETTE ......................... ..................... 27 
PALETTE ..............................................

LAB 5: LIST ALL EQUIPMENTS LOCATED IN THE MODEL WITH ITS CORRESPONDING PART
NAME FROM THE CATALOG
CATALOG DATABA
DATABASE
SE........................
...................................................
...................................................... ............ 29 
.......................................

LAB 6: LIST ALL PIPE RUNS AND PIPELINE NAMES LOCATED IN THE MODEL DATABASE..... ... 32 
DATABASE ........

LAB 7: LIST ALL


ALL OBJECT
OBJECT WITH NOTES
NOTES IN THE MODEL
MODEL DATABASE
DATABASE ......................... ..................... 34 
..............................................

LAB 8: LIST ALL PIPE COMPONENT OCCURRENCES IN THE MODEL DATABASE PER PIPERUN37  

LAB 9: LIST ALL VALVES OCCURRENCES


OCCURRENCES LOCATED
LOCATED IN THE MODEL PER PIPERUN.. ................. 41 
PIPERUN...................

LAB 10: CREATING


CREATING A NAMING RULE FOR PIPELINE
PIPELINE SYSTEMS..........
SYSTEMS..................................... ................. 45 
............................................

LAB 11:
11: CREATING A NAMING RULE FOR PIPERUN
PIPERUN OBJECTS
OBJECTS .................................................. .... 53 
........................ ..............................

LAB 12: CREATING


CREATING A NAMING
NAMING RULE FOR MEMBER
MEMBER PA
PARTS
RTS........................
................................................... ........ 62 
...................................

LAB 13: PIPING COMPONENT


COMPONENT SYMBOL .....................................................
.......................... ...................................................... ............ 71 
.......................................

LAB 14: PIPING INSTRUMENT


INSTRUMENT SYMBOL ..........................
.....................................................
...................................................... ............ 78 
.......................................

LAB 15: VALVE OPERATOR


OPERATOR SYMBO
SYMBOL
L ...................................................
........................ ...................................................... ................. 85 
............................................

LAB 16: PIPING SYMBOL WITH


WITH MULTIPLE REPRESENTATIONS
REPRESENTATIONS (OPTIONAL) ....................... ........ 95 
(OPTIONAL) ...............................

LAB 17: 90 DEG VERTICAL OUTSIDE CABLETRAY


CABLETRAY FITTING SYMBOL (OPTIONAL).......................
(OPTIONAL)....................... 99
 

 3 
 

LAB 18: ELECTRICAL


ELECTRICAL BOX CONNECTOR SYMBOL (OPTIONAL)......................................... .......... 110 
(OPTIONAL)...................................................

LAB 19: ELECTRICAL


ELECTRICAL BOX CONNECTOR - SYMBOL MODIFICATION
MODIFICATION (OPTIONAL)....... ............... 121 
(OPTIONAL)......................

LAB 20:
20: ELECTRICAL
ELECTRICAL JUNCTION
JUNCTION BOX SYMB
SYMBOL
OL (OP
(OPTIONAL)
TIONAL) ..................................................... .. 125 
........................... ............................

LAB 21: SHAPE SYMBOL (OPTIONAL)


(OPTIONAL) ..................................................
....................... ...................................................... ............... 136 
..........................................

APPENDIX..
APPENDIX.............................
......................................................
......................................................
......................................................
..................................................... .. 145 
............................
Symboll Helper Ref
Symbo Reference
erence .............
...........................
...........................
..........................
..........................
..........................
...........................
...........................
.......................... .... 145 
.................
Geometry Factory Programming Reference.....
Geometry Reference..................
..........................
...........................
...........................
..........................
.......................... ............. 153 
..........................
NamingRulesHelpe
NamingR ulesHelperr Obje
Object...........
ct.........................
...........................
..........................
..........................
..........................
...........................
...........................
.......................... .... 183 
.................
Attribute Helper servic
servicee ............
.........................
..........................
...........................
...........................
..........................
..........................
..........................
........................... ........ 185 
......................
Relation Helper service.................
service.... ...........................
...........................
..........................
..........................
..........................
...........................
...........................
.......................... .... 191 
.................
SP3D Reference
Referencess Tool.
Tool..............
..........................
..........................
...........................
...........................
..........................
..........................
..........................
........................... ........ 197 
......................
Debugging
Debu gging You
Yourr Code ............
.........................
..........................
..........................
...........................
...........................
..........................
..........................
.......................... ........... 199 
........................
Creation of Cab Files ............
.........................
..........................
..........................
..........................
...........................
...........................
..........................
.......................... ............. 200 
..........................

 4 
 

Introduction
The Student workbook is designed as an aid for students attending the SP3D Programming I
class presented by Intergraph Corporation, and it’s a supplement to the standard product
documentation.

Objective

This document is designed to provide a guideline for people who need to design symbol
definitions and naming rules for the SmartPlant 3D application. This workbook includes, but is
not limited to the following:

 
• Provides an overview of customization with the SmartPlant 3D software using standard
Windows™ programming tools and languages like Visual Basic™.
 
• Describes some of the tools that can be used to design new symbol entities and naming
rules.
 
• Provides examples of workflow customization. 

Assumptions are made here that the user has a prerequisite knowledge of the SmartPlant 3D
reference data.

Course description

 
• SmartPlant 3D Data Model
 
• Naming Rules
 
• Visual Basic Symbol Creation

Course Reference Material

SmartPlant 3D/IntelliShip Programmer’s Guide


SmartPlant 3D Symbols Reference Data Guide
SmartPlant 3D Reference Data Guide

 5 
 

Understanding Smart Plant 3D Data Model

6  
 

7  
 

7  
 


 

 9 
 

System Entity Data Model

Accessing Relationships from COM+


Graphical User Interface
• Provide access to properties of related
objects

10 
 

System Entity Data Model

Accessing Relationships from COM+


Label Editor generates XML files
• Use XML tags to access to related objects

System Entity Data Model

Accessing Relationships from Visual Basic


• Relation Helper Service
• Provides access to related objects
• To use this service you must know the relation collection name and the interface
name
Interface name: IJSystemChild
Relation collection name: SystemParent

CollectionRelations(interfaceID, collectionName As String) As Object

11 
 

System Entity Data Model

Accessing relationships from Visual Basic


B asic
Example:

Dim oRelationHelper As IMSRelation.DRelationHelper


Dim oCollection As IMSRelation.DCollectionHelper
IMSRelation.DCollectionHelper
Set oRelationHelper = oObject
Set oCollection = oRelationHelpe
oRelationHelper.CollectionRelations("IJ
r.CollectionRelations("IJSystemChild",
SystemChild", "SystemParent")
Set oSystem = oCollection.Item
oCol lection.Item(1)
(1)

Interface

Relation
Collection

Related
Object

12 
 

13 
 

14 
 

15 
 

16  
 

Lab 1: Create a query that returns all p


part
art classes of
type ShapesClass defined in the catalog dat
database
abase

1.  Open the SP3D Schema Browser and point to a catalog schema.

17  
 

2.  Select View -> Options to open the option dialog box. Enable the check box to displays
Relation Collections.

3.  Exit the SP3D Schema Browser and re-open it to read the change. We are interested in query
part classes, thus we must start our navigation at Ref Data Business Services.

18 
 

4.  Expand CPartClass node. The tool shows a list of interfaces that are implemented by
CPartClass. Since we are looking for the name of a part class, let us expand IJDPartClass.

5.  Clicking on the PartClassType property in the tree view will show information about the
selected item in the detail view. The DBViewName corresponding to IJDPartClass is
PartClassType.

19 
 

6.  To search for part classes in the catalog database, we must execute a SQL query that searches
for all entries in the view PartClassType. We can do this using a SELECT statement on the
report database. The SELECT query is as follows:

Select Name, PartClassType from


JDPartClass
Where PartClassType = 'ShapesClass'

This will return all part classes of type ShapesClass  in the catalog database.

If you are using Microsoft SQL 2005 to host the SP3D databases, then you can use Microsoft
SQL Server Management Studio to run the SQL query. Set the report database to be the
active database when running the query.

 20 
 

If you are using Oracle 10g to host the SP3D databases, then you can use SQL plus to run the
SQL query:

Open Oracle SQL Plus or Oracle SQL Developer from the Start Menu.
Log on using the following data:

Note: Ask your instructor for the system user password.

 21 
 

From the SQL Command prompt, type the lines as shown here:
ALTER SESSION SET CURRENT_SCHEMA = SP3DTrain_RDB;
Select Name, PartClassType from
JDPartClass
Where PartClassType = 'ShapesClass';

 22 
 

Lab 2: Create a query to find out the tot


total
al number of
part classes in the catalog dat
database
abase
1.  Use the “SQL Group by” clause and the aggregate function “Count(*)” to get the total
number of part classes in the catalog database. We can do this using a SELECT statement on

the report database. The SELECT query is as follows:


Using Microsoft SQL Server Management Studio:

Select count(*) as Count,


PartClassType
from JDPartClass
Group by PartClassType

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 23 
 

ALTER SESSION SET CURRENT_SCHEMA = SP3DTrain_RDB;


Select count(*) as Count,
PartClassType
from JDPartClass
Group by PartClassType;

 24 
 

Lab 3: Create a query to list all smart equipment part


parts
s
in the catalog databa
database
se
1.  We are interested in query equipment parts defined in the catalog, thus we must start our
navigation at Ref Data Business Services.

2.  Expand Smart Equipment Part node. The tool shows a list of interfaces that are implemented
by Smart Equipment Part. Thus to search for all equipment parts in the catalog database, we
must execute a SQL query that searches for all entries in the view JSmartEquipmentPart. We

can do this using a SELECT statement on the report database. The SELECT query is as
follows:

Select * from JSmartEquipmentPart

3.  We are also interested to get the description and the name of the equipment part.
4.  This is done by using the “SQL JOIN” clause on the views that return the equipment name
and the equipment description. Use the “SQL Order by” clause to sort the equipment parts by
their name.

5.  Using Microsoft SQL Server Management Studio, the SELECT query is as follows:
:
Select
x2.Name,
x6.PartDescription from
JSmartEquipmentPart x1
Join JSmartItem x2 on x2.oid = x1.oid
Join JDPart x6 on x6.oid = x1.oid
Order by x2.Name

 25 
 

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 26  
 

Lab 4: List all equipment shapes located in the palette


1.  We are interested in query equipment shapes defined in the catalog, thus we must start our
navigation at Ref Data Business Services. Equipment shapes are parts in the catalog. Thus,
we must begin our hunt under the CPart folder.

2.  Expand CPart node. The tool shows a list of Equipment shape part classes. Expand one of
them and notice that if a part class is located in the palette, then it must implement the
IJUAPaletteInfo

Using Microsoft SQL Server Management Studio, the SELECT query is as follows:

Select
PartNumber,
PartDescription,
SequenceNumber from JDPart x1
Join JUAPaletteInfo x2 on x2.oid = x1.oid

 27  
 

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 28 
 

Lab 5: List all equipments located in the model with its


corresponding part name from the catalog database

1.  We are interested in query Smart Equipment occurrences located in the model, thus we must

start our navigation at Equipment Business Services under the CPSmartEquipment folder.
2.  Expand CPSmartEquipment node. The tool shows a list of interfaces that are implemented by
Smart Equipment. Since we are looking for a relation to the catalog, let us expand
IJSmartOccurrence (which is the interface implemented by all smart occurrences).

3.  You will see a pink bubble that shows the toSI_ORIG relation collection. Expand the node
further and you will find the property you are looking for on an interface at the other end of
the relationship.

4.  We are also interested to get the name of the smart equipment occurrence. We can use
use the
IJNamedItem interface which provides the object name.

 29 
 

5.  Using Microsoft SQL Server Management Studio, the SELECT query is as follows:

Select
x2.ItemName as OccName,
x4.Name as PartName
from
JEquipmentOcc x1
Join JNamedItem x2 on x2.oid = x1.oid
Join XSOtoSI_R x3 on x3.oidorigin = x1.oid
Join JSmartItem x4 on x4.oid = x3.oiddestination

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 30 
 

 31 
 

Lab 6: List all pipe runs and pipeline names located in


the model database
Hints:

 

 

We
Use must begin our hunttounder
the IJSystemChild theparent
get the Common Route
object. Business
In order Service
for an object folder
to participate in the
System Hierarchy, it must implement the IJSystemChild and establish a relationship to a
design parent
 
• Find the JRtePipeRun in the Common Route Business Service folder

Solution:

Using Microsoft SQL Server Management Studio, the SELECT query is as follows:

Select
x4.ItemName as PipeRunName,
x3.ItemName as Parent_System
from JRtePipeRun x1
Join JNamedItem x4 on x4.oid = x1.oid
Join XSystemHierarchy x2 on x2.oiddest
x2.oiddestination
ination = x1.oid
x1.oid
Join JNamedItem x3 on x3.oid = x2.oidorigin

 32 
 

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 33 
 

Lab 7: List all object with notes in the model database


1.  We must begin our hunt under the CommonRoute Business Services folder.

2.  Expand Pipe Component occurrence node. The tool shows a list of interfaces that are
implemented by pipe component occurrence. Since we are looking for object to note relation,
let us expand IJDObject (which is the interface which defines that a Pipe component is an
‘object’).

3.  You will see a pink bubble that shows the GeneralNote relation collection.

4.  Expand the node further and you will find the property you are looking for on an interface at
the other end of the relationship.

 34 
 

5.  Click on IJDObject to see that the DBViewName corresponding to it is JDObject in the detail
view.

6.  Thus to search for all ‘object’s in the database, we must execute a SQL query that searches
for all entries in the view JDObject. We can do this using an SQL query on the Report
database.

Select * from JDObject

This will return a list of all objects in the database.

7.  However, we are interested in all objects that have a relationship with a note. Thus let us
make a query for all relationships between objects and notes. This is done using the view
corresponding to the relationship.

Select * from XContainsNote

8.  Finally we will search for all notes in the database using the following query

Select * from JGeneralNote

 35 
 

9.  To find the objects which are related to notes, we will make a join between the queries as
follows

Select * from JDObject


Join XContainsNote on JDObject.oid = XcontainsNote.Oidorigin
Join JGeneralNote on JGeneralNote.oid = XcontainsNote.OidDestination

10. Using the “SQL JOIN” clauses, we will get a list of all the objects (and only the objects)
which has notes associated with them.

11. To simplify the query, we can use aliases for the view names

Select * from JDObject x1


Join XContainsNote x2 on x2.Oidorigin = x1.oid
Join JGeneralNote x3 on x3.oid = x2.OidDestination

12. Change the query to return only the Note text column. Therefore, the SELECT query is as
follows:

Select x3.Text from JDObject


Join XContainsNote x1
x2 on x2.Oidorigin = x1.oid
Join JGeneralNote x3 on x3.oid = x2.OidDestination

 36  
 

Lab 8: List all pipe component occurrences in the


model database per PipeRun
Hints:

 

 

We
Findmust begin our hunt under
the JRteCompOccur in thethe Common
Common Route
Route Business
Business Service
Service folder
folder
 
• Use the MadeFrom relation to find the part in the catalog
 
• Use the IJDPipeComponent interface to get the Industry Commodity Code of the part
occurrence
 
• Use the Run to Part (OwnParts) relation to get to the PipeRun object. This relation is
provided by IJRtePathGenPart interface
 
• Use the “SQL Group by” clause and the aggregate function “Count(*)” to get the total
number of part occurrences in the model database

 37  
 

Solution:

Select
x3.IndustryCommodityCode,
x6.ItemName as 'PipeRun_Name',
Count(*) as qty
from JRteCompOccur x1
JOIN XMadeFrom x2 ON (x2.OidOrigin = x1.Oid)
JOIN JDPipeComponent x3 ON (x3.Oid = x2.OidDestination)
JOIN XOwnsParts x5 ON (x5.oiddestination = x1.oid)
JOIN JNamedItem x6 on (x6.oid = x5.oidorigin)
Group by x3.IndustryCommodityCode, x6.ItemName

Using Microsoft SQL Server Management Studio, the SELECT query is as follows:

 38 
 

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 39 
 

 40 
 

Lab 9: List all valves occurrences located in the model


per PipeRun
Hints:


  We
 
• Use must begin our hunt
the MadeFrom under
relation the Common
to find the part inRoute Business Service folder
the catalog
 
• Use the IJDPipeComponent view to get the Industry Commodity Code and the
Commodity Type of the part occurrence
 
• Use the Run to Part (OwnParts) relation to get to the PipeRun object. This relation is
provided by IJRtePathGenPart interface

 41 
 

Solution:

Select
x3.IndustryCommodityCode,
x6.ItemName as 'PipeRun_Name',
x4.ShortStringValue as 'CommodityType',
count(*) as qty
from JRteCompOccur x1
Join XMadeFrom x2 ON (x2.OidOrigin = x1.Oid)
Join JDPipeComponent x3 ON (x3.Oid = x2.OidDestination)
Join CL_PipingCommodityType x4 ON (x4.ValueID = x3.CommodityType)
Join XOwnsParts x5 ON (x5.oiddestination = x1.oid)
Join JNamedItem x6 ON (x6.oid = x5.oidOrigin)
WHERE (x3.CommodityClass = 5)
Group by x3.IndustryCommodityCode, x6.ItemName, x4.ShortStringValue

Using Microsoft SQL Server Management Studio, the SELECT query is as follows:

 42 
 

Using Oracle SQL Plus or Oracle SQL Developer, the SELECT query is as follows:

 43 
 

 44 
 

Lab 10: Creating a Naming Rule for Pipeline Systems


Objectives

After completing this lab, you will be able to:

   Create a simple naming rule for the Pipeline System


   Implement the IJNameRule interface
   Use the Attribute Helper service to retrieve pipeline object properties
   Use Catalog Resource Manager to get a connection to the code list metadata
   Bulkload the Naming Rule into the Catalog database

This session will demonstrate an implementation of a naming rule for pipeline system objects.
This component will generate a name for pipeline objects as shown here:

Pipeline Name = Fluid Code + Sequence Number

1.  Create the following directories:

c:\train\CustomNameRule  

2.  Copy the Naming Rule Visual Basic Template Project provided by the instructor to
c:\train\CustomNameRule\Template.  

Note:
 
• The Naming Rule template is delivered under
[Installation]\Programming\ExampleCode\Symbols\NamingRuleTemplate

3.  Create a directory called lab1 as shown here:

c:\train\CustomNameRule\lab1

4.  Run Microsoft Visual Basic 6.0.


5.  Close the Microsoft New Project dialog box.

 45 
 

6.  Select File -> Open Project  option


 option to open the Open Project Dialog box.

7.  Navigate to c:\train\CustomNameRule\Template and open the Naming Rule Template


project.

 
8. Setup the Visual Basic Development Environment as shown below:

 46  
 

9.  Go to the Visual Basic Explorer Window and select the Project node. Select File -> Save
Project As option to save the project as Pipeline.vbp under the lab1 directory.

 
10. Go
Fileto->the Visual
Save Basic Explorer As
TemplateName.cls Window
 optionand select
to save thethe TemplateName
class class node. Select
module as CPipeline.cls under
lab1 directory.

 47  
 

11. Go to the Properties Window and change the name of the Project and ClassModule as shown
here:

12. Go to the General Declarations section and change the value of the Constant Module variable 
from “TemplateNamingRules:”  to “Pipelines:”  

Private Const Module = “Pipeline: “

13. Declare an object variable to hold the reference to the IJDCodeListMetaData.

Private m_oCodeListMetadata As IJDCodeListMetaData


IJDCodeListMetaData

14. Access the subroutine ComputeName section by selecting IJNameRule in the Object List
Box and select the ComputeName in the Procedure List Box.

 48 
 

15. Add lines to the body of the subroutine ComputeName method

Hint:
Declare an object variable to hold a reference to the IJNamedItem

 Dim oChildNamedItem
oChildNamedItem As IIJNamedItem
JNamedItem
 Dim strChildName
strChildName As Str
String
ing
Set oChildNamedItem = oObject
strChildName = vbNullString

16. Declare an object variable to hold a reference to the IJDAttributes

 Dim oAttributes
oAttributes As IJDAttributes
IJDAttributes
Set oAttributes = oObject

17. Declare a variable of type String to store the sequence number.

 Dim strSequenceNumber
strSequenceNumber As S
String
tring

18. Use IJDAttributes interface to get a collection of attributes of the selected item. Finally, Use

the method value to get the object's attribute


strSequenceNumber =
oAttributes.CollectionOfAttr
oAttributes.CollectionOfAttributes("IJPipel
ibutes("IJPipelineSystem")
ineSystem").Item("SequenceNumber")
.Item("SequenceNumber").Value
.Value

19. Declare local variables to hold the fluid codelist value and short description.

 Dim FluidCodeID
FluidCodeID As Long
 Dim strFluidCode
strFluidCode As String
strFluidCode
strFluidCo de = vbNullString

20. Use IJDAttributes and IJDCodeListMetaData interfaces to get the fluid code short
description.

Set m_oCodeLis
m_oCodeListMetadata
tMetadata = GetCatalogR
GetCatalogResourceManager
esourceManager
FluidCodeID = _
oAttributes.CollectionOfA
oAttributes.CollectionOfAttributes("IJP
ttributes("IJPipelineSystem")
ipelineSystem").Item("FluidCode")
.Item("FluidCode").Value
.Value
strFluidCode
strFluidCo de = m_oCodeLis
m_oCodeListMetadata.ShortStri
tMetadata.ShortStringValue("F luidCode", FluidCodeID) 
ngValue("FluidCode",

21. Build the name of the pipeline:

strChildName = strFluidCode & "-" & strSequenceNumber


oChildNamedItem.Name = strChildName

22. Finally, remove the reference from all object variables.

Set oChildNamedItem = Nothing


Set oAttributes = Nothing

 49 
 

23. Insert into your existing project the following Private Function. Open the GetCatalog.txt file
located in the template directory file and use Cut/Paste operation to insert the lines. The
inserted lines should look like this:

'------------------------------------------
'---------------------------------------------------------
-------------------------
---------------------------
---------------------
----
'Description
' Function returns the CatalogResourceManag
CatalogResourceManager er
'------------------------------------------
'---------------------------------------------------------
-------------------------
---------------------------
---------------------
----
Private Function GetCatalogResourceManager() As IUnknown
Const METHOD = "GetCatalogResourceManager"
On Error GoTo ErrHandler

 Dim oDBTypeConfig
oDBTypeConfig As IJDBTypeCo
IJDBTypeConfiguration
nfiguration
 Dim pConnMiddle
pConnMiddle As IJDConnectMiddle
IJDConnectMiddle
 Dim pAccessMiddle
pAccessMiddle As IJDAccessMiddl
IJDAccessMiddlee
 Dim jContext
jContext As IJCont
IJContext
ext
Set jContext = GetJContext()
Set oDBTypeCon
oDBTypeConfigfig = jContext.GetSer
jContext.GetService("DBTypeC
vice("DBTypeConfiguration")
onfiguration")
Set pConnMiddle = jContext.G
jContext.GetService("ConnectMid
etService("ConnectMiddle")
dle")
Set pAccessMiddle = pConnMiddle

 Dim strCatlogDB
strCatlogDB As Str
String
ing

strCatlogDB
Set = oDBTypeConfig.g
GetCatalogRoDBTypeConfig.get_DataBaseFr
esourceManageret_DataBaseFromDBType("
GetCatalogResourceManager omDBType("Catalog")
Catalog") strCatlogDB)
= pAccessMiddle.GetResourceManager(
pAccessMiddle.GetResourceManager(strCatlogDB)
Set jContext = Nothing
Set oDBTypeConfig = Nothing
Set pConnMiddle = Nothing
Set pAccessMiddle = Nothing
 Exit Function
 ErrHandler:
m_oErrors.Add
m_oErrors. Add Err.Number, "GetCatalogResourceManager",
"GetCatalogResourceManager", Err.Description
 Err.Raise E_FAIL
 End Function

24. Go to the Subroutine Terminate method and add one line to remove the reference from object
variable m_oCodeListMetadata.

Set m_oCodeListMetadata = Nothing

25. Compile the Visual Basic project and save the dll as pipeline.dll in the c:\train\lab1
26. Save and Exit the program.
27. Open the TemplateNamingRules.xls under C:\train\CustomNameRule\Templates
28. Add the name of the class object and the ProgID as follows:

 50 
 

29. Save the Excel sheet as TrainingNameRules.xls under c:\train and exit Excel.
30. Run Bulkload Utility (START Menu -> In Intergraph
tergraph SmartPlant 3D -> Database Tools ->
Bulkload Reference Data)
31. Set the bulkload to A/M/D mode.
32. Select Load button to add the new naming rule into the training catalog.

33. Go to SP3D System & Specification Task and create a new pipeline system to test your
naming rule. Select and Key in the following data in the New Pipeline dialog box.

 51 
 

 52 
 

Lab 11: Creating


Creating a Naming Rule for PipeRun objects
Objective

After completing this lab, you will be able to:

   Create a simple naming rule for the piperun objects


   Implement the IJNameRule interface
   Reference the appropriate libraries to build the object name
   Use the Attribute Helper service to retrieve piperun properties
   Use the Relation Helper service to obtain the Spec object
   Get the Parent Name System
   Bulk loading the Naming Rule into the Catalog database

This session will demonstrate an implementation of a naming rule for piperun objects. This
component will generate a name for piperun objects as shown here:

PipeRun object:

Pipe Runs:
NPD + NPD Units + Spec Name + Parent System

 53 
 

1.  Create a directory called lab2 as shown here:

c:\train\CustomNameRule\lab2

2.  Run Microsoft Visual Basic 6.0.


3.  Close the Microsoft New Project dialog box.

4.  Select File -> Open Project  option


 option to open the Open Project Dialog box.

5.  Navigate to c:\train\CustomNameRule\Template and open the Naming Rule Template project
provided by the instructor.

 54 
 

6.  Setup the Visual Basic Development Environment as shown below:

7.  Go to the Visual Basic Explorer Window and select the Project node. Select File -> Save
Project As option to save the project as PipeRun.vbp under the lab2 directory.

8.  Go to the Visual Basic Explorer Window and select the TemplateName class node. Select
File -> Save TemplateName.cls As option to save the class module as CPipeRun.cls under
lab2 directory.

 55 
 

9.  Go to the Properties Window and change the name of the Project and ClassModule as
follows:

10. Go to the General Declarations section and change the value of the Constant Module variable 
from “TemplateNamingRules:”  to “PipeRun:”  

Private Const Module = “PipeRun: “ 

11. Access the subroutine GetNamingParents section by selecting IJNameRule in the Object List
Box and select the GetNamingParents in the Procedure List Box. Add code snippet to the
body of the subroutine GetNamingParents. The lines should get all the parent objects that
need to participate in the object naming. Add of the parent objects to the 'IJElements
collection.

Hints:

 56  
 

Comment the following line:

Set IJNameRule_GetNamingParents
IJNameRule_GetNamingParents = Nothing

Create the collection and declare an object variable to hold a reference to the IJSystemChild.

Set IJNameRule_Ge
IJNameRule_GetNamingParents
tNamingParents = New IMSCoreCollections.JObjec
IMSCoreCollections.JObjectCollection
tCollection

 Dim oSysChild As IJSystemChild


Set oSysChild = oEntity

Declare an object variable to hold a reference to the IJSystem.

 Dim oSysParent As IJSystem


Set oSysParent = oSysChild.GetParent  

Add the parent object into the collection using the method Add as shown here:

 If Not (oSysParent


(oSysParent Is Nothing)
Nothing) Then
Call IJNameRule_Ge
IJNameRule_GetNamingParents
tNamingParents.Add(oSysPar
.Add(oSysParent)
ent)
 End If

Add code snippet to remove the reference from object variables:

Set oSysChild = Nothing


Set oSysParent = Nothing

The resulting lines should look like this:

Set IJNameRu
IJNameRule_GetNamingPar
le_GetNamingParents
ents = New IMSCoreCollections.JObjectCollection
IMSCoreCollections.JObjectCollection

 Dim oSysChild
oSysChild As IJSyst
IJSystemChild
emChild
Set oSysChild = oEntity
 Dim oSysParent
oSysParent As IJSystem
Set oSysParent = oSysChild.GetP
oSysChild.GetParent
arent
 If Not (oSysParent
(oSysParent Is Nothing)
Nothing) Then
Call IJNameRule_Ge
IJNameRule_GetNamingParents
tNamingParents.Add(oSysPar
.Add(oSysParent)
ent)
 End If

Set oSysChild = Nothing


Set oSysParent = Nothing 

12. Access the subroutine ComputeName section by selecting IJNameRule in the Object List
Box and select the ComputeName in the Procedure List Box.

13. Add code snippet to the body of the subroutine ComputeName. The lines should contain
statements for formatting the object name. The object name consists of Parent System Name,
NPD, NPD Unit and Piping Specification Name. For example,

NPD + NPD Units + Spec Name + Parent System

 57  
 

14. Declare an object variable to hold a reference to the IJNamedItem.

 Dim oChildNamedItem
oChildNamedItem As IIJNamedItem
JNamedItem
 Dim strChildName
strChildName As Str
String
ing
Set oChildNamedItem = oObject
strChildName = vbNullString

15. Declare an object variable to hold a reference to the IJDAttributes.

 Dim oAttributes
oAttributes As IIJDAttributes
JDAttributes
Set oAttributes = oObject

16. Declare variables strNPD and strNPDUnits to store the NPD of the PipeRun.

 Dim strNPD
strNPD As String
 Dim strNPDUnitType
strNPDUnitType As String

17. Use the attribute service to get the NPD and NPD Unit as follows:

strNPD = CStr(oAttributes.CollectionOfAttributes("IJRtePipeRun").Item("NPD").Value)
strNPDUnitType = oAttributes.CollectionOfAttributes("IJRtePipeRun").Item("NPDUnitType").Value

 If strNPDUnitType
strNPDUnitType = "in"
"in" Then
strNPDUnitType = Chr(34)
 End If

18. Declare object variables to hold a reference to the DRelationHelper and DCollectionHelper.


Declare an object variable to hold a reference to the IJDSpec. Declare a variable
strSpecName to store the Spec Name.

 Dim oRelationHelper
oRelationHelper As IMSRelation.DRelationHelper
IMSRelation.DRelationHelper
 Dim oCollection
oCollection As IM
IMSRelation.DC
SRelation.DCollectionHelper
ollectionHelper
Set oRelationHelper = oObject  
 Dim oSpec As IJDSpec
 Dim strSpecName
strSpecName As Str
String
ing
Set oCollection = oRelationHe
oRelationHelper.Collection
lper.CollectionRelations("
Relations("IJRtePathRun",
IJRtePathRun", "Spec")
Set oSpec = oCollection.Item(1)
strSpecName = oSpec.SpecName 

19. Add lines to get the Parent Name.

 Dim oParentNamedItem
oParentNamedItem As IJNamedI
IJNamedItem
tem
 Dim strParentName
strParentName As String
String
strParentName = vbNullString
Set oParentNamedItem = elements.Item(1)
strParentName = oParentNamedItem.Name 

20. Build the name of the piperun.

strChildName = strNPD & strNPDUnitType & "-" & strSpecName & "-" & strParentName

 58 
 

oChildNamedItem.Name = strChildName

21. Add lines to remove the reference from object variables.  

Set oChildNamedItem = Nothing


Set oAttributes = Nothing
Set oRelationHelper = Nothing
Set oCollection = Nothing
Set oSpec = Nothing
Set oParentNamedItem = Nothing 

22. Compile the Visual Basic project and save the dll as PipeRun.dll in the c:\train\lab2
23. Save and Exit the program.

Note: You need to reference additional libraries using the SP3D Reference Tool. For
example,

 59 
 

24. Open the c:\train\TrainingNameRules.xls saved in previous lab.


25. Add the name of the class object and the ProgID as follows:

26. Save and Exit Excel.


27. Run Bulkload Utility using the A/M/D mode to add the new naming rule into the training
catalog.
28. Go to SP3D Piping Task and create a PipeRun to test your naming rule. Select and Key in the
following data in the New PipeRun dialog box.

60 
 

61
 

Lab 12: Creating a Naming Rule for Member Parts


Objective

After completing this lab, you will be able to:

   Create a simple naming rule for the Member Part


   Implement the IJNameRule interface
   Reference the appropriate libraries to build the object name
   Use the Attribute Helper service to retrieve Member Part properties
   Use the Relation Helper service to obtain the Cross Section object
   Use Catalog Resource Manager to get a connection to the Code List Meta Data
   Use Model Resource Manager to get a connection to the Model Database
   Use the Name Generator Service to get an unique counter
   Bulk loading the Naming Rule into the Catalog database

This session will demonstrate an implementation of a naming rule for the Member Part objects.
This component will generate a name for Member Part objects as shown here:

Member Part Object:

The Short Description of the Member Category Code List + Section Name + Location +
IndexCounter
62 

1.  Create a directory called lab3 as follows:

c:\train\CustomNameRule\lab3

2.  Run Microsoft Visual Basic 6.0.


3.  Close the Microsoft New Project dialog box.

4.  Select File -> Open Project  option


 option to open the Open Project Dialog box.

5.  Navigate to c:\train\CustomNameRule\Template and open the Naming Rule Template


project.

6.  Setup the Visual Basic Development Environment as shown below:


63 

7.  Go to the Visual Basic Explorer Window and select the Project node. Select File -> Save
Project As option to save the project as MemberPart.vbp under the lab3 directory.

8.  Go to the Visual Basic Explorer Window and select the TemplateName class node. Select
File -> Save TemplateName.cls As option to save the class module as CMemberPart.cls
under lab3 directory.

9.  Go to the Properties Window and change the name of the Project and ClassModule as
follows:
64 

10. Go to the General Declarations section and change the value of the Constant Module variable 
from “TemplateNamingRules:”  to “MemberPart:” 

Private Const Module = “MemberPart: “ 

11. Use the SP3D Reference tool to reference the following libraries or use the Project
>References command. Go to Project -> References option to open the References dialog
box. Select the Browser  button
 button and pick the following libraries:
 Browser 

 Ingr SPSMembers
SPSMembers Entities
Entities 1.0 Type Library
[Install Product]\SmartPlantStructure\Middle\Bin\SPSMembers.dll

 Ingr Sp3d NameGe


NameGenerator
nerator 1.0
1.0 Type Library
Library
[Install Product]\CommonApp\Middle\Bin\NameGenerator.dll

 Ingr SmartPlant3D
SmartPlant3D Relation
Relation 1.0 Type
Type Library
Library
[Install Product]\Core\Middle\Bin\IMSRelation.dll 

12. Insert into your existing project the following Private Functions. Open the GetCatalog.txt file
and GetModel.txt located in the template directory file and use Cut/Paste operation to insert
the code snippet. The inserted code snippet should look like this:

'------------------------------------------
'---------------------------------------------------------
-------------------------
---------------------------
---------------------
----
'Description
' Function returns the CatalogResourceManag
CatalogResourceManager er
'--------------------------
'------------------------------------------
-------------------------------
-------------------------
---------------------------
---------------------
----
Private Function GetCatalogResourceManager() As IUnknown
Const METHOD = "GetCatalogResourceManager"
On Error GoTo ErrHandler

 Dim oDBTypeConfig
oDBTypeConfig As IJDBTypeCo
IJDBTypeConfiguration
nfiguration
65 

 Dim pConnMiddle
pConnMiddle As IJDConnectMiddle
IJDConnectMiddle
 Dim pAccessMiddle
pAccessMiddle As IJDAccessMiddl
IJDAccessMiddlee
 Dim jContext
jContext As IJCont
IJContext
ext
Set jContext = GetJContext()
Set oDBTypeCon
oDBTypeConfigfig = jContext.GetSer
jContext.GetService("DBTypeC
vice("DBTypeConfiguration")
onfiguration")
Set pConnMiddle = jContext.G
jContext.GetService("ConnectMid
etService("ConnectMiddle")
dle")
Set pAccessMiddle = pConnMiddle

 Dim strCatlogDB
strCatlogDB As Str
String
ing
strCatlogDB = oDBTypeConfig.g
oDBTypeConfig.get_DataBaseFr
et_DataBaseFromDBType("
omDBType("Catalog")
Catalog")
Set GetCatalogR
GetCatalogResourceManager
esourceManager = pAccessMiddle.GetResourceManager(
pAccessMiddle.GetResourceManager(strCatlogDB)
strCatlogDB)
Set jContext = Nothing
Set oDBTypeConfig = Nothing
Set pConnMiddle = Nothing
Set pAccessMiddle = Nothing
 Exit Function
 ErrHandler:
m_oErrors.Add
m_oErrors. Add Err.Number, "GetCatalogResourceManager",
"GetCatalogResourceManager", Err.Description
 Err.Raise E_FAIL
 End Function

'------------------------------------------
'---------------------------------------------------------
-------------------------
---------------------------
---------------------
----
'Description
' Function returns the ModelResource Manager
'--------------------------
'------------------------------------------
-------------------------------
-------------------------
---------------------------
---------------------
----
Private Function GetModelR
GetModelResourceManager()
esourceManager() As IUnknown
Const METHOD = "GetModelResourceManager"
On Error GoTo ErrHandler

 Dim jContext
jContext As IJCont
IJContext
ext
 Dim oDBTypeConfig
oDBTypeConfig As IJDBTypeCo
IJDBTypeConfiguration
nfiguration
 Dim oConnectMiddle
oConnectMiddle As IIJDAccessMiddle
JDAccessMiddle
 Dim strModelDBID
strModelDBID As String
Set jContext = GetJContext()
Set oDBTypeCon
oDBTypeConfigfig = jContext.GetSer
jContext.GetService("DBTypeC
vice("DBTypeConfiguration")
onfiguration")
Set oConnectMiddle = jContext.GetSer
jContext.GetService("ConnectMidd
vice("ConnectMiddle")
le")
strModelDBID = oDBTypeConfig.get_DataBaseFromDBType("Model")
Set GetModelR
GetModelResourceManager
esourceManager = oConnectMiddle.GetRes
oConnectMiddle.GetResourceManager(strModelDBID
ourceManager(strModelDBID))

Set jContext = Nothing


Set oDBTypeConfig = Nothing
Set oConnectMiddle = Nothing
 Exit Function
 ErrHandler:
m_oErrors.Add
m_oErrors. Add Err.Number, "GetModelResourceManager",
"GetModelResourceManager", Err.Description
 Err.Raise E_FAIL
 End Function 

13. Go to the General Declarations section and declare object variables to hold the reference to
the IJDCodeListMetaData and IUnknown interfaces.

Private m_oCodeListMetadata As IJDCodeListMetaData


IJDCodeListMetaData
Private m_oModelResourceMgr As IUnknown 
66  

14. Access the subroutine ComputeName section by selecting IJNameRule in the Object List
Box and select the ComputeName in the Procedure List Box.

15. Add code snippet to the body of the subroutine ComputeName. The code snippet should
contain statements for formatting the object name. The object name consists of a string to
indicate the member category, a unique index counter and the section name. For example,

Member Part Object:

Short Description Member Category Code List + Section Name + Location + IndexCounter

Hint:
Declare an object variable to hold a reference to the IJNamedItem

 Dim oChildNamedItem
oChildNamedItem As IJNamedItem
IJNamedItem
Set oChildNamedItem = oObject

Declare an object variable to hold a reference to the IJDAttributes

 Dim oAttributes
oAttributes As IJDAttr
IJDAttributes
ibutes
Set oAttributes = oObject

Declare a variable MemberTypeID to store the MemberType value.

 Dim MemberTypeID As Long

Use the attribute service to get MemberTypeID. The resulting line should look like this:

 MemberTypeID = oAttributes.Co
oAttributes.CollectionOfAt
llectionOfAttributes("ISP
tributes("ISPSMemberType").Item(
SMemberType").Item("TypeCategory").Value 
"TypeCategory").Value

Declare variables to store the codelist table name and short description of the Member Type.

 Dim strTableName
strTableName As String
 Dim strMemType
strMemType As String
strTableName = "StructuralMemberTypeCategory"  
"StructuralMemberTypeCategory" 

Add lines to get the member type short description and set the result to upper case. The
resulting lines should look like this:

 If m_oCodeListMetadata
m_oCodeListMetadata Is Noth
Nothing
ing Then
Set m_oCodeLis
m_oCodeListMetadata
tMetadata = GetCatalogR
GetCatalogResourceManager
esourceManager
 End If
strMemType = UCase(m_oCodeListMetadata.S
UCase(m_oCodeListMetadata.ShortStringValue(
hortStringValue(strTableName MemberTypeID))) 
strTableName,, MemberTypeID)

Use the relation service to get the name of the cross section.
Declare object variables to hold a reference to the DRelationHelper and DCollectionHelper.
Declare an object variable to hold a reference to the IJCrossSection. Declare a variable
strSectionName to store the Cross Section Name.
The resulting lines should look like this:
67  

 Dim oRelationHelper
oRelationHelper As IMSRelation.D
IMSRelation.DRelationHelper
RelationHelper
 Dim oCollection
oCollection As IMSR
IMSRelation.DColl
elation.DCollectionHelper
ectionHelper
Set oRelationHelper = oObject

Set oCollection = oRelationHelper


oRelationHelper.CollectionRelat
.CollectionRelations("ISPSMemberPartP
ions("ISPSMemberPartPrismatic",
rismatic", "Generation6_DEST
"Generation6_DEST")
")
Set oRelationHe
oRelationHelper
lper = oCollection.Item(1)
Set oCollection = Nothing
Set oCollection = oRelationHelper
oRelationHelper.CollectionRelat
.CollectionRelations("ISPSPartP
ions("ISPSPartPrismaticDesign",
rismaticDesign", "Definition_ORIG")
"Definition_ORIG")

 Dim oMembCrossSection
oMembCrossSection As IJCrossSectio
IJCrossSectionn
 Dim strSectionName
strSectionName As String
Set oMembCrossSection = oCollection.Item(1)
Set oAttributes = oCollection.Item(1)
strSectionNamee = oAttributes.Co
strSectionNam oAttributes.CollectionOfAttr
llectionOfAttributes("I
ibutes("IStructCrossSection")
StructCrossSection").Item("SectionName"
.Item("SectionName").Value
).Value

 Dim strChildName
strChildName As Str
String
ing
strChildName = strMemType
strChildName = strChildName + "-" + strSectionName 

Use the Name Generator Service to generate a counter based on the Member Type Category.
Store the formatted name in oChildNamedItem.Name. Declare an object variable to hold a
reference to the IJNameCounter.

 Dim oNameCounter
oNameCounter As IJNameC
IJNameCounter
ounter
Set oNameCounter = New GSCADNameGenerator.
GSCADNameGenerator.NameGeneratorService 
NameGeneratorService

The resulting lines should look like this:

 Dim strLocation
strLocation As String
strLocation = vbNullString

 Dim nCount As Long


Set m_oModelResour
m_oModelResourceMgr
ceMgr = GetModelResourceManager

nCount = oNameCounter.GetCountEx(
oNameCounter.GetCountEx(m_oModelResour
m_oModelResourceMgr,
ceMgr, strChildNam
strChildName,
e, strLocation)
 If Not (strLocation
(strLocation = vbNullString)
vbNullString) Then
strChildName = strChildName + "-" + strLocation + "-" + CStr(nCount)
 Else
strChildName = strChildName + "-" + CStr(nCount)
 End If

oChildNamedItem.Name = strChildName 

16. Add lines to remove the reference from object variables.

Go to the subroutine ComputeName() method:

Set oNameCounter = Nothing


Set oChildNamedItem = Nothing
Set oCollection = Nothing
Set oRelationHelper = Nothing
Set oAttributes = Nothing
68 

Set oMembCrossSection = Nothing 

Go to the Subroutine Terminate() method:

Set m_oCodeListMetadata = Nothing


Set m_oModelResourceMgr = Nothing 

17. Compile the Visual Basic project and save the dll as MemberPart.dll in the c:\train\lab3
18. Save and Exit the program.
19. Open c:\train\TrainingNameRules.xls.
20. Add the name of the class object and the ProgID as follows:

20. Save and Exit Excel. 


21. Run Bulkload Utility using the A/M/D mode and add the new naming rule into the training
catalog. 
22. Go to SP3D Structure task and run the Place Member Command to test your naming rule.
Select and key in the following data in the Member properties dialog box.  
69 

 
70 

Lab 13: Piping Component Symbol


Objective

After completing this lab, you will be able to:

  Create Piping Component symbols using the SmartPlant 3D Part Definition Wizard

Create a simple weld neck flange symbol.


sy mbol.

Skip the following lines (1-2) if the symbol wizard is installed on your machine.

1.  Go to [Install Directory]\Programming\Tools\SymbolWizard


2.  Install SP3D Visual Basic Symbol Wizard in device c:\Program Files\ SP3D Symbol Wizard
3.  Create the following directories:

c:\train\SP3DFWN
c:\train\IngrModules

4.  Run Microsoft Visual Basic 6.0


5.  Close the Microsoft New Project dialog box.

6.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.
71 

7.  The Next step is to create the weld neck flange component symbol definition template using
SP3D Part Definition Symbol Wizard.

8.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: SP3DFWN  


Author: Student  
Company: Intergr aph 
 Intergraph
Intergraph Module location: c:\Train\IngrModules  
Save the Visual Basic project as: c:\Train\SP3DFWN  
Disable the create bulkload spreadsheet.
72 

9.  Select Next button to go the next page. This page is to define any properties that are constant
for all occurrences of the piping part. Key in the following data:

10. Select Next button to go the next page. This page defines all occurrence properties of the

piping part. Select Next button to go the next page. This page identifies all the outputs of the
73 

piping part. We are going to define three outputs: body and two piping nozzle for our
weldneck flange. The Body output is in the Simple Physical aspect.

11. Press Next button and Finish button to create the SP3DFWN project template. The Visual
Basic project consists of the following modules:

12. Open the CSP3DFWN Class module. This Class contains several routines.


13. Go to the Class_Initialize() routine. Review the inputs and outputs section.

Private Sub Class_Initialize()


Const METHOD = "Class_Initialize:"
On Error GoTo Errx
Set m_oSymbolHelper = New SymbolServices
74 

m_oSymbolHelper.ProjectName = "SP3DFWN"
m_oSymbolHelper.ClassName = "CSP3DFWN"

' Inputs
m_oSymbolHelper.NumInputs
m_oSymbolHelper.NumInputs = 1
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 1, "FacetoFace", "FacetoF
"FacetoFace",
ace", 2

' Outputs
m_oSymbolHelper.NumOutputs = 3
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "PipingNoz1", "Nozzle 1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "PipingNoz2", "Nozzle 2", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1

 Exit Sub
 Errx:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHOD, Er
Err.Description,
r.Description, _
 Err.HelpFile,
 Err.HelpFile, Err.HelpC
Err.HelpContext
ontext
 End Sub

14. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
15. Go to the “ Insert your output (Body1)” section. The following code snippet will use
your code for output
the m_oGeomHelper.CreateCone() routine to create a Cone for the Body. In addition, this
code snippet uses the RetrieveParameters function to retrieve the nozzle information from the
generic data.

' Insert your code for output (Body1)

 RetrieveParameters
 RetrieveParameters 1, oPartF
oPartFclt,
clt, m_Outpu
m_OutputColl,
tColl, pipeD
pipeDiam,
iam, flangeThick,
flangeThick, flangeDiam, cptOffset, depth

 Dim stPosition
stPosition As IJDPosit
IJDPosition
ion
 Dim enPosition
enPosition As IJDPosi
IJDPosition
tion

Set stPosition = New DPosition


Set enPosition = New DPosition

stPosition.Set -parFacetoFace / 2 + flangeThick, 0, 0


enPosition.Set parFacetoFace
parFacetoFace / 2, 0, 0

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCone(
.CreateCone(arrayOfOutputs(iOutpu
arrayOfOutputs(iOutput),
t), stPosition, enPosition, pipeDiam
+ flangeDiam / 4, pipeDiam )

Use the Set statement to remove references from all object variables.

Set ObjBody1 = Nothing


Set stPosition = Nothing
Set enPosition = Nothing

16. Compile the Visual Basic project and save the dll in the c:\train \SP3DFWN  
 \SP3DFWN 
75 

17. Save the Visual Basic SP3DFWN project.

18. Open the [Install Product]\ CatalogData\BulkLoad\Datafiles\ Ten_Specs_CatalogData.xls.


Make sure to remove the Read-Only setting on the file.
19. Find the WeldNeckFlange part class and a new part using the new symbol definition
SP3DFWN.CSP3DFWN

In the Part Section:

20. Save the file in c:\train\SP3DFWN\ Ten_Specs_CatalogData.xls.


21. Open the [Install Product]\ CatalogData\BulkLoad\Datafiles\
Ten_Specs_SpecificationData.xls. Make sure to remove the Read-Only setting on the file.
22. Add a new option for this weld neck flange in the piping commodity filter for spec 1c0031.

23. Add a new entry in the piping commodity material control data sheet.
76  

24. Save the file in c:\train\SP3DFWN\ Ten_Specs_SpecificationData.xls. Load the information


into the Catalog using the A/M/D mode.
25. Go to the Piping Task and place this flange component using 1C0031 spec.
77  

Lab 14: Piping Instrument Symbol


Objective

After completing this lab, you will be able to:

  Create Piping Instrument symbols using the SmartPlant 3D Part Definition Wizard

Create a simple instrument symbol.

1.  Create the following directories:

c:\train\GenericComp
c:\train\IngrModules

2.  Run Microsoft Visual Basic 6.0


3.  Close the Microsoft New Project dialog box.

4.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

5.  The Next step is to create the generic component symbol definition template using SP3D Part
Definition Symbol Wizard.
78 

6.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: GenericComp 


Author: Student  
Company: Intergr aph 
 Intergraph
Intergraph Module location: c:\Train\IngrModules  
Save the Visual Basic project as: c:\Train\GenericComp 
Disable the create bulkload spreadsheet.

7.  Select Next button to go the next page. This page is to define any properties that are constant
for all occurrences of the piping part. Key in the following data:
79 

8.  Select Next button to go the next page. This page defines all occurrence properties of the
piping part. Select Next button to go the next page. This page identifies all the outputs of the
piping part. We are going to define three outputs: body and two piping nozzles for our
GenericComp. The Body output is in the Simple Physical aspect.
80 

9.  Press Next button and Finish button to create the GenericComp project template. The Visual
Basic project consists of the following modules:

10. Open the CGenericComp Class module. This Class contains several routines.


11. Go to the Class_Initialize() routine. Review the inputs and outputs section.
12. Make sure the MajorBodyDiameter is mapped to “B” for the second input.

Private Sub Class_Initialize()


Const METHOD = "Class_Initialize:"
On Error GoTo Errx

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "GenericComp"
m_oSymbolHelper.ClassNam
m_oSymbolHe lper.ClassNamee = "CGenericComp"

' Inputs
m_oSymbolHelper.NumInputs
m_oSymbolHelper.NumInputs = 2
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 1, "FacetoFace", "FacetoF
"FacetoFace",
ace", 3
 m_oSymbolHelper
 m_oSymbolHelper.AddInpu
.AddInputDef
tDef 2, ""B",
B", "M
"MajorBod
ajorBodyDiameter"
yDiameter",, 4 

' Outputs
m_oSymbolHelper.NumOutputs = 3
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "FABody", "FABody", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "PipingNoz1", "Nozzle 1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "PipingNoz2", "Nozzle 2", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1

 Exit Sub
 Errx:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHOD, Er
Err.Description,
r.Description, _
 Err.HelpFile,
 Err.HelpFile, Err.HelpC
Err.HelpContext
ontext
 End Sub 

13. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
14. Go to the “ Insert your
your code for output Body)” section. The following code snippet will
output (FA Body)”
use the m_oGeomHelper.CreateCylinder() routine to create a Cylinder for the Body. The
PlaceCylinder routine is defined in the geometry helper service. This function creates
persistent projection of a circle based on two points and diameter.
81 

In addition, this code snippet uses the RetrieveParameters function to retrieve the nozzle
information from the generic data.

' Insert your code for output (FABody)

 RetrieveParameters 1, oPartF
 RetrieveParameters oPartFclt,
clt, m_Outpu
m_OutputColl,
tColl, pipeD
pipeDiam,
iam, flangeThick,
flangeThick, flangeDiam, cptOffset, depth
 Dim stPoint
stPoint As IJDPosi
IJDPosition
tion
 Dim enPoint
enPoint As IJDPosit
IJDPosition
ion
Set stPoint = New DPosition
Set enPoint = New DPosition
stPoint.Set -parFacetoFace / 2 + flangeThick, 0, 0
enPoint.Set parFacetoFace
parFacetoFace / 2 - flangeThick, 0, 0

' Set the output


iOutput = iOutput + 1
Set ObjFABo
ObjFABodydy = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stPoint, enPoint,
 parMajorBodyDiameter)
 parMajorBodyDiame ter)
Set stPoint = Nothing
Set enPoint = Nothing

Use the Set statement to remove references from all object variables.

Set objNozzle = Nothing


Set CenterPos = Nothing
Set oPlacePoint = Nothing
Set oDir = Nothing
Set ObjFABody = Nothing

15. Compile the Visual Basic project and save the dll in the c:\train \GenericComp 
 \GenericComp
16. Save the Visual Basic GenericComp project.
17. Open the [Install Product]\ CatalogData\BulkLoad\Datafiles\Instrument Data.xls. Make sure
to remove the Read-Only setting on the file.
18. Create a New Part Class called GenericComp with the following data:
Hint: Use the ANG sheet as a template

In the class definition row:

Make sure you delete the UserClassName and OccClassName cells.

Note: Creating the bmp file is optional. You can use Microsoft Paint to create the file and
your \\machine\sym
save it under your \\machine\symbols\Sym
bols\SymbolIcons
bolIcons  

In the part definition row, edit the attributes as shown here:


82 

Add ports and generic component body data, as shown here:


Note: Make sure you edit the correct dimensional attributes.

19. Go to the InstrumentClassData sheet and add the following data:


83 

20. Save the file in c:\train\GenericComp\ Instrument Data.xls. Load the information into the
Catalog using the Append mode. Once the bulkload process is completed, run the View
Generator utility on the model to re-create the views in the model database. Finally, Re-
generate the report databases.
21. Go to the Piping Task and place the Generic Component.
84 

Lab 15: Valve Operator Symbol


1.  Create the following directory:

c:\train\ SP3DOP431

2.  Run Microsoft Visual Basic 6.0


3.  Close the Microsoft New Project dialog box.

4.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

5.  The Next step is to create the operator symbol definition template using SP3D Part Definition
Symbol Wizard.
85 

6.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: SP3DOP431 


Author: Student  
Company: Intergr aph 
 Intergraph
Intergraph Module location: c:\Train\IngrModules  
Save the Visual Basic project as: c:\Train\ SP3DOP431 
Disable the create bulkload spreadsheet.
86  

7.  Select Next button to go the next page. This page is to define any properties that are constant
for all occurrences of the operator part. Key in the following data:

Note: Key-in IJUAOP431 for the interface name.


87  

8.  Select Next button to go the next page. This page defines all occurrence properties of the
operator part. Select Next button to go the next page. This page identifies all the outputs of
the operator part. We are going to define one output: Operator Body  

9.  Press Next button and Finish button to create the Operator project template. The Visual Basic
project consists of the following modules:

10. Open the CSP3DOP431 Class module. This Class contains several routines.


11. Go to the Class_Initialize() routine. Review the inputs and outputs section. Add two
additional outputs as shown below:

Private Sub Class_Initialize()


Const METHOD = "Class_Initialize:"
On Error GoTo Errx

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "SP3DOP431"
88 

m_oSymbolHelper.ClassName = "CSP3DOP431"

' Inputs
m_oSymbolHelper.NumInputs
m_oSymbolHelper.NumInputs = 2
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 1, "OperatorHeight", "OperatorHe
"OperatorHeight",
ight", 1
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 2, "OperatorDiameter",
"OperatorDiameter", "OperatorDiam
"OperatorDiameter",
eter", 0.5

'  m_oSymb
Outputs olHelper.NumOutputs
 m_oSymbolHelper.NumOutputs = 3
 m_oSymbolHelper.AddOutpu
 m_oSymbolHelper.AddOutputDef
tDef 1, "O
"OPBody1",
PBody1", "OPBo
"OPBody1",
dy1", 1
 m_oSymbolHelper
 m_oSymbolHelper.AddOutpu
.AddOutputDef
tDef 2, "O
"OPBody2",
PBody2", "OPBo
"OPBody2",
dy2", 1
 m_oSymbolHelper
 m_oSymbolHelper.AddOutpu
.AddOutputDef
tDef 3, "O
"OPBody3",
PBody3", "OPBo
"OPBody3",
dy3", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1

 Exit Sub
 Errx:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHOD, Er
Err.Description,
r.Description, _
 Err.HelpFile,
 Err.HelpFile, Err.HelpC
Err.HelpContext
ontext
 End Sub

12. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
13. Go to the “ Insert your
your code for output (OPBody)” section. The following code snippet will
output 1 (OPBody)
use the m_oGeomHelper.CreateCone() routine to create a Cone for the Body. The PlaceCone
routine is defined in the geometry helper service. This function creates a persistent object
based on two points and two diameters.

' Insert your code for output (OPBody)


 Dim ConeCenterBasePt
ConeCenterBasePt As IJDPosition
IJDPosition
 Dim ConeCenterTopPt
ConeCenterTopPt As IJDPosi
IJDPosition
tion
Set ConeCenterBasePt = New DPosition
Set ConeCenterTopPt = New Dposition

' A value of 0.0000001


0.0000001 is used to a
avoid
void symbol placement
placement failure (gives
(gives assertion errors).

ConeCenterTopPt.Set 0, parOperatorHe
ConeCenterTopPt.Set parOperatorHeight,
ight, 0
ConeCenterBasePt.Set
ConeCenterBasePt.Set 0, 0, 0.0000001

 Dim ObjOPBody
ObjOPBody As IngrGeom3D.Cone3d
IngrGeom3D.Cone3d
iOutput = iOutput + 1

' A value of 0.00001


0.00001 is used to a
avoid
void symbol placement
placement failure
failure (gives assertion errors).

Set ObjOPBody = m_oGeomH


m_oGeomHelper.CreateCon
elper.CreateCone(arrayOfOutputs(
e(arrayOfOutputs(iOutput),
iOutput),
ConeCenterBasePt,ConeCenterTopPt,
ConeCenterBasePt,ConeCenterTopP t, 0.00001, parOperatorDiameter)
parOperatorDiameter)

14. The following code snippet will use the Geometry factory functions to create a dome for the
top of the operator.

 Dim oGeomFactory
oGeomFactory As New IngrGeom3D.GeometryFac
IngrGeom3D.GeometryFactory
tory
89 

 Dim oEllipticalArc
oEllipticalArc As IngrGeom3D.
IngrGeom3D.EllipticalArc3d
EllipticalArc3d
 Dim oRevolution
oRevolution As Ingr
IngrGeom3D.Revolu
Geom3D.Revolution3d
tion3d
 Dim PI As Double

 Dim dRadius
dRadius As Double

‘Center: 0,opdiameter/2,0

'Normal: 0,0,1
'MajorAxis
'MajorAxis: (North)
: 0,radius,0
'Ratio: 1
‘Start angle: 270
'Sweep angle 90

PI = 4 * Atn(1)
dRadius = parOperatorDiameter
parOperatorDiameter / 2
Set oEllipticalArc = oGeomFactory.EllipticalArcs3d.CreateByCenterNormalMajAxisRatioAngle(Nothing, _
0, parOperatorHeight, 0, 0, 0, 1, 0, dRadius, 0, _
1, PI * 1.5, PI / 2)

Set oRevolution = oGeomFactor


oGeomFactory.Revolutions3d.C
y.Revolutions3d.CreateByCurve(
reateByCurve(m_OutputColl.R
m_OutputColl.ResourceManager,
esourceManager, _
oEllipticalArc, 0, 1, 0, 0, 0, 0, 2 * PI, False)

iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oRevolution

 Dim oCircle
oCircle As IngrGeom3D.Circle3d
IngrGeom3D.Circle3d
Set oCircle = oGeomFactor
oGeomFactory.Circles3d.Cr
y.Circles3d.CreateByCenterN
eateByCenterNormalRadius(m
ormalRadius(m_OutputColl.Resour
_OutputColl.ResourceManager,
ceManager, _
0, parOperatorHeight, 0, 0, 1, 0, dRadius)

iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oCircle

Set oCircle = Nothing


Set oRevolution = Nothing
Set oEllipticalArc = Nothing
Set oGeomFactory = Nothing
Set ConeCenterBasePt = Nothing
Set ConeCenterTopPt = Nothing
Set ObjOPBody = Nothing

Note: Go to the variable declaration and delete Dim ObjOPBody As Object

15. Compile the Visual Basic project and save the dll in the c:\Train\ SP3DOP431
SP3DOP431 
16. Save the Visual Basic SP3DOP431 project.

17. Open the Instrument Data.xls.


18. Create a New Part Class called Operator431 with the following data:
Hint: Copy the Operator3 sheet from the Ten_Specs_CatalogData.xls

Review and edit the part class definition as shown here:


 90 

Review and edit the part definition as shown here:

Add the letter A on the part class and part entries.

19. Go to the InstrumentClassData sheet and add the following data to F001 instrument.
Remember to add the letter M.

Valve Operator Data:


 91 

20. Go to the ValveOperatorMatlControlData sheet located in Ten_Specs_SpecificationData.xls


and add the following data:

Add this ValveOperatorMatlControlData sheet to the Instrument Data.xls. Modify the


Instrument symbol GenericComp (done in previous lab) by adding the operator 431 as
follows: 

21. Open the GenericComp.vbp project.


22. Go to the output section and add the operator as shown below:

' Outputs
m_oSymbolHelper.NumOutputs = 4
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "FABody", "FABody", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "PipingNoz1", "Nozzle 1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "PipingNoz2", "Nozzle 2", 1
 m_oSymbolHelper
 m_oSymbolHelper.AddOutpu
.AddOutputDef
tDef 4, "V
"ValveOpera
alveOperator",
tor", "
"ValveOpera
ValveOperator",
tor", 1

23. Go to CSimplePhysical Class module and add your code snippet to reference the operator
symbol:

 Dim oSymbolHelper
oSymbolHelper As IJS
IJSymbolGeometryH
ymbolGeometryHelper
elper
Set oSymbolHelper = New SP3DSymbolHelper.SymbolServices
oSymbolHelper.OutputCollection
oSymbolHelper.Outp utCollection = m_OutputColl

On Error Resume Next


 Dim oDirX
oDirX As IJDVector
IJDVector
 Dim oDirY
oDirY As IJDVector
IJDVector
 Dim oDirZ
oDirZ As IJDVector
IJDVector
Set oDirX = New DVector
Set oDirY = New DVector
Set oDirZ = New DVector

oDirX.Set 1, 0, 0
oDirY.Set 0, 1, 0
 92 

oDirZ.Set 0, 0, 1

 Dim oPipeComponent
oPipeComponent As IJDPipeCompon
IJDPipeComponent
ent
Set oPipeComponent = oPartFclt
On Error GoTo ErrorLabel
 Dim oOperatorPart
oOperatorPart As IIJDPart
JDPart
 Dim oOperatorOcc
oOperatorOcc As IJPartOcc

 If Not oPipeComponent


oPipeComponent
Set oOperatorPart Is Nothing Th
Then
en .GetValveOperatorPart
= oPipeComponent
oPipeComponent.GetValveOpera torPart
 If Not oOperatorPart
oOperatorPart Is Noth
Nothing
ing Then
 Dim OpOrigin
OpOrigin As IJDP
IJDPosition
osition
Set OpOrigin = New DPosition
OpOrigin.Set 0, 0, 0
Set oOperatorOcc
o OperatorOcc = oSymbolHelper.Cr
oSymbolHelper.CreateChildPartO
eateChildPartOcc("ValveOperator"
cc("ValveOperator",, oOperatorPart, OpOrigin,
oDirX, oDirY, oDirZ)

 End If
 End If
Set oSymbolHelper = Nothing
Set oOperatorPart = Nothing
Set oPipeComponent = Nothing
Set oOperatorOcc = Nothing

24. Open the properties page of the Visual Basic project and increase the dll version number.
25. Compile the Visual Basic project and save the dll in the c:\Train\  GenericComp
 GenericComp 
26. Save the Visual Basic GenericComp project.
27. Load the information into the Catalog using the Add/Edit/Modify mode. Once the bulkload
process is complete.
28. Go to Project Management task and run the synchronize model with the catalog database
command. Finally, Re-generate the report databases.
29. Go to the Piping Task and place the Generic Component. Notice the system displays the
operator.
 93 

 
 94 

Lab 16: Piping Symbol with Multiple


Representations (Optional)

Modify the instrument symbol (GenericComp) by adding another cylinder shape to represent
a reserved space for operations.

1.  Open the GenericComp.vb program and add/edit the following entries in the output section:

' Outputs
 m_oSymbolHelper
 m_oSymbolHelper.NumOutputs
.NumOutputs = 5
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "FABody", "FABody", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "PipingNoz1", "Nozzle 1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "PipingNoz2", "Nozzle 2", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 4, "ValveOperator"
"ValveOperator",, "ValveOperator", 1 
"ValveOperator",
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 5, "Shape1", "Shape1", 64

2.  Add/edit the following entries in the Aspect section:

' Aspects
m_oSymbolHelper.NumAspects = 2
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 2, "Operation", "Operation", 64

3.  Create a new class module called COperation


 95 

Add the following code snippet in the COperation class module:

In the Declaration section:

Option Explicit
Private Const MODULE = "CGenericComp" 'Used for error messages
Private m_oGeomHelper As IJSymbolGeometryHelper
Private Const E_FAIL = &H80004005

In the Class_Initialize subroutine:

Private Sub
S ub Class_Initialize()
Const METHOD = "Class_Initialize"
On Error GoTo Errx
Set m_oGeomHelper = New SymbolServices
 Exit Sub

 Errx:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHO
METHOD,
D, Err.Descrip
Err.Description,
tion, _
 Err.HelpFile,
 Err.HelpFile, Err.H
Err.HelpContext
elpContext
 End Sub

Create the Run() routine.


Hint: Copy the lines from the physical module and edit the appropriate lines.

Use the PlaceCylinder() routine to create a cylinder for the shape. The PlaceCylinder routine
is defined in the geometry helper service. This function creates a persistent projection of a
circle based on two points and diameter.
 96  

Public Sub run(ByVal m_OutputColl As Object, ByRef arrayOfInputs(), arrayOfOutputs() As String)

Const METHOD = "run"


On Error GoTo ErrorLabel

 Dim oPartFclt
oPartFclt As PartFac
PartFacelets.IJDPart
elets.IJDPart
 Dim pipeDiam
pipeDiam As Double
 Dim flangeThick
flangeThick As Double
 Dim cptOffset
cptOffset As Double
 Dim flangeDiam
flangeDiam As Double
 Dim depth
depth As Double

 Dim iOutput
iOutput As Double
 Dim ObjFABody
ObjFABody As Object
 Dim parFacetoFace
parFacetoFace As Double
Double
 Dim parMajorBodyDiameter
parMajorBodyDiameter As Double

' Inputs
Set oPartFclt = arrayOfInputs(1)
 parFacetoFace = arrayOfInputs(2)
 parMajorBodyDiameter
 parMajorBodyDiam eter = arrayOfInputs(3)
arrayOfInputs(3)
m_oGeomHelper.OutputCollection = m_OutputColl

iOutput = 0
' Insert your code for output (Shape1)

 RetrieveParameters
 RetrieveParameters 1, oPartF
oPartFclt,
clt, m_Outpu
m_OutputColl,
tColl, pipeD
pipeDiam,
iam, flangeThick,
flangeThick, flangeDiam, cptOffset, depth
 97  

 Dim stPoint
stPoint As IJDPosi
IJDPosition
tion
 Dim enPoint
enPoint As IJDPosit
IJDPosition
ion
Set stPoint = New DPosition
Set enPoint = New DPosition

stPoint.Set 0, - parMajorBodyDiameter / 2, 0
enPoint.Set 0, - parMajorBodyDiameter / 2 - 2 * parMajorBodyDiame
parMajorBodyDiameter,
ter, 0

iOutput = iOutput + 1
Set ObjFABo
ObjFABodydy = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stPoint, enPoint,
 parMajorBodyDiameter
 parMajorBodyDiame ter / 2)
Set stPoint = Nothing
Set enPoint = Nothing
Set ObjFABody = Nothing
 Exit Sub

 ErrorLabel:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHOD, Er
Err.Description,
r.Description, _
 Err.HelpFile,
 Err.HelpFile, Err.HelpC
Err.HelpContext
ontext
 Resume Next
 End Sub

 In the Class_Termin


Class_Terminate
ate subroutine:
subroutine:
Private Sub Class_Terminate()
Class_Terminate()
Set m_oGeomHelper = Nothing
 End Sub 

4.  Open the properties page of the Visual Basic project and increase the dll version number.
5.  Compile the Visual Basic project and save the dll in the c:\Train\  GenericComp
 GenericComp 
6.  Save the Visual Basic GenericComp project.
7.  Go to the instrument part class and add the letter M to the part class definition and part.
8.  Update the part class instrument using the bulkload utility.
9.  Go to Project Management task and run the synchronize model with the catalog database
command.
10. Go to the Piping Task and place the Generic Component. Turn on the Operation Aspect and
notice the system displays the new shape.
 98 

Lab 17: 90 deg vertical outside cabletray fitting


Symbol (Optional)
Objective

After completing this lab, you will be able to:

  Create cabletray component symbols using the SmartPlant 3D Part Definition Wizard

1.  Create the following directories:

c:\train\SP3D90VTrayOutside

2.  Run Microsoft Visual Basic 6.0


3.  Close the Microsoft New Project dialog box.

4.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

5.  The Next step is to create the 90 deg vertical outside cabletray symbol definition template
using SP3D Part Definition Symbol Wizard.
 99 

6.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: SP3D90VTrayOutside 


Author: Student  
Company: Intergr aph 
 Intergraph
Intergraph Module location: c:\Train\IngrModules  
Save the Visual Basic project as: c:\Train\ SP3D90VTrayOutside 
Disable the create bulkload spreadsheet.
100 

7.  Select Next button to go the next page. This page is to define any properties that are constant
for all occurrences of the cabletray part. Key in the following:

8.  Select Next button to go the next page. This page defines all occurrence properties of the
cabletray part. Select Next button to go the next page. This page identifies all the outputs of
101 

the tray part. We are going to define 1 output. The Body output is in the Simple Physical
aspect.

9.  Press Next button and Finish button to create the SP3D90VTrayOutside project template. The
Visual Basic project consists of the following modules:

10. Open the CSP3D90VTrayOutside Class module. This Class contains several routines.


11. Go to the Class_Initialize() routine. Review the inputs and outputs section. Add additional
outputs as shown below:

Private
ConstSub Class_Initialize()
METHOD = "Class_Initialize:"
On Error GoTo Errx
102 

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "SP3D90VTrayOutside"
m_oSymbolHelper.ClassName = "C90VTOutside"

' Inputs

m_oSymbolHe
m_oSymbolHelper.NumInputs
lper.NumInputs
m_oSymbolHelper.AddInputDe
m_oSymbolHe =f 1,
lper.AddInputDef 1 "FrameRadius", "FrameRadius"
"FrameRadius",, 0.03

' Outputs
m_oSymbolHelper.NumOutputs = 8
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "Body2", "Body2", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "Body3", "Body3", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 4, "Body4", "Body4", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 5, "Body5", "Body5", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 6, "Body6", "Body6", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 7, "port1", "port1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 8, "port2", "port2", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1

 Exit Sub
 Errx:
 Err.Raise Err.Number, Err.Source
Err.Source & " " & METHOD, Er
Err.Description,
r.Description, _
 Err.HelpFile,
 Err.HelpFile, Err.HelpC
Err.HelpContext
ontext
 End Sub

12.  Go to CSimplePhysical Class module and declare all variables for your inputs and outputs 

 Dim parActualWidth
parActualWidth As Double
Double
 Dim parActualDepth
parActualDepth As Double
Double
 Dim parBendRadius
parBendRadius As Double
Double
 Dim oPort1 As New AutoMath.DPosition
 Dim oPort2 As New AutoMath.DPosition

13. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
14. Go to the “ Insert your output (Body1)” section. Use the
your code for output
RetrieveCableTrayPortProperties function to retrieve the port information from the part.

 Dim oTrayPart
oTrayPart As IJCab
IJCableTrayPart
leTrayPart
Set oTrayPart = oPartFclt
 parBendRadius = oTrayPart.Ben
oTrayPart.BendRadius
dRadius

' Insert your code for output 1


Call RetrieveCableT
RetrieveCableTrayPortProper
rayPortProperties(1,
ties(1, oPartFclt, parActualWidth, parActualDepth)
 Dim CP As New AutoMath.DPosition
AutoMath.DPosition 'arc center poin
pointt
 Dim HalfDepth
HalfDepth As Double
 Dim HalfWidth
HalfWidth As Double

 Dim LineStrPoints(0
LineStrPoints(0 T
To
o 11) As Double
 Dim Angle
Angle As Double
103 

 Dim ProjVector
ProjVector As New AutoMath.DVector
AutoMath.DVector

 Dim oLineString
oLineString As IngrGeom3D.LineString
IngrGeom3D.LineString3d
3d
 Dim geomFactory
geomFactory As IngrGeom3D.G
IngrGeom3D.GeometryFactory
eometryFactory
Set geomFactory = New IngrGeom3D.GeometryFactory
 Angle = 2 * Atn(1)
Atn(1)

 HalfDepth = parActualDepth / 2
 HalfWidth
 HalfWid th = parActualW
parActualWidth
idth / 2
oPort1.Set 0, 0, -(parBendRadius + HalfDepth)
oPort2.Set (parBendRadius + HalfDepth), 0, 0

 Dim LineStrCP
LineStrCP As N New
ew AutoMath.DPosition
AutoMath.DPosition
 LineStrCP.Set
 LineStrCP.Set 0, 0, -(
-(parBendRadius
parBendRadius + H
HalfDepth)
alfDepth)

 LineStrPoints(0)
 LineStrPoints(0) = L
LineStrCP.x
ineStrCP.x - H
HalfDepth
alfDepth
 LineStrPoints(1) = L
 LineStrPoints(1) LineStrCP.y
ineStrCP.y - H
HalfWidth
alfWidth
 LineStrPoints(2)
 LineStrPoints(2) = L
LineStrCP.z
ineStrCP.z

 LineStrPoints(3) = L
 LineStrPoints(3) LineStrCP.x
ineStrCP.x + HalfDepth
 LineStrPoints(4)
 LineStrPoints(4) = L
LineStrCP.y
ineStrCP.y - H
HalfWidth
alfWidth
 LineStrPoints(5)
 LineStrPoints(5) = L
LineStrCP.z
ineStrCP.z

 LineStrPoints(6) = L
 LineStrPoints(6) LineStrCP.x
ineStrCP.x + HalfDepth
 LineStrPoints(7)
 LineStrPoints(7) = L
LineStrCP.y
ineStrCP.y + HalfWidth
 LineStrPoints(8)
 LineStrPoints(8) = L
LineStrCP.z
ineStrCP.z

 LineStrPoints(9) = L
 LineStrPoints(9) LineStrCP.x
ineStrCP.x - H
HalfDepth
alfDepth
 LineStrPoints(10)
 LineStrP oints(10) = L
LineStrCP.y
ineStrCP.y + HalfWidth
 LineStrPoints(11)
 LineStrP oints(11) = L
LineStrCP.z
ineStrCP.z
Set oLineString = geomFactory.LineStrings3d.Create
geomFactory.LineStrings3d.CreateByPoints(Noth
ByPoints(Nothing,
ing, 4, LineStrPoints)
LineStrPoints)
ProjVector.Set 0, 1, 0
CP.Set (parBendRadius + HalfDepth), 0, -(parBendRadius + HalfDepth)
Set ObjBody1 = PlaceRevolution(m_OutputColl, oLineString, ProjVector, CP, Angle, False)
Set oLineString = Nothing
' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, ObjBody1
Set ObjBody1 = Nothing

'built the support

 Dim stpoint
stpoint As IJDPosition
IJDPosition
 Dim enpoint
enpoint As IJDPosi
IJDPosition
tion

Set stpoint = New DPosition


Set enpoint = New DPosition

'support cylinder ----------


stpoint.Set -HalfDepth, HalfWidth + parFrameRadius / 2, HalfDepth
enpoint.Set -HalfDepth, -HalfWidth - parFrameRadius / 2, HalfDepth

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stpoint, enpoint,
 parFrameRadius)
Set ObjBody1 = Nothing
104 

'vertical cylinders------
cylinders----------
----
stpoint.Set oPort1.x - HalfDepth, oPort1.y - HalfWidth, oPort1.z
enpoint.Set -HalfDepth, -HalfWidth, HalfDepth

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stpoint, enpoint,

 parFrameRadius)
Set ObjBody1 = Nothing

'-----------
stpoint.Set oPort1.x - HalfDepth, oPort1.y + HalfWidth, oPort1.z
enpoint.Set -HalfDepth, HalfWidth, HalfDepth

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stpoint, enpoint,
 parFrameRadius)
Set ObjBody1 = Nothing

'horizontal cylinders------
cylinders-----------
-----
stpoint.Set oPort2.x, oPort2.y - HalfWidth, oPort2.z + HalfDepth
enpoint.Set -HalfDepth, -HalfWidth, HalfDepth

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stpoint, enpoint,
 parFrameRadius)
Set ObjBody1 = Nothing

'-----------
stpoint.Set oPort2.x, oPort2.y + HalfWidth, oPort2.z + HalfDepth
enpoint.Set -HalfDepth, HalfWidth, HalfDepth

iOutput = iOutput + 1
Set ObjBody1 = m_oGeomHelper
m_oGeomHelper.CreateCylinder(
.CreateCylinder(arrayOfOutputs(
arrayOfOutputs(iOutput),
iOutput), stpoint, enpoint,
 parFrameRadius)
Set ObjBody1 = Nothing

Set stpoint = Nothing


Set enpoint = Nothing

' Place Nozzle 1


 Dim oDir
oDir As AutoMath.D
AutoMath.DVector
Vector
 Dim oRadialOrient
oRadialOrient As AutoMath.DVec
AutoMath.DVector
tor
 Dim objCableTrayPort
objCableTrayPort As GSCADNozz
GSCADNozzleEntities.I
leEntities.IJCableTrayPor
JCableTrayPortOcc
tOcc

Set oDir = New AutoMath.DVector


Set oRadialOrient = New AutoMath.DVector

oDir.Set 0, 0, -1
oRadialOrient.Set
oRadialOrient.S et -1, 0, 0
Set objCableTrayPort = CreateCableTrayPort(oPartFclt, 1, oPort1, oDir, oRadialOrient, m_OutputColl)
' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, objCableTra
objCableTrayPort
yPort
Set objCableTrayPort = Nothing
Set oPort1 = Nothing
105 

Set oDir = Nothing


Set oRadialOrient = Nothing
' Place Nozzle 2
Set oDir = New AutoMath.DVector
Set oRadialOrient = New AutoMath.DVector
oDir.Set 1, 0, 0
oRadialOrient.Set
oRadialOrient.S et 0, 0, 1

Set objCableTrayPort = CreateCableTrayPort(oPartFclt, 2, oPort2, oDir, oRadialOrient, m_OutputColl)


' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, objCableTra
objCableTrayPort
yPort
Set objCableTrayPort = Nothing
Set oPort2 = Nothing
Set oDir = Nothing
Set oRadialOrient = Nothing

15. Use the SP3D reference tool to find the library that reference to IJCabletrayPart

16. Select Ingr Sp3d RefDataCableway 1.0 Type Library.

17. Compile the Visual Basic project and save the dll in c:\train \ SP3D90VTrayOu tside 
SP3D90VTrayOutside
18. Save the Visual Basic SP3D90VTrayOutside project.
19. Open the [Install Product]\ CatalogData\BulkLoad\Datafiles\CableTray.xls. Make sure to
remove the Read-Only setting on the file.
20. Save workbook as Cabletray2.xls in c:\train. Go to the Custom Interface sheet and edit/add
the following row:

21. Create the CT90VOBendFrame Part Class ass follows:


106  

In the class definition row:

Notes:
 
• UserClassName and OccClassName are optional attributes.
 
• Creating the bmp file is optional. You can use Microsoft Paint to create the file and
save it under your \\ma
your \\machine\sym
chine\symbols\Sym
bols\SymbolIcons
bolIcons..

In the part definition row:

Review and edit the System attributes:


107  

Review and edit the port information:

Review and edit the dimensional attribute:

Go to R-ClassNodeDescribes sheet and add the following row:

22. Load the information into the Catalog using the Append Mode. Once the bulkload process is
complete, review the log file. Next, run the View Generator utility on the model to re-create
the views in the model database. Finally, Re-generate the report databases.
 
23. Go to thespec.
L6-12B Electrical Task and place the 90 deg vertical outside cabletray bend using CB-S1-
108 

 
109 

Lab 18: Electrical Box Connector Symbol


(Optional)
Objective

After completing this lab, you will be able to:

•   Create a Frame Box Connector using the SmartPlant 3D Part Definition Visual Basic
Wizard

Skip the following lines if the symbol wizard is installed on your machine.

1.  Go to [Install Directory]\Programming\Tools\SymbolWizard


2.  Install SP3D Visual Basic Symbol Wizard in device c:\Program Files\ SP3D Symbol Wizard
3.  Create the following directory:
c:\train\SP3DFrameBox

4.  Run Microsoft Visual Basic 6.0. Close the Microsoft New Project dialog box.
110 

5.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

6.  Select Next button to skip the Introduction page. The Next step is to create the
SP3DFrameBox symbol definition template using SP3D part Definition Visual Basic Symbol
Wizard.

7.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: SP3DFrameBox


Author: Student
Company: Intergraph
Intergraph Module location: c:\Train\IngrModules
Save the Visual Basic project as: c:\Train\SP3DFrameBox
111 

8.  Select Next button to go the next page. This page is to define any input properties that are
defined in the part class that are constant for all occurrences. We are going to define two
attributes for our SP3DFrameBox. Key in the following data:
112 

9.  Select Next button to go the next page. Skip this page because our cabletray part does not
have occurrence attributes.

10. Select Next button to go the next page. This page identifies all the outputs of the cabletray
part. We are going to define one output and one port for our SP3DFrameBox. The output is
in the simple Physical aspect.
113 

11. Hit Next button and Finish button to create the SP3DFrameBox project template. The Visual
Basic project consists of the following m
modules:
odules:

12. Open the CSP3DFrameBox Class module. This Class contains several routines.


13. Go to the Class_Initialize() routine
rout ine in the input section. Review the inputs
inputs and add one
output definition for the cabletray port as shown below.

Private Sub Class_Initialize()


Const METHOD = "Class_Initialize:"
On Error GoTo Errx

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "SP3DFrameBox"
m_oSymbolHelper.ClassName = "CSP3DFrameBox"
114 

' Inputs
m_oSymbolHelper.NumInputs = 2
m_oSymbolHelper.AddInputDef 1, "FrameA", "Frame Depth", 4
m_oSymbolHelper.AddInputDef 2, "FrameB", "Frame Width", 4

' Outputs
m_oSymbolHelper.NumOutputs
m_oSymbolHelper.NumOutputs = 2
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 2, "port1", "Port1", 1  

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspectDef 1, "SimplePhysical", "SimplePhysical", 1

Exit Sub
Errx:
Err.Raise Err.Number, Err.Source & " " & METHOD, Err.Description, _
Err.HelpFile, Err.HelpContext
End Sub

14. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
15. Go to the Insert your code for output 1 (Body1) section. The following code snippet will use
the 3D geometry factory to create a frame. Use the 3D geometry factory to create a 3D plane
using the Frame A and Frame B dimensions. Also, use the
RetrieveCableTrayPortproperties() method to retrieve the actual width and actual depth of
the part.

Set oPartFclt = arrayOfInputs(1)


parFrameA = arrayOfInputs(2)
parFrameB = arrayOfInputs(3)
m_oGeomHelper.OutputCollection = m_OutputColl

iOutput = 0

Dim oTrayPart As IJCableTrayPart


Set oTrayPart = oPartFclt

Dim Points(0 To 11) As Double


Dim geomFactory As New IngrGeom3D.GeometryFactory
Dim ObjBody1 As IngrGeom3D.Plane3d

Points(0) = 0
Points(1) = parFrameB / 2
Points(2) = parFrameA / 2
Points(3) = 0
Points(4) = -parFrameB / 2
Points(5) = parFrameA / 2
Points(6) = 0
Points(7) = -parFrameB / 2
Points(8) = -parFrameA / 2

Points(9)
Points(10)==0parFrameB / 2
Points(11) = -parFrameA / 2
115 

Set ObjBody1 = geomFactory.Planes3d.CreateByPoints(m_OutputColl.ResourceManager, 4, Points)


iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), ObjBody1

Note:  Go to tthe
he declaration section and delete this statement Dim ObjBody1
ObjBody1 As Object

17. The following code snippet will use the CreateCableTrayPort() method to create the
cabletray port. The CreateCableTrayPort
CreateCableTrayPort()
() routine is located
located in the Geometry3d module.

Dim oDir As AutoMath.DVector


Dim oRadialOrient As AutoMath.DVector
Dim objCableTrayPort As GSCADNozzleEntities.
GSCADNozzleEntities.IJCableTrayPortOcc
IJCableTrayPortOcc
Set oDir = New AutoMath.DVector
Set oRadialOrient = New AutoMath.DVector

oDir.Set -1, 0, 0
oRadialOrient.Set 0, 0, 1
Set objCableTrayPort = CreateCableTrayPort(oPartFclt, 1, CenterPos, oDir, _
oRadialOrient, m_OutputColl)
' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), objCableTrayPort

Use the Set statement to clear the references from all object variables.

Set objCableTrayPort = Nothing


Set CenterPos = Nothing
Set oDir = Nothing
Set oRadialOrient = Nothing
Set geomFactory = Nothing
Set ObjBody1 = Nothing

18. Use the SP3D reference tool to find the library that reference IJCabletrayPart

19. Select Ingr Sp3d RefDataCableway 1.0 Type Library. Select the Close button.
116  

Compile the Visual Basic project and save the dll in the c:\train\SP3DFrameBox

20. Save the Visual Basic SP3DFrameBox project.


21. Open the Cabletray2.xls workbook under C:\Train1\SP3D90VTrayOutside. Go to the
Custom Interface sheet and edit/add the following entries:

22. Go the R-ClassNodeDescribes sheet and add the following entry.

23. Create the FrameBoxConnector Part Class


Class ass follows:

Review and edit the class definition row:


Notes:
 
• UserClassName and OccClassName are optional attributes.
 
• Creating the bmp file is optional. You can use Microsoft Paint to create the file and
save it under your \\ma
your \\machine\sym
chine\symbols\Sym
bols\SymbolIcons
bolIcons..
117  

In the part definition row:


Review and edit the system attributes:

Review and edit the port information:

Review and edit the dimensional attributes:


118 

24. Open the AllCodeList.xls Excel Workbook. This file is located in


..\CatalogData\BulkLoad\Datafiles
25. Go to CableTrayComponentType sheet
26. Add a Frame Type Box connector (305) in the End Fitting Cable tray Component Class
section as follows:

27. Save as the AllCodelist.xls in c:\Train\SP3DFrameBox 


28. Load the information (Cabletray2.xls and AllCodelist.xls) into the Catalog using the Append
Mode. Once the bulkload process is complete, review the log file. Next, run the View
Generator utility on the model to re-create the views in the model database. Finally, Re-
generate the report databases. 
29. Go to the Electrical Task and place the Frame Box Connector using CB-S1-L6-12B spec.  
30. Undo the placement of the FrameBox to avoid caching the symbol definition in the model.
You are going to modify the FrameBox symbol in lab 19. 
119 

 
120 

Lab 19: Electrical Box Connector - Symbol


Modification (Optional)
Modify the Frame Box connector symbol (SP3DFrameBox) by adding two plates and the hole.

1.  Open the SP3DFrameBox.vb program and add the following entries in the output section:

' Outputs
m_oSymbolHelper.NumOutputs = 4
m_oSymbolHelper.AddOutputDef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputDef 2, "Body2", "Body2", 1
m_oSymbolHelper.AddOutputDef 3, "Body3", "Body3", 1
m_oSymbolHelper.AddOutputDef 4, "port", "port", 1

2.  Go to CSimplePhysical Class module and add your code snippet to create the hole:

Note: Insert these lines after adding the bounded plane into the output collection.

'----------------------------
' Create the hole boundaries
'----------------------------

Dim parActualWidth As Double


Dim parActualDepth As Double

Call RetrieveCableTrayPortProperties(1, oPartFclt, parActualWidth, parActualDepth)

Dim thickness1 As Double


Dim thickness2 As Double
thickness1 = (parFrameB - parActualWidth) / 2
thickness2 = (parFrameA - parActualDepth) / 2

Dim STPoint As IJDPosition


Set STPoint = New DPosition
121 

STPoint.Set 0, Points(1) - thickness1, Points(2) - thickness2


Dim lines As Collection
Dim oline As IngrGeom3D.Line3d

Set lines = New Collection


Set oline = geomFactory.Lines3d.CreateBy2Points(Nothing, _
0, Points(1) - thickness1, Points(2) - thickness2, _
0, Points(4) + thickness1, Points(5) - thickness2)
lines.Add oline

Set oline = geomFactory.Lines3d.CreateBy2Points(Nothing, _


0, Points(4) + thickness1, Points(5) - thickness2, _
0, Points(7) + thickness1, Points(8) + thickness2)
lines.Add oline

Set oline = geomFactory.Lines3d.CreateBy2Points(Nothing, _


0, Points(7) + thickness1, Points(8) + thickness2, _
0, Points(10) - thickness1, Points(11) + thickness2)
lines.Add oline

Set oline = geomFactory.Lines3d.CreateBy2Points(Nothing, _


0, Points(10) - thickness1, Points(11) + thickness2, _

0, Points(1)
lines.Add - thickness1, Points(2) - thickness2)
oline

Dim oContour As IngrGeom3D.ComplexString3d


Set oContour = PlaceTrCString(STPoint, lines)
ObjBody1.AddHole oContour

' Set the output


iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), ObjBody1
Set ObjBody1 = Nothing

3.  Use the Set statement to clear the references from all object variables.

Set oline = Nothing

Dim iCount=As
For iCount Integer
1 To lines.Count
lines.Remove 1
Next iCount
Set lines = Nothing
Set oContour = Nothing
Set STPoint = Nothing

4.  Add lines to create the right plate using the PlaceBox() routine.

'--- Right plate1


' ^
' | |----| HD
' +y | -HW | |

' <------|-------->|____|-HD
' 0.001 0.01
'
122 

Dim HD As Double
Dim HW As Double
HD = parActualDepth / 2
HW = parActualWidth / 2

Dim pPos1 As IJDPosition


Dim pPos2 As IJDPosition
Set pPos1 = New DPosition
Set pPos2 = New DPosition
Dim ObjBody2 as object

pPos1.Set -0.1, -HW - 0.01, -HD


pPos2.Set 0, -HW - 0.001, HD
Set ObjBody2 = PlaceBox(m_OutputColl, pPos1, pPos2)
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), ObjBody2

5.  Add lines to create the left plate using the PlaceBox() routine.

'--- Left plate2


' ^
'HD |----| |
' | | HW +y | -y
'-HD|____| <-------------->
' 0.01 0.001 

pPos1.Set -0.1, HW + 0.01, -HD


pPos2.Set 0, HW + 0.001, HD
Set ObjBody2 = PlaceBox(m_OutputColl, pPos1, pPos2)
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), ObjBody2 

6.  Use the Set statement to clear the references from all object variables.

Set pPos1 = Nothing


Set pPos2 = Nothing

Set
Set geomFactory = Nothing
ObjBody2 = Nothing

Note:
If you did not undo the placement of the symbol in the previous lab, then you must update
the symbol definition
definit ion cached in the model. To notify SP3D that your symbol
symbol has changed,
you must increase the major version number of the dll.

7.  Go to Project->Properties to open the Project Properties Dialog box.


8.  Go to the Make Tab and increase the major version number. Compile the Visual Basic
project and save the dll in c:\train\SP3DFrameBox.
9.  Save the Visual Basic SP3DFrameBox project.
10. Open the Cabletray2.xls
11. Add the letter M on the Part Class Definition and on the Part.
12. Load the information into the Catalog using the Modify Mode. Once the bulkload process is
complete, review the log file. Next, synchronize the model with the catalog databases.
123 

13. Go to the Electrical Task and review the Frame Box connector.  
124 

Lab 20: Electrical Junction Box Symbol


(Optional)
Objective
After completing this lab, you will be able to:

•   Create a Junction Box using the SmartPlant 3D Part Definition Visual Basic Wizard

Skip the following lines if the symbol wizard is installed on your machine.

1.  Go to [Install Directory]\Programming\Tools\SymbolWizard


2.  Install SP3D Visual Basic Symbol Wizard in device c:\Program Files\ SP3D Symbol Wizard
3.  Create the following directory:

c:\train\ SP3DJunctionBox

4.  Run Microsoft Visual Basic 6.0. Close the Microsoft New Project dialog box.
125 

5.  Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

6.  Select Next button to skip the Introduction page. The Next step is to create the
SP3DJunctionBox symbol definition template using SP3D part Definition Visual Basic
Symbol Wizard.

7.  In this page you define the Visual Basic project name. Key in the following information:

Project Name: SP3DJunctionBox


Author: Student
Company: Intergraph
Intergraph Module location: c:\Train\IngrModules
Save the Visual Basic project as: c:\Train\ SP3DJunctionBox
126  

8.  Select Next button to go the next page. This page is to define any input properties that are
defined in the part class that are constant for all occurrences. We are going to define two
attributes for our SP3DJunctionBox. Key in the following data:

9.  Select Next button to go the next page. Skip this page because our conduit part does not have
occurrence attributes.
127  

10. Select Next button to go the next page. This page identifies all the outputs of the conduit part.
We are going to define one output and two ports for our SP3DJunctionBox. The output is in
the simple Physical aspect.
128 

11. Hit Next button and Finish button to create the SP3DFrameBox project template. The Visual
Basic project consists of the following modules:

12. Open the CSP3DJunctionBox Class module. This Class contains several routines.


13. Go to the Class_Initialize() routine in the input section. Review the inputs and add two
outputs definition for the conduit ports as shown below.

Private Sub Class_Initialize()

Const METHOD
On Error = "Class_Initialize:"
GoTo Errx

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "SP3DJunctionBox"
m_oSymbolHelper.ClassName = "CSP3DJunctionBox"

' Inputs
m_oSymbolHelper.NumInputs = 2
m_oSymbolHelper.AddInputDef 1, "FacetoFace", "FacetoFace", 4
m_oSymbolHelper.AddInputDef 2, "UnionDiameter", "UnionDiameter", 4

' Outputs
m_oSymbolHelper.NumOutputs = 3
m_oSymbolHelper.AddOutputDef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputDef 2, "port1", "port1", 1
m_oSymbolHelper.AddOutputDef 3, "port2", "port2", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspectDef 1, "SimplePhysical", "SimplePhysical", 1

Exit Sub
Errx:
Err.Raise Err.Number, Err.Source & " " & METHOD, Err.Description, _
Err.HelpFile, Err.HelpContext
End Sub

14. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
15. Go to the Insert your code snippet for output 1 (Body1) section. The following lines will use
the PlaceBox() routine to create a Box for the Junction box. The PlaceBox routine is located
at basGeom3d module. This function takes the two opposite corners of the box as input
parameters.

129 

Dim pPos1 As IJDPosition


Dim pPos2 As IJDPosition
Set pPos1 = New DPosition
Set pPos2 = New DPosition

pPos1.Set -parFacetoFace / 2, -parUnionDiameter / 2, -parUnionDiameter / 2


pPos2.Set parFacetoFace / 2, parUnionDiameter / 2, parUnionDiameter / 2

Set ObjBody1 = PlaceBox(m_OutputColl, pPos1, pPos2)

iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), ObjBody1

16. The following code snippet will use the CreateConduitNozzle() method to create the conduit
ports. The CreateConduitNozzle() routine is located
located in the Geometry3d
Geometry3d module.

' Place Nozzle 1

Dim pipeDiam As Double


Dim flangeThick As Double

Dim flangeDiam
Dim sptOffset AsAs
Double
Double
Dim depth As Double
Dim ConduitOD As Double

RetrieveParameters 1, oPartFclt, m_OutputColl, ConduitOD, flangeThick, flangeDiam, sptOffset, depth

Dim oPlacePoint As AutoMath.DPosition


Dim oDir As AutoMath.DVector
Dim objNozzle As GSCADNozzleEntities
GSCADNozzleEntities.IJConduitPortOcc
.IJConduitPortOcc
Dim faceToFace As Double

Set oPlacePoint = New AutoMath.DPosition


Set oDir = New AutoMath.DVector
faceToFace = arrayOfInputs(2)
oPlacePoint.Set -faceToFace / 2 - sptOffset + depth, 0, 0
oDir.Set -1, 0, 0
Set oPartFclt = arrayOfInputs(1)
Set objNozzle = CreateConduitNozzle(oPlacePoint, oDir, m_OutputColl, oPartFclt, 1)
' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), objNozzle
Set objNozzle = Nothing

' Place Nozzle 2


RetrieveParameters 2, oPartFclt, m_OutputColl, ConduitOD, flangeThick, flangeDiam, sptOffset, depth
oPlacePoint.Set faceToFace / 2 + sptOffset - depth, 0, 0
oDir.Set 1, 0, 0
Set objNozzle = CreateConduitNozzle(oPlacePoint, oDir, m_OutputColl, oPartFclt, 2)
' Set the output
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), objNozzle
17. Use the Set statement to clear the references from all object variables.

130 

Set objNozzle = Nothing


Set oPlacePoint = Nothing
Set oDir = Nothing
Set ObjBody1 =Nothing
Set pPos1 = Nothing
Set pPos2 = Nothing

Compile the Visual Basic project and save the dll in c:\train\ SP3DJunctionBox

18. Save the Visual Basic SP3DJunctionBox project.


19. Open the Conduit.xls workbook. Create the ConduitJunctionBox Part Class ass follows:

Note: You can make a copy of the ConduitCPL sheet to create the ConduitJunctionBox
sheet.

Review and edit the class definition row:

Notes:
• 

• 
UserClassName
Creating the bmpand
fileOccClassName
is optional. Youare optional
can attributes.
use Microsoft Paint to create the file and
your \\machine\sym
save it under your \\machine\symbols\Sym
bols\SymbolIcons
bolIcons..

Review and edit the part definition row:


Review and edit the system attributes:
131 

Review and edit the port information:

Review and edit the dimensional attributes

Conduit Filter Records

21. Go to the ConduitFilter worksheet.


22. Add a record for the junction box as shown below:

132 

ConduitCommodityMatlControlData
ConduitCommodityMatlControlData Data

23. Go to the ConduitCommodityMatlControlData worksheet.


24. Add a record for the junction box as shown below:
133 

ShortCodeHierarchyRule Data
25. Create a sheet called ShortCodeHierarchyRule and add the appropriate records as shown
below:

26. Save the workbook in c:\train\ SP3DJunctionBox


27. Open the AllCodeList.xls. Go to the PipingCommodityType worksheet.
28. Add a record for the new Conduit Commodity Type as shown below:

29. Save the workbook in c:\train\ SP3DJunctionBox


30. Select Start => Programs => Intergraph SmartPlant3D => Database Tools => Bulkload
Reference Data.
31. Select the “Add” option under “Excel Files” and select conduit.xls
32. Select the “Add” option under “Excel Codelist Files” and select Allcodelist.xls
33. Select the training catalog.
34. Load the records into the database using the “Append” mode.
35. Once the bulkload process is completed, review the log file. Next, run the View Generator
utility on the model to re-create the views in the model database. Finally, Re-generate the
report databases. 
36. Go to the Electrical Task and place the Junction Box.  
134 

 
135 

Lab 21: Shape Symbol (Optional)


Objectives

After completing this lab, you will be able to:


   Create a shape symbol using the SmartPlant 3D Part Definition Wizard
   Learn to use the Symbol Helper service to create the symbol definition
   Learn to use the Geometry Helper service to create geometric entities for the symbol’s
output

4.  Create the following directory:

c:\train\HollowCy

5.  Run Microsoft Visual Basic 6.0


6.  Close the Microsoft New Project dialog box.

12. Go to the Add-Ins Option and Select SmartPlant 3D Part Definition Wizard.

13. The Next step is to create the shape symbol definition template using SP3D Part Definition
Symbol Wizard.

136  

14. In this page you define the Visual Basic project name. Key in the following information:

Project Name: HollowCy 
Author: Student  
Company: Intergr aph 
 Intergraph
Intergraph Module location: c:\Train\IngrModules  
Save the Visual Basic project as: c:\Train\ HollowCy 
Disable the create bulkload spreadsheet.
137  

15. Select Next button to go the next page. This page is to define any properties that are constant
for all occurrences of the operator part. Select Next button to go the next page.

16. This page defines all occurrence properties of the shape part. Key in the following data:  
138 

17. Select Next button to go the next page. This page identifies all the outputs of the shape part.
We are going to define one output: Body1  

18. Press Next button and Finish button to create the shape project template. The Visual Basic
project consists of the following modules:
139 

19. Open the CHollowCy Class module. This Class contains several routines.


20. Go to the Class_Initialize() routine. Review the inputs and outputs section. Add additional
outputs as shown below:

Private Sub Class_Initialize()


Const METHOD = "Class_Initialize:"
On Error GoTo Errx

Set m_oSymbolHelper = New SymbolServices


m_oSymbolHelper.ProjectName = "HollowCy"
m_oSymbolHelper.ClassName = "CHollowCy"

' Inputs
m_oSymbolHelper.NumInputs
m_oSymbolHelper.NumInputs = 3
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 1, "A", "A", 2
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 2, "B", "B", 1
m_oSymbolHelper.AddInputDe
m_oSymbolHelper.AddInputDeff 3, "C", "C", 0.
0.44

' Outputs
m_oSymbolHelper.NumOutputs = 8
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 1, "Body1", "Body1", 1
m_oSymbolHelper.AddOutputDef
m_oSymbolHelper.AddOutputDef 2, "Body2", "Body2", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 3, "Body3", "Body3", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 4, "Body4", "Body4", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 5, "Body5", "Body5", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 6, "Body6", "Body6", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 7, "Body7", "Body7", 1
m_oSymbolHelper.AddOutputD
m_oSymbolHelper.AddOutputDef
ef 8, "Body8", "Body8", 1

' Aspects
m_oSymbolHelper.NumAspects = 1
m_oSymbolHelper.AddAspec
m_oSymbolHelper.AddAspectDef
tDef 1, "SimplePhysi
"SimplePhysical",
cal", "SimplePhysica
"SimplePhysical",
l", 1

 Exit Sub
 Errx:

 Err.Raise Err.Number,
 Err.HelpFile,
 Err.HelpFi Err.Source
Err.Source
le, Err.HelpContext & " " & METHOD, Er
Err.HelpContext Err.Description,
r.Description, _
 End Sub

13. Go to CSimplePhysical Class module and add your code snippet to create the outputs:
14. Go to the “ Insert your
your code for output (OPBody)” section. The following lines will use the
output 1 (OPBody)
Geometry Factory methods to create the graphic entities for the hollow cylinder.

' Inputs
Set oPartFclt = arrayOfInputs(1)
 parA = arrayOfInputs(2)
arrayOfInputs(2)
 parB = arrayOfInputs(3)
arrayOfInputs(3)
 parC = arrayOfInputs(4)
arrayOfInputs(4)
m_oGeomHelper.OutputCollection = m_OutputColl

iOutput = 0
 Dim oErrors As IJEditErr
IJEditErrors
ors

140 

Set oErrors = New JServerErrors


 If parA <=
<= 0 Or parB <=
<= 0 Or par
parC
C <= 0 T
Then
hen
oErrors.Add E_FAIL,
E_FAIL, "CSP3DHollowCy", "Shape Dimensions should be greater tthan
han zero",
"ZeroOrNegative"
GoTo Errx:
 End If

 Dim oGeomFactory
oGeomFactory As New GeometryFactory
 Dim oCircle(2)
oCircle(2) As Circle3d
Circle3d
 Dim oProjection
oProjection As P
Projection3d
rojection3d
 Dim oDir
oDir As IJDVector
IJDVector
Set oDir = New DVector
oDir.Set 1, 0, 0

'create the cylinders

Set oCircle(1) = oGeomFactory.C


oGeomFactory.Circles3d.CreateB
ircles3d.CreateByCenterNorm
yCenterNormalRadius(m_OutputC
alRadius(m_OutputColl.ResourceM
oll.ResourceManager,
anager,
0, 0, 0, 1, 0, 0, parA / 2)
Set oCircle(2) = oGeomFactory.C
oGeomFactory.Circles3d.CreateB
ircles3d.CreateByCenterNorm
yCenterNormalRadius(m_OutputC
alRadius(m_OutputColl.ResourceM
oll.ResourceManager,
anager,
0, 0, 0, 1, 0, 0, parA / 2 - parC)

iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), oCircle(1)
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), oCircle(2)

Set oProjection = PlaceProjection(m_OutputColl, oCircle(1), oDir, parB, False)

iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oProjection

Set oProjection = PlaceProjection(m_OutputColl, oCircle(2), oDir, parB, False)

iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oProjection

'create the left face

 Dim oPlane
oPlane As IngrGeom3D
IngrGeom3D.Plane3d
.Plane3d
Set oPlane = oGeomFactory.Planes3d.Cr
oGeomFactory.Planes3d.CreateByPointNor
eateByPointNormal(m_OutputCo
mal(m_OutputColl.ResourceManager
ll.ResourceManager,, _
0, 0, 0, 1, 0, 0)

 Dim oElements
oElements As IJElemen
IJElements
ts
 Dim objCStr
objCStr As IngrGeom3D
IngrGeom3D.ComplexString3
.ComplexString3d
d
 Dim i As Integer

Set oElements = New JObjectCollection

For i = 1 To 2
oElements.Add oCircle(i)
Set objCStr = oGeomFactory.ComplexStrings3d
oGeomFactory.ComplexStrings3d.CreateByCur
.CreateByCurves(Nothing,
ves(Nothing, oElements)
oPlane.AddBoundary
oPlane.AddBound ary objCStr
oElements.Clear
objCStr.RemoveCurve
objCStr.Remov eCurve True
 Next i
iOutput = iOutput + 1

141 

m_OutputColl.AddOutput
m_OutputColl.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oPlane

'create the right face

Set oCircle(1) = oGeomFactory.C


oGeomFactory.Circles3d.CreateB
ircles3d.CreateByCenterNorm
yCenterNormalRadius(m_OutputC
alRadius(m_OutputColl.ResourceM
oll.ResourceManager,
anager,
 parB, 0, 0, 1, 0,
0, 0, parA / 2)
Set oCircle(2) = oGeomFactory.C
oGeomFactory.Circles3d.CreateB
ircles3d.CreateByCenterNorm
yCenterNormalRadius(m_OutputC
alRadius(m_OutputColl.ResourceM
oll.ResourceManager,
anager,
 parB, 0, 0, 1, 0,
0, 0, parA / 2 - parC)

iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), oCircle(1)
iOutput = iOutput + 1
m_OutputColl.AddOutput arrayOfOutputs(iOutput), oCircle(2)

Set oPlane = oGeomFactor


oGeomFactory.Planes3d.Cr
y.Planes3d.CreateByPointNor
eateByPointNormal(m_OutputCo
mal(m_OutputColl.ResourceManager
ll.ResourceManager,, parB, 0, 0,
1, 0, 0)

For i = 1 To 2
oElements.Add oCircle(i)
Set objCStr = oGeomFactory.ComplexStrings3d
oGeomFactory.ComplexStrings3d.CreateByCur
.CreateByCurves(Nothing,
ves(Nothing, oElements)
oPlane.AddBoundary
oPlane.AddBound ary objCStr
oElements.Clear
objCStr.RemoveCurve
objCStr.Remov eCurve True
 Next i
iOutput = iOutput + 1
m_OutputColl.AddOutput
m_OutputCo ll.AddOutput arrayOfOu
arrayOfOutputs(iOutput)
tputs(iOutput),, oPlane

Set oProjection = Nothing


Set oCircle(1) = Nothing
Set oCircle(2) = Nothing
Set oGeomFactory = Nothing
Set oPlane = Nothing
Set oDir = Nothing
Set oElements = Nothing
Set objCStr = Nothing

15. Compile the Visual Basic project and save the dll in the c:\Train\  HollowCy 
16. Save the Visual Basic HollowCy project.
17. Open the Shapes.xls located in [Install Product]\CatalogData\BulkLoad\DataFiles
18. Go the ClassNodeType sheet and add the following row:

19. Go the R-Hierarchy sheet and add the following row:


142 

20. Go the R-ClassNodeDescribes sheet and add the following row:

21. Create a New Part Class called HollowCy with the following data:

Note: Make a copy of the RtCircularCylinder sheet to create the HollowCy sheet.
Review and edit the class definition row:

Notes:
•  UserClassName and OccClassName are optional attributes.

Review and Edit the part definition row:

22. Create a new interface called IJUAHollowCy. Go to the Custom Interface sheet and add the
following rows:

23. Use Microsoft Paint and create a HollowCy.bmp and HollowCyicon.bmp. Place these files
on your symbol share (  \\SERVER\Sym
\\SERVER\Symbols\Sym
bols\SymbolIcons
bolIcons   and
 \\Server\Symb
 \\Server\Symbols\ShapeTy
ols\ShapeTypes pes))

24. Go to the symbol share \\machi


share \\machine\\Symb
ne\\Symbols\ShapeTy
ols\ShapeTypes
pes and open Shape
ShapeTypes.xml
Types.xml  
25. Add the following lines in ShapeTypes.xml 
ShapeTypes.xml 

<ShapeType name="HollowCy" picture= "HollowCyicon.bmp">


</ShapeType>
<ShapeType name="PrismaticShape" picture= "PrismaticShape.bmp">
</ShapeType>
143 

26. Load the information into the Catalog using the Append mode. Once the bulkload process is
completed, run the View Generator utility on the model to re-create the views in the model
database. Finally, Re-generate the report databases.
27. Open a new session file and go to the Equipment Task. Select the place shape command and
place your shape.
144 

Appendix

Symbol Helper Reference

The Symbol Helper Reference provides documentation for symbol math functions and
properties.

IJSymbolHelper
This interface provides methods to help inin creating the definition of a Visual Basic sym
symbol.
bol. It
provides the implementation of the IJDUserSymbolServices interface as well as provides support
for declaring the inputs and outputs of the symbol. Call this interface when you want to:
 
• Instantiate a symbol definition in a datastore.
 
• Update an existing symbol definition.
 
• Compute the symbol using a function.
 
• Edit the symbol occurrence.

Methods

AddInputDef(Count As Integer, Name As String, Description As String, DefaultValue As Double)


Description:
Descripti on: Adds the input definition to the collection of inputs defined for the symbol
Parameters:
[in] count Index for the input parameter
[in] Name Name of the input parameter
[in] Description Descripti
Description
on of the input parameter
[in] DefaultValue Default value for the input parameter

AddOutputDef(Count As Integer, Name As String, Description As String, aspect as integer)


Description:
Descripti on: Adds the output definition to the collection of outputs defined for the symbol
Parameters:
[in] count Index for the output parameter
[in] Name Name of the output parameter
[in] Description Descripti
Description
on of the output parameter
[in] aspect Aspect number for the output
145 

AddAspectDef (Count As Integer, Name As String, Description As String, aspect as integer)


Description:
Descripti on: Adds the aspect definition to the symbol
Parameters:
[in] count Index for the aspect
[in] Name Name of the aspect
[in] Description Descript
Description
ion of the aspect
[in] aspect Aspect number for the output

InstanciateDefinition (ByVal CodeBase As String, ByVal defParameters As Variant, ByVal ActiveConnection As


Object)
Description:
Descripti on: This method will create a symbol definition entity and initialize it. It will also set the progid and
the code base values on the definition. It will take the same set of parameters as the method on
the interface ‘IJDUserSymbolServices’.
Parameters:
[in] CodeBase
CodeBase Specifies the URL (or U UNC)
NC) of the .cab file that can pprovides
rovides the dll associated to the symbol
symbol
definition object (ActiveX control packaging).
[in] Definition
Definitio n parameters.
defParameters
[in] Resource manager to which the symbol definition will be connected
ActiveConnection

InitializeSymbolDefinition(ByRef pSymbolDefinition As IJDSymbolDefinition)


Description:
Descripti on: This method will define the inputs for the symbol definition, define the required number of
representations and add the outputs defined to the correct representation. The input collection as
well as the output collection can be made a ‘VARIABLECOLLECTION’ if required.
Parameters:
pSymbolDefinitionSymbol definition passed by reference that will be initialized in this method.

InvokeRepresentat ion(ByVal sblOcc As Object, ByVal repName As String, ByVal outputcoll As Object, ByRef
InvokeRepresentation(ByVal
arrayOfInputs())
Description:
Descripti on: This method will create the object that contains the implementat
implementation
ion details for the required
representation. The wizard follows a specific convention like so:
ProjectName.<RepresentationName>.
So the helper function can obtain the progid given this rule and create the object and then call the
method ‘Run’ on the IDispatch interface of this object. This method will also take all the

parameters in addition to an array of strings that contain the names of outputs belonging to that
representation.
Parameters:
[in] sblOcc Symbol occurrence that calls the method.
[in] repName Name of the representa
representation
tion requested on the symbol.
[in] outputcoll Collection object to which the generated outputs will be attach
attached.
ed.
[in] arrayOfInputsA safearray of inputs defined as VARIANT.
146  

Properties

NumInputs as Integer
Description:
Descripti on: Number of inputs for the symbol
Modifiability: Read/write

NumOutputson: as Integer
Description:
Descripti Number of outputs for the symbol.
Modifiability: Read/write

NumAspects as Integer
Description:
Descripti on: Number of aspects defined for the symbol
Modifiability: Read/write

ProjectName as String
Description:
Descripti on: Project Name for the symbol
Modifiability: Read/write

ClassName as String
Description:
Descripti on: Class name for the symbol
Modifiability: Read/write
147  

IJSymbolGeometryHelper

This interface provides methods to help in creating simple geometric primitives like Cylinder
(given center, radius and length), Cone (given the 4 points), Sphere (center and radius), Torus
(center, major radius, minor radius). The other geometric primitives are not yet implemented.

Methods

AddGeometry(Output As String, Aspect As Long, Geometry As Object)


Description:
Descripti on: Adds the Geometry Object to the Output Collection.
Parameters:
[in] Output Required Output as string
[in] Aspect Required long value
[in] Geometry Required Object Geometry

CreateChildPar tOcc(Output As String, ChildPart As Object, Position As IJDPosition,


CreateChildPartOcc(Output IJDPosition, VecX As IJDVector,
VecY As IJDVector, VecZ As IJDVector) As Object
Description:

Parameters:
[in] Output Required Output as string
[in] ChildPart Required Object ChildPart
[in] Position Required IJDPosition Position
[in] VecX Required IJDVector VecX
[in] VecY Required IJDVector VecY
[in] VecZ Required IJDVector VecZ

CreateCone( Output As String, PosStart As IJDPosition, PosEnd As IJDPosition, diameterStart As Double,


diameterEnd As Double, Optional Offset As Double = 0#) As Object
Description:
Descripti on: Creates the Cone Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] PosStart Required IJDPosition Start
[in] PosEnd Required IJDPosition End
[in] diameterStart Required double value
[in] diameterEnd Required do
double
uble value
[in, Optional double value – is an optional parameter
defaultvalue(0)]
Offset

CreateCylinder(( Output As S
CreateCylinder String,
tring, PosStart As IJDPosition, PosEnd As IJDPosition, Diameter As Double) As
Object
Description:
Descripti on: Creates the Cylinder Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] PosStart Required IJDPosition Start
[in] PosEnd Required IJDPosition End
[in] Diameter Required double value – diameter of the Cylinder

148 

CreateMit eredTorus( Output As S


CreateMiteredTorus( String,
tring, Origin As IJDPo
IJDPosition,
sition, NormalAxis As IJDVector, MajorAxis As
IJDVector, Radius As Double, Angle As Double, Diameter As Double, NumberOfCuts As Long) As Ob Object
ject
Description:
Descripti on: Creates the CreateMit
CreateMiteredTorus
eredTorus Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Origin Required IJDPosition Origin
[in] NormalAxis Required IJDVector NormalAxis
[in] MajorAxis Required IJDVector MajorAxis
[in] Radius Required double value
[in] Angle Required double value
[in] Diameter Required double value
[in] Required long value
NumberOfCuts

CreatePolygon( Output As String, NumberOfSides As Long, SideLength As Double, Depth As Double, Ob


Object
ject
As Object)
Description:
Descripti on: Creates the CreatePolygon Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Required long value
NumberOfSides
[in] SideLength Required double value
[in] Depth Required double value

CreatePrism(
CreatePri sm( Output As String, Width As Double, Depth As Double, Length As Double, Width2 As Do
Double,
uble,
Depth2 As Double, Optional Offset As Double = 0#) As Object
Description:
Descripti on: Creates the CreatePris
CreatePrismm Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Width Required double value
[in] Depth Required double value
[in] Length Required double value
[in] Width2 Required double value
[in] Depth2, Required double value
[in, defaultvalue(0)] Optional double value
Offset

CreatePr ojectedRectangle( Output As String, PosStart As IJDPosition, PosEnd As IJDPosition, Axis As


CreateProjectedRectangle(
IJDVector, Width As DoDouble,
uble, Depth As Double) As Obj
Object
ect
Description:
Descripti on: Creates the CreateProjectedRect
CreateProjectedRectangle
angle Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] PosStart Required IJDPosition Start
[in] PosEnd Required IJDPosition End
[in] Axis Required IJDVector Axis

149 

[in] Width Required double value


[in] Depth Required double value

CreateProjectedShape(
CreatePr ojectedShape( Output As String, Length As Double, Curve As Object) As Object
Description:
Descripti on: Creates the CreateProjectedSh
CreateProjectedShape
ape Object and adds it to the output collection

Parameters:
[in] Output Required Output as string
[in] Length Required double value
[in] Curve Required object curve

CreateProjectedShapeByPoints(
CreatePr ojectedShapeByPoints( Output As String, NumberOfPoints As Long, Length As Double, Points As
IJElements) As Object
Description:
Descripti on: Creates the CreateProjectedSh
CreateProjectedShapeByPoints
apeByPoints Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Required long value
NumberOfPoints
[in] Length Required double value
[in] Points Required point objects as IJElements collection

CreatePr ojectedTriangle( Output As String, PosStart As IJDPosition, PosEnd As IJDPosition, Axis As


CreateProjectedTriangle(
IJDVector, Width As DoDouble,
uble, Depth As Double) As Obj
Object
ect
Description:
Descripti on: Creates the CreateProjectedT
CreateProjectedTriangle
riangle Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] PosStart Required IJDPosition start
[in] PosEnd Required IJDPostion end
[in] Axis Required IJDVector Axis
[in] Width Required double value
[in] Depth Required double value

CreateRectan gularTorus( Output As String, Radius As Double, SweepAngle As Double, Width As Double,
CreateRectangularTorus(
Depth As Double) As Object
Description:
Descripti on: Creates the CreateRectan
CreateRectangularTorus
gularTorus Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Radius Required double value
[in] SweepAngle
SweepAngle Required do
double
uble value
[in] Width Required double value
[in] Depth Required double value

CreateSemiEllipsoid(
CreateSemi Ellipsoid( Output As String, Origin As IJDPosition, NormalAxis As IJDVector, MajorAxis As

IJDVector, AxisDiameter As Double, MinorAxisRadius As Long) As Object


Description:
Descripti on: Creates the CreateSemiEl
CreateSemiEllipsoid
lipsoid Object and adds it to the output collection
Parameters:

150 

[in] Output Required Output as string


[in] Origin Required IJDPosition Origin
[in] NormalAxis Required IJDVector NormalAxis
[in] MajorAxis Required IJDVector MajorAxis
[in] AxisDiameter Required double value

[in]
MinorAxisRadius Required long value

CreateSphere(
CreateSph ere( Output As String,
String, Origin As IJDPosition, Radius As Double) As Object
Description:
Descripti on: Creates the CreateSpher
CreateSpheree Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Origin Required IJDPosition Origin
[in] Radius Required double value

CreateTor us( Output As St


CreateTorus( String,
ring, Origin As IJDPo
IJDPosition,
sition, NormalAxis As IJDVector, MajorAxis As IJDVector,
Radius As Double,
Double, Angle As Double, Diameter As DoDouble)
uble) As Object
Description:
Descripti on: Creates the CreateTorus Object and adds it to the output collection

Parameters:
[in] Output Required Output as string
[in] Origin Required IJDPosition Origin
[in] NormalAxis Required IJDVector NormalAxis
[in] MajorAxis Required IJDVector MajorAxis
[in] Radius Required double value
[in] Angle Required double value
[in] Diameter Required double value

CreateTr ansitionalElement(( Output As String, Width As Double, Depth As Double, Length As Double,
CreateTransitionalElement
Radius As Double,
Double, Offset As Double)
Double) As Object
Description:
Descripti on: Creates the CreateTran
CreateTransitionalElement
sitionalElement Object and adds it to the output collection
Parameters:
[in] Output Required Output as string
[in] Width Required double value
[in] Depth Required double value
[in] Length Required double value
[in] Radius Required double value
[in] Offset Required double value

Properties

AutoTransformUpdate() As Boolean
Description:
Descripti on: Adding or getting the AutoTransformUpdate boolean value
Modifiability: Read/write

OutputCollection() As IJDOutputCollection
Description:
Descripti on: Adding or getting created output objects in the output collection

151 

Modifiability: Read/write

Transform() As IJDT4x4
Description:
Descripti on: Adding or getting the transformati
transformation
on matrix IJDT4x4
Modifiability: Read/write
152 

Geometry Factory Programming Reference


The Geometry Factory Programming Reference provides documentation of Geom3d.dll, which
includes the objects, methods, and properties for the geometry factory.

Description

The GeometryFactory object is the class factory for the creation of geometry entities. The factory
implements properties that return "collection-like" interfaces for each of the geometry types.
These interfaces have creation methods that the application programmer can use to create,
initialize, and optionally specify a persistent database connection for the object.

If the objects are created with a NULL database connection, the object is created as a "transient."
Transient objects can be displayed and added to the highlight system, but they do not participate
in transactions or relationships.

IJGeometryFactory

Use this interface when you want to create transient or persistent geometry objects

Properties

Points3d ( ) as IPoints3d
Description:
Descripti on: Returns a pointer (pVal) to the IPoints3d interface of the first element in the collection.
Modifiability: Read Only

Lines3d ( ) as ILines3d
Description:
Descripti on: Returns a pointer (pVal) to the ILines3d interface of the first element in the collection.
Modifiability: Read Only

Arcs3d ( ) as IArcs3d
Description:
Descripti on: Returns a pointer (pVal) to the IArcs3d interface of the first element in the collection.
Modifiability: Read Only

Circles3d ( ) as ICircles3d
Description:
Descripti on: Returns a pointer (pVal) to the ICircles3d interface of the first element in the collection.
Modifiability: Read Only

Ellipses3d ( ) as IEllipses3d
Description:
Descripti on: Returns a pointer (pVal) to the IEllipses3d interface of the first element in the collection.
Modifiability: Read Only

EllipticalArcs3d ( ) as IEllipticalArcs3d
Description:
Descripti on: Returns a pointer (pVal) to the IElliptical
IEllipticalArcs3d
Arcs3d interface of the first element in the
collection.
Modifiability: Read Only
153 

LineStrings3d ( ) as ILineStrings3d
Description:
Descripti on: Returns a pointer (pVal) to the ILineStrings3d interface of the first element in the collection.
Modifiability: Read Only

BSplineCurves3d ( ) as IBSplineCurves3d

Description:
Descripti on: Returns a pointer (pVal) to the IBSplineCurves3d interface of the first element in the
collection.
Modifiability: Read Only

ComplexStrings3d ( ) as IComplexStrings3d
Description:
Descripti on: Returns a pointer (pVal) to the IComplexStrings3d interface of the first element in the
collection.
Modifiability: Read Only

Planes3d ( ) as IPlanes3d
Description:
Descripti on: Returns a pointer (pVal) to the IPlanes3d interface of the first element in the collection.
Modifiability: Read Only

Cones3d ( ) as ICones3d
Description:
Descripti on: Returns a pointer (pVal) to the ICones3d interface of the first element in the collection.
Modifiability: Read Only

Projections3d ( ) as IProjections3d
Description:
Descripti on: Returns a pointer (pVal) to the IProjections3d interface of the first element in the collection.
Modifiability: Read Only

Revolutions3d ( ) as IRevolutions3d
Description:
Descripti on: Returns a pointer (pVal) to the IRevolutions3d interface of the first element in the collection.
Modifiability: Read Only

RuledSurfaces3d ( ) as IRuledSurfaces3d
Description:
Descripti on: Returns a pointer (pVal) to the IRuledSurfaces3d interface of the first element in the
collection.
Modifiability: Read Only

Spheres3d ( ) as ISpheres3d
Description:
Descripti on: Returns a pointer (pVal) to the ISpheres3d interface of the first element in the collection.
Modifiability: Read Only

Tori3d ( ) as ITori3d
Description:
Descripti on: Returns a pointer (pVal) to the ITori3d interface of the first element in the collection.
Modifiability: Read Only

BSplineSurfaces3d ( ) as IBSplineSurfaces3d
Description:
Descripti on: Returns a pointer (pVal) to the IBSplineSurfaces3d interface of the first element in the
collection.
Modifiability: Read Only
154 

Methods:

CreateBSplineSurfaceByParametersWCaps
CreateBSplineSurfaceByParametersWCaps Method

Description
The CreateBSplineSurfaceByParametersWCaps method creates and returns a BSplineSurface3d object based on a
desired order, a set of poles, and optional caps. Weights and knots are optional and are set to NULL, or an empty
array. The output will be the surface, then the caps.
If the order is equal to the number of poles, the curve evolves into the control polygon of a Bezier curve.
B-spline weights can be considered a gravitational type force with the magnitude of the weight equal to the pulling
force. The weights are always
always normalized. If no weights are present, the cucurve
rve is considered to be non-rational and
may be NULL. Non-rational curves have weights with a value value of 1.
The B-spline knots define the parameterization of the curve, and they may be periodic. Knots, also known as knot
vectors, must be monotonic and strictly
strictly increasin
increasing.
g. Monotonic refers to the successive terms as non-decreas
non-decreasing
ing or
non-increasing.
The Order property determines the relative accuracy of the poles with regard to the points that are entered to create
the curve. The order returned evaluat
evaluateses as a polynomial
polynomial degree plus one. For example, an order
order of 4 defines cubic.
Since it is more efficient to use even-order b-spline curves, the number of poles (and knots) are maximized by
increasing the order to the next even number.

Syntax
object.CreateBSplineSurfaceByParametersWCaps (pConnection, uNumPoles, vNumPoles, Poles, Weights, uOrder,
vOrder, uKnots, vKnots, uPeriodic, vPeriodic, ReverseNor, Solid, WCaps, numCaps) 
Parameter Data Type D
Description
escription

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

uNumPoles long Required. This argument is the number of poles in the u-direction. The type is long.

vNumPoles long Required. This argument is the number of poles in the v-direction. The type is long.

Poles double Required. This argument is a SAFEARRAY of poles. The type is double.

Weights double Required. This argument is a SAFEARRAY of weights. The type is double.

uOrder long Required. This argument is the order in the u-direction. The type is long.

vOrder long Required. This argument is the order in the v-direction. The type is long.

uKnots double Required. This argument is a SAFEARRAY of knots. The type is double.

vKnots double Required. This argument is a SAFEARRAY of Knots. The type is double.

uPeriodic Boolean Required. This argument is a Boolean flag that specifies whether the surface is periodic in u.

vPeriodic Boolean Required. This argument is a Boolean flag that specifies whether or not the surface is periodic in v.

ReverseNor
Reverse Nor Boolean Required. This argument specifies the outward normal. It is False when the outward normal is U X V.
It is True when the outward normal is U (curve) cross V (proj vector). The type is Boolean.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input point; 3
- Just toggle the outward normal (no checks).

WCaps Boolean Required. Thiscaps;


does not have argument
if the specifies whether
value is True, the or not the
surface hasobject
caps.has caps. If the value is False, the surface
numCaps Int Required. This argument is the number of caps. The type is integer.

155 

CreateBy2Points Method

Description
The CreateBy2Points method creates and returns a Line3d object defined by two points.

Syntax
object.CreateBy2Points (pConnection, StartX, StartY, StartZ, EndX, EndY, EndZ)  
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

StartX double Required. This argument is the X-coordinate for the starting point. The type is double.

StartY double Required. This argument is the Y-coordinate for the starting point. The type is double.

StartZ double Required. This argument is the Z-coordinate for the starting point. The type is double.

EndX double Required. This argument is the X-coordinate for the ending point. The type is double.

EndY double Required. This argument is the Y-coordinate for the ending point. The type is double.

EndZ double Required. This argument is the Z-coordinate for the ending point. The type is double.

CreateBy3Points Method (IArcs3d)

Description
The CreateBy3Points method creates and returns an Arc3d object given three non-colinear points along the arc.

Syntax
object.CreateBy3Points (pConnection, StartX, StartY, StartZ, AlongX, AlongY, AlongZ, EndX, EndY, EndZ) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

StartX double Required. This argument is the X-coordinate for the starting point on the arc. The type is double.

StartY double Required. This argument is the Y-coordinate for the starting point on the arc. The type is double.
StartZ double Required. This argument is the Z-coordinate for the starting point on the arc. The type is double.

AlongX double Required. This argument is the X-coordinate for the middle point on the arc. The type is double.

AlongY double Required. This argument is the Y-coordinate for the middle point on the arc. The type is double.

AlongZ double Required. This argument is the Z-coordinate for the middle point on the arc. The type is double.

EndX double Required. This argument is the X-coordinate for the ending point on the arc. The type is double.

EndY double Required. This argument is the Y-coordinate for the ending point on the arc. The type is double.

EndZ double Required. This argument is the Z-coordinate for the ending point on the arc. The type is double.
156  

CreateBy3Points Method (ICircles3d)

Description
The CreateBy3Points method creates and returns a pointer (ppObj) to the IJCircle interface of a Circle3d object.
This method uses three inscribed non-colinear points to create the circle.

Syntax
object.CreateBy3Points (pConnection, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3)  
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

X1 double Required. This argument is the first X-coordinate value. The type is double.

Y1 double Required. This argument is the first Y-coordinate value. The type is double.

Z1 double Required. This argument is the first Z-coordinate value. The type is double.

X2 double Required. This argument is the second X-coordinate value. The type is double.

Y2 double Required. This argument is the second Y-coordinate value. The type is double.

Z2 double Required. This argument is the second Z-coordinat


Z-coordinatee value. The type is double.

X3 double Required. This argument is the third X-coordinate value. The type is double.

Y3 double Required. This argument is the third Y-coordinate value. The type is double.

Z3 double Required. This argument is the third Z-coordinate value. The type is double.

CreateBy4Pts Method

Description
The CreateBy4Pts method creates and returns a pointer (ppObj) to the IJCone interface of a full bounded Cone3d.
This method takes as input a base center point, a top center point, a base starting point, and a top starting point.
The axis runs through the top center point and base center point, and the cone follows the right-hand rule about the
axis.
The base ellipse must not be degenerate, so the base center point cannot be the same as the base starting point.
To create a point cone, set the top center point to the top starting point.

Syntax
object.CreateBy4Pts (pConnection, CenterBx, CenterBy, CenterBz, CenterTx, CenterTy, CenterTz, StartBx, StartBy,
StartBz, StartTx, StartTy, StartTz, Solid) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterBx double Required. This argument is the X-coordinate of the base center point. The type is double.

CenterBy double Required. This argument is the Y-coordinate of the base center point. The type is double.

CenterBz double Required. This argument is the Z-coordinate of the base center point. The type is double.

CenterTx double Required. This argument is the X-coordinate of the top center point. The type is double.
CenterTy double Required. This argument is the Y-coordinate of the top center point. The type is double.

157  

CenterTz double Required. This argument is the Z-coordinate of the top center point. The type is double.

StartBx
StartB x double Required. This argument is the X-coordinate of the base starting point. The type is double.

StartBy
StartB y double Required. This argument is the Y-coordinate of the base starting point. The type is double.

StartBzz
StartB double Required. This argument is the Z-coordinate of the base starting point. The type is double.

StartTx double Required. This argument is the X-coordinate of the top starting point. The type is double.

StartTy
StartT y double Required. This argument is the Y-coordinate of the top starting point. The type is double.

StartTzz
StartT double Required. This argument is the Z-coordinate of the top starti
starting
ng point. The type is double.

Solid Boolean Required. This argument is a Boolean flag indicating whether the cone is solid or not.

CreateByAxisMajorMinorRadius
CreateByAxisMajorMinorRadius Method

Description
The CreateByAxisMajorMinor method creates and returns a pointer (ppObj) to the IJTorus interface of a Torus3d
object. This method defines a torus by a point on the axis at the center of the torus, an axis vector, a vector toward
the center of a minor circle (determining the origin of UV space), a major radius, and a minor radius. Set major
radius = -major radius if the center of the torus is on the left-hand side of the axis, indicating the torus is a lemon
shape.

Syntax
object.CreateByAxisMajorMinorRadius (pConnection, AxisCenterX, AxisCenterY, AxisCenterZ, AxisVecX
AxisVecX,,
 AxisVecY, AxisVecZ,
AxisVecZ, Or
OriginDirX,
iginDirX, Or
OriginDirY,
iginDirY, Or
OriginDirZ,
iginDirZ, MajorR
MajorRadius,
adius, MinorRadius, Solid) 
MinorRadius,
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

AxisCenterX
AxisCenter X double Required. This argument is the X-coordinate of the point on the center axis. The type is double.

AxisCenterY
AxisCenter Y double Required. This argument is the Y-coordinate of the point on the center axis. The type is double.

AxisCenterZ
AxisCenter Z double Required. This argument is the Z-coordinate of the point on the center axis. The type is double.

AxisVecX double Required. This argument is the X-coordinate of a point along the axis vector. The type is double.

AxisVecY double Required. This argument is the Y-coordinate of a point along the axis vector. The type is double.

AxisVecZ double Required. This argument is the Z-coordinate of a point along the axis vector. The type is double.

OriginDirX
OriginDir X double Required. This argument is the X-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

OriginDirY
OriginDir Y double Required. This argument is the Y-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

OriginDirZ
OriginDir Z double Required. This argument is the Z-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

MajorRadius double Required. This argument is the length of the major radius. The type is double.

MinorRadius double Required. This argument is the length of the minor radius. The type is double.
Solid Boolean Required. This argument is a Boolean flag indicating whether or not the torus is solid.

158 

CreateByAxisMajorMinorRadiusSw
CreateByAxisMajorMinorRadiusSweep
eep Method

Description
The CreateByAxisMajorMinorRadiusSweep method creates and returns a pointer (ppObj) to the IJTorus interface of
a Torus3d object. This method defines a partial torus by a point on the axis at the center of the torus, an axis vector,
a vector toward the center of the minor circle (determining the origin of UV space), a major radius, a minor radius,
and a sweep angle. Set the major radius = -major radius if the center of the torus is on the left-hand side of the axis,
indicating the torus is a lemon shape.

Syntax
object.CreateByAxisMajorMinorRadiusSweep (pConnection, AxisCenterX, AxisCenterY, AxisCenterZ, AxisVecX,
 AxisVecY, AxisVecZ,
AxisVecZ, Or
OriginDirX,
iginDirX, Or
OriginDirY,
iginDirY, Or
OriginDirZ,
iginDirZ, MajorR
MajorRadius,
adius, MinorRadi
MinorRadius, Solid) 
us, SwAngle, Solid)
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

AxisCenterX
AxisCenter X double Required. This argument is the X-coordinate of a point on the center axis.The type is double.

AxisCenterY
AxisCenter Y double Required. This argument is the Y-coordinate of a point on the center axis.The type is double.

AxisCenterZ
AxisCenter Z double Required. This argument is the Z-coordinate of a point on the center axis.The type is double.

AxisVecX double Required. This argument is the X-coordinate of a point along the axis vector. The type is double.
AxisVecY double Required. This argument is the Y-coordinate of a point along the axis vector. The type is double.

AxisVecZ double Required. This argument is the Z-coordinate of a point along the axis vector. The type is double.

OriginDirX
OriginDir X double Required. This argument is the X-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

OriginDirY
OriginDir Y double Required. This argument is the Y-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

OriginDirZ
OriginDir Z double Required. This argument is the Z-coordinate of a point along the vector toward the center of the minor
circle. The type is double.

MajorRadius double Required. This argument is the length of the major radius. The type is double.

MinorRadius double Required. This argument is the length of the minor radius. The type is double.
SwAngle double Required. This argument is the sweep angle in radians. The type is double.

Solid Boolean Required. This argument is a Boolean flag indicating whether or not the torus is a solid.

CreateByCenterAxisRadEnds
CreateByCenterAxisRadEnds Method

Description
The CreateByCenterAxisRadEnds method creates and returns a pointer (ppObj) to the IJCone interface of a bounded
partial Cone3d. This method takes as input a base center point, axis, base starting point, base ending point, and a top
radius.
The cone follows the right-hand rule about the axis.
The axis vector must contain the height of the cylinder.
The base ellipse must not be degenerate, so the base center point cannot be the same as the base starting point.
To create a point cone, set the top radius length to zero.
Syntax

159 

object.CreateByCenterAxisRadEnds (pConnection, CenterBx, CenterBy, CenterBz, AxisVx, AxisVy, AxisVz, RadiusT,


StartBx, StartBy, StartBz, EndBx, EndBy, EndBz, Solid) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterBx double Required. This argument is the X-coordinate of the base center point. The type is double.

CenterBy double Required. This argument is the Y-coordinate of the base center point. The type is double.

CenterBz double Required. This argument is the Z-coordinate of the base center point. The type is double.

AxisVx double Required. This argument is the X-coordinate of a point on the axis vector. The type is double.

AxisVy double Required. This argument is the Y-coordinate of a point on the axis vector. The type is double.

AxisVz double Required. This argument is the Z-coordinate of a point on the axis vector. The type is double.

RadiusT double Required. This argument is the top radius value. The type is double.

StartBx
StartB x double Required. This argument is the X-coordinate of the base starting point. The type is double.

StartBy
StartB y double Required. This argument is the Y-coordinate of the base starting point. The type is double.

StartBzz
StartB double Required. This argument is the Z-coordinate of the base starting point. The type is double.

EndBx double Required. This argument is the X-coordinate of the base ending point. The type is double.

EndBy double Required. This argument is the Y-coordinate of the base ending point. The type is double.

EndBz double Required. This argument is the Z-coordinate of the base ending point. The type is double.

Solid Boolean Required. This argument is a Boolean flag indicating whether the cone is solid or not.

CreateByCenterNormalMajAxisRatio
CreateByCenterNormalMajAxisRatioAngle
Angle Method

Description
The CreateByCenterNormalMajAxisRatioAngle method creates and returns an EllipticalArc3d object given a center
point, normal axis, major axis containing length, minor/major ratio, start angle, and sweep angle (angles in radians).

Syntax
object.CreateByCenterNormalMajAxisRatioAngle (pConnection, CenterX, CenterY, CenterZ, NormalX, NormalY,
 NormalZ, MajorX,
MajorX, MajorY
MajorY,, MajorZ, MMRa
MMRatio,
tio, StartAngle
StartAngle,, Sw
SwAngle)
Angle) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate of the center point. The type is double.

CenterY double Required. This argument is the Y-coordinate of the center point. The type is double.

CenterZ double Required. This argument is the Z-coordinate of the center point. The type is double.

NormalX double Required. This argument is the X-coordinate of a point on the normal vector. The type is double.

NormalY double Required. This argument is the Y-coordinate of a point on the normal vector. The type is double.
NormalZ double Required. This argument is the Z-coordinate of a point on the normal vector. The type is double.

160 

MajorX double Required. This argument is the X-coordinate of a point on the major axis vector. The type is double.

MajorY double Required. This argument is the Y-coordinate of a point on the major axis vector. The type is double.

MajorZ double Required. This argument is the Z-coordinate of a point on the major axis vector. The type is double.

MMRatio double Required. This argument is the minor axis to major axis ratio. The type is double.

StartAngle double Required. This argument is the start angle in radians. The type is double.

SwAngle double Required. This argument is the sweep angle in radians. The type is double.

CreateByCenterNormalRadius
CreateByCenterNormalRadius Method

Description
The CreateByCenterNormalRadius method creates and returns a pointer (ppObj) to an IJCircle interface of a
Circle3d object, given the center, normal unit vector, and radius.

Syntax
object.CreateByCenterNormalRadius (pConnection, CenterX, CenterY, CenterZ, NormalX, NormalY, NormalZ,
 Radius) 

Parameter Data Type Descriptio


Description
n
pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate of the center of the circle. The type is double.

CenterY double Required. This argument is the Y-coordinate of the center of the circle. The type is double.

CenterZ double Required. This argument is the Z-coordinate of the center of the circle. The type is double.

NormalX double Required. This argument is the X-coordinate of a point on the normal vector. The type is double.

NormalY double Required. This argument is the Y-coordinate of a point on the normal vector. The type is double.

NormalZ double Required. This argument is the Z-coordinate of a point on the normal vector. The type is double.

Radius double Required. This argument is the radius of the circle. The type is double.

CreateByCenterNormMajAxisRatio
CreateByCenterNormMajAxisRatio Method

Description
The CreateByCenterNormMajAxisRatio method creates and returns a pointer (ppObj) to the IJEllipse interface of an
Ellipse3d object, given a center point, normal axis, major axis containing length, and minor/major ratio.

Syntax
object.CreateByCenterNormMajAxisRatio (pConnection, CenterX, CenterY, CenterZ, NormalX, NormalY, NormalZ,
 MajorX, MajorY,
MajorY, MajorZ, MM
MMRatio)
Ratio) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate of the center point. The type is double.
CenterY double Required. This argument is the Y-coordinate of the center point. The type is double.

161 

CenterZ double Required. This argument is the Z-coordinate of the center point. The type is double.

NormalX double Required. This argument is the X-coordinate of a point on the normal vector. The type is double.

NormalY double Required. This argument is the Y-coordinate of a point on the normal vector. The type is double.

NormalZ double Required. This argument is the Z-coordinate of a point on the normal vector. The type is double.

MajorX double Required. This argument is the X-coordinate of a point on the major axis vector. The type is double.

MajorY double Required. This argument is the Y-coordinate of a point on the major axis vector. The type is double.

MajorZ double Required. This argument is the Z-coordinate of a point on the major axis vector. The type is double.

MMRatio double Required. This argument is the minor axis to major axis ratio. The type is double.

CreateByCenterRadius
CreateByCenterRadius Method

Description
The CreateByCenterRadius method creates and returns a pointer (ppObj) to the IJSphere interface of a Sphere3d
object, based on a center point and a radius.

Syntax
object.CreateByCenterRadius (pConnection, CenterX, CenterY, CenterZ, Radius, Solid) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate of the center point. The type is double.

CenterY double Required. This argument is the Y-coordinate of the center point. The type is double.

CenterZ double Required. This argument is the Z-coordinate of the center point. The type is double.

Radius double Required. This argument is the length of the radius. The type is double.

Solid Boolean Required. This argument is a Boolean flag indicating whether or not the sphere is solid.

CreateByCenterStartEnd Method

Description
The CreateByCenterStartEnd method creates an Arc3d object according to the specified inputs.
The center and start coordinates define the radius. A non-colinear ending point defines the sweep angle and plane
(this returns an arc between 0 and P1).

Syntax
object.CreateByCenterStartEnd (pConnection, CenterX, CenterY, CenterZ, StartX, StartY, StartZ, EndX, EndY,
 EndZ) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate for the center point on the arc. The type is double.
CenterY double Required. This argument is the Y-coordinate for the center point on the arc. The type is double.

162 

CenterZ double Required. This argument is the Z-coordinate for the center point on the arc. The type is double.

StartX double Required. This argument is the X-coordinate for the starting point on the arc. The type is double.

StartY double Required. This argument is the Y-coordinate for the starting point on the arc. The type is double.

StartZ double Required. This argument is the X-coordinate for the starting point on the arc. The type is double.

EndX double Required. This argument is the X-coordinate for the ending point on the arc. The type is double.

EndY double Required. This argument is the Y-coordinate for the ending point on the arc. The type is double.

EndZ double Required. This argument is the Z-coordinate for the ending point on the arc. The type is double.

CreateByComplexString
CreateByComplexString Method

Description
The CreateByComplexString method creates and returns a pointer (ppObject) to the interface of a BSplineCurve3d
object. This method works by converting an input complex string.

Syntax
object.CreateByComplexString (pConnection
(pConnection,, pCS) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

pCS IJComplexS
IJComplexString
tring Required. This argument is a pointer to IJComplexStri
IJComplexString.
ng.

CreateByCtrNormStartEnd
CreateByCtrNormStartEnd Method

Description
The CreateByCtrNormStartEnd method creates and returns an Arc3d object given the center, normal vector, start
and end points, radius, and direction.

Syntax
object.CreateByCtrNormStartEnd (pConnection, CenterX, CenterY, CenterZ, NormalX, NormalY, NormalZ, StartX,
StartY, StartZ, EndX, EndY, EndZ) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterX double Required. This argument is the X-coordinate for the center point of the arc. The type is double.

CenterY double Required. This argument is the Y-coordinate for the center point of the arc. The type is double.

CenterZ double Required. This argument is the Z-coordinate for the center point of the arc. The type is double.

NormalX double Required. This argument is the X-coordinate for a point on the normal vector. The type is double.

NormalY double Required. This argument is the Y-coordinate for a point on the normal vector. The type is double.

NormalZ double Required. This argument is the Z-coordinate for a point on the normal vector. The type is double.

StartX double Required. This argument is the X-coordinate for the starting point on the arc.The type is double.
StartY double Required. This argument is the Y-coordinate for the starting point on the arc. The type is double.

163 

StartZ double Required. This argument is the Z-coordinate for the starting point on the arc. The type is double.

EndX double Required. This argument is the X-coordinate for the ending point on the arc. The type is double.

EndY double Required. This argument is the Y-coordinate for the ending point on the arc. The type is double.

EndZ double Required. This argument is the Z-coordinate for the ending point on the arc. The type is double.

CreateByCurve Method (IProjections3d)

Description
The CreateByCurve method creates and returns a pointer (ppObj) to the IJProjection interface of a Projection3d
object based on a planar curve, direction, and length.

Syntax
object.CreateByCurve (pConnection, CurveObject, uvX, uvY, uvZ, Length, Capped) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObject
CurveObje ct Object Required. This argument is the IDispatch interfa
interface
ce of the planar curve.

uvX double Required. This argument is the X-coordinate of the point along the curve in the plane. The type is
double.

uvY double Required. This argument is the Y-coordinate of the point along the curve in the plane. The type is
double.

uvZ double Required. This argument is the Z-coordinate of the point along the curve in the plane. The type is
double.

Length double Required. This argument is the length of the projection in the direction of the point. The type is
double.

Capped Boolean Required. This argument is a Boolean flag indicating whether or not the object is capped.

CreateByCurve Method (IRevolutions3d)


(IRevolutions3d)

Description
The CreateByCurve method creates and returns a pointer (ppObj) to the IJRevolution interface of a Revolution3d
object based on a curve to revolve, an axis vector, and a point on the axis.

Syntax
object.CreateByCurve (pConnection, CurveObject, AxisX, AxisY, AxisZ, CenterX, CenterY, CenterZ, SwAngle,
Capped) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObject
CurveObje ct Object Required. This argument is the IDispatch interfa
interface
ce of the planar curve.

AxisX double Required. This argument is the X-coordinate of a point on the axis vector. The type is double.

AxisY double Required. This argument is the Y-coordinate of a point on the axis vector. The type is double.
AxisZ double Required. This argument is the Z-coordinate of a point on the axis vector. The type is double.

164 

CenterX double Required. This argument is the X-coordinate of the center point on the axis. The type is double.

CenterY double Required. This argument is the Y-coordinate of the center point on the axis. The type is double.

CenterZ double Required. This argument is the Z-coordinate of the center point on the axis. The type is double.

SwAngle double Required. This argument is the sweep angle in radians. The type is double.

Capped Boolean Required. This argument is a Boolean flag indicating whether or not the object is capped. If
capped, then the result is either a closed planar curve revolved partially or an open planar curve
revolved fully.

CreateByCurves Method (IComplexSt


(IComplexStrings3d)
rings3d)

Description
The CreateByCurves method creates and returns a pointer (ppObj) to the IJComplexString interface of a
ComplexString3d object. The input to this method is an array of Curves. Allowable open curve types include
Line3d, Arc3d, EllipticalArc3d, LineString3d, ComplexString3d, and BsplineCurve3d.

Syntax
object.CreateByCurves (pConnection, pIJCurveElements)
pIJCurveElements) 

Parameterr
Paramete Data Type Description
pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

pIJCurveElements
pIJCurveEl ements IJElement
IJElementss Required. This argument is a pointer to the first element in an array of Curves.

CreateByCurves Method (IRuledSurfaces3d)

Description
The CreateByCurves method creates and returns a pointer (ppObj) to the IJRuled interface of a RuledSurface3d
object based on a base curve and a top curve.

Syntax
object.CreateByCurves (pConnection, CurveObjectBase, CurveObjectTop, Capped) 
Parameter Data Type Descriptio
Description
n

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObjectBase
CurveObje ctBase Object Required. This argument is the IDispatch interfa
interface
ce of the base planar curve.

CurveObjectTop
CurveObje ctTop Object Required. This argument is the IDispatch interfa
interface
ce of the top planar curve. The type is double.

Capped Boolean Required. This argument is a Boolean flag indicating whether or not the object is capped.
If capped, then the result is either two closed planar curves or one degenerate and the
other closed and planar.

CreateByFitCurvee Method
CreateByFitCurv

Description
The CreateByFitCurve method creates and returns a pointer (ppObj) to the interface of a BSplineCurve3d object.
This method works by direct fitting a set of points.
The start and end tangent constraints are optional. These constraints should be set to 0.0 if they are not needed.
The Order property determines the relative accuracy of the poles with regard to the points that are entered to create
the curve. The order returned evaluat
evaluates
es as a polynomial
polynomial degree plus one. For example, an order
order of 4 defines cubic.

165 

Since it is more efficient to use even-order b-spline curves, the number of poles (and knots) are maximized by
increasing the order to the next even number.

Syntax
object.CreateByFitCurve (pConnection, Order, PointCount, Points, Start_vX, Start_vY, Start_vZ, End_vX,
End _vX, End_vY,
 End_vZ, Closed, periodic) 

Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

Order long Required. This argument is the order of the curve. The type is long.

PointCount long Required. This argument is the number of points along the curve. The type is long.

Points double Required. This argument is a SAFEARRAY of points along the curve. The type is double.

Start_vX
Start_ vX double Required. This argument is the X-coordinate for the starting point of the curve. The type is double.

Start_vY
Start_ vY double Required. This argument is the Y-coordinate for the starting point of the curve. The type is double.

Start_vZ
Start_ vZ double Required. This argument is the Z-coordinate for the starting point of the curve. The type is double.

End_vX double Required. This argument is the X-coordinate for the ending point of the curve. The type is double.

End_vY double Required. This argument is the Y-coordinate for the ending point of the curve. The type is double.

End_vZ double Required. This argument is the Z-coordinate for the ending point of the curve. The type is double.

Closed Boolean Required. This argument is a Boolean flag that specifies whether or not the curve is closed.

periodic Boolean Required. This argument is a Boolean flag that specifies whether or not the curve is periodic.

CreateByFitSurface Method

Description
The CreateByFitSurface method creates and returns a pointer (ppObj) to an interface for a BSplineSurface3d object.
This method does a direct fit of a B-spline surface through a set of points. The points are ordered (as surface poles
are) in the u-direction by v-direction.

Syntax
object.CreateByFitSurface (pConnection, vNumPoints, uNumPoints, Points, uOrder, vOrder, uClosedForm,
vClosedForm) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

vNumPoints long Required. This argument is a SAFEARRAY of the v-number of points along the surface. The type
is double.

uNumPoints double Required. This argument is a SAFEARRAY of the u-number of points along the surface. The type
is double.

Points double Required. This argument is a SAFEARRAY of points along the surface. The type is double.

uOrder long Required. This argument is the u order of the surface, which must be greater than 1. The type is
long.

166  

vOrder long Required. This argument is the v-order of the surface, which must be greater than 1. The type is
long.

uClosedForm
uClosedF orm long Required. This argument specifies the smoothness at the start and end of a closed B-spline surface
in the u-direction. The type is long. If 0: no smoothness requirements, 1: closed with tangent
continuity (no tangents input) (this value is not currently supported), 2: closed and periodic.

vClosedForm long Required. This argument specifies the smoothness at the start and end of a closed B-spline surface
in the v-direction. The type is long. If 0: no smoothness requirements, 1: closed with tangent
continuity (no tangents input) (this value is not currently supported), 2: closed and periodic.

CreateByLeastSquareFitCurve
CreateByLeastSquareFitCurve Method

Description
The CreateByLeastSquareFitCurve method creates and returns a pointer (ppObj) to the interface of a
BSplineCurve3d object. This method fits a set of points using least squares.
The start and end tangent constraints are optional. You should set these constraints to 0.0 if they are not needed.

Syntax
object.CreateByLeastSquareFitCurve (pConnection, Order, PointCount, Points, Start_vX, Start_vY, Start_vZ,
 End_vX, End_vY, End_vZ, Clos
Closed,
ed, periodic, opt,
opt, nseg, tol) 

Parameterr
Paramete Data Type Description
pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

Order long Required. This argument specifies the order of the curve. The type is long.

PointCount long Required. This argument is the number of points along the curve. The type is long.

Points double Required. This argument is a SAFEARRAY of points along the curve. The type is double.

Start_vX
Start_ vX double Required. This argument is the X-coordinate for the starting point of the curve. The type is double.

Start_vY
Start_ vY double Required. This argument is the Y-coordinate for the starting point of the curve. The type is double.

Start_vZ
Start_ vZ double Required. This argument is the Z-coordinate for the starting point of the curve. The type is double.

End_vX double Required. This argument is the X-coordinate for the ending point of the curve. The type is double.

End_vY double Required. This argument is the Y-coordinate for the ending point of the curve. The type is double.

End_vZ double Required. This argument is the Z-coordinate for the ending point of the curve. The type is double.

Closed Boolean Required. This argument is a Boolean flag that specifies whether or not the curve is closed.

periodic Boolean Required. This argument is a Boolean flag that specifies whether or not the curve is periodic.

opt Boolean Required. This argument is an option that specifies the fit of the curve. Its type is Boolean. If this
option is 0, it means fit within the given tolerance; if it is 1, it means fit with the given number of
segments.

nseg long Required. This argument is the number of segments used in the fitting, if opt=1. The type is long.

tol double Required. This argument is the tolerance used in the fitting, if opt = 0. The type is double.
167  

CreateByLeastSquareFitSurface
CreateByLeastSquareFitSurface Method

Description
The CreateByLeastSquareFitSurface method creates and returns a pointer (ppObj) to an interface for a a
BSplineSurface3d object. This method does a least square fit of a B-spline surface through a set of points. The
points are ordered (as surface poles are) in the u-direction by v-direction.

Syntax
object.CreateByLeastSquareFitSurface (pConnection, vNumPoints, uNumPoints, Points, uOrder, vOrder, uPeriodic,
vPeriodic, uNseg, vNseg) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

vNumPoints long Required. This argument is a SAFEARRAY of the v-number of points along the surface. The type
is double.

uNumPoints double Required. This argument is a SAFEARRAY of the u-number of points along the surface. The type
is double.

Points double Required. This argument is a SAFEARRAY of points along the surface. The type is double.

uOrder long Required.


long. This argument is the u-order of the surface, which must be greater than 1. The type is

vOrder long Required. This argument is the v-order of the surface, which must be greater than 1. The type is
long.

uPeriodic Boolean Required. This argument is a Boolean flag that specifies whether or not the surface is periodic in u.

vPeriodic Boolean Required. This argument is a Boolean flag that specifies whether the surface is periodic in v.

uNseg long Required. This argument is the number of segments in u. The type is long.

vNseg long Required. This argument is the number of segments in v. The type is long.

CreateByOffset Method

Description
The CreateByOffset method creates and returns an offset curve.

Syntax
object.CreateByOffset (pConnection, Obj, DPtx, DPty, DPtz, OffsetDist, code) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

Obj Object Required. This argument is the curve to offset. The type is Object.

DPtx double Required. This argument is the vector component in the X-directi
X-direction.
on. The type is double.

DPty double Required. This argument is the vector component in the Y-directi
Y-direction.
on. The type is double.

DPtz double Required. This argument is the vector component in the Z-directi
Z-direction.
on. The type is double.
OffsetDist
OffsetDi st double Required. This argument is the distance for the offset. The type is double.

168 

code Int Required. This argument is an integer that describes the offset curve. Possible values are: 0 -
extend; 1 - fillet.

CreateByOuterBdry
CreateByOuterBdry Method

Description
The CreateByOuterBdry method creates and returns a pointer (ppObj) to the IJPlane interface of an infinite Plane3d
object, based on a point and a normal.

Syntax
object.CreateByOuterBdry (pConnection, CurveObject) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObject
CurveObje ct Object Required. This argument is the IDispatch interfa ce of the planar curve.

CreateByParameters Method (IBSplineCurves3d)


(IBSplineCurves3d)

Description
The CreateByParameters method creates and returns a pointer (ppObj) to the interface of a BSplineCurve3d object.
This method uses order, poles, weights, and knots. The weights and knots are optional; they should be set to NULL
if not needed.
If the order is equal to the number of poles, the curve evolves into the control polygon of a Bezier curve.
B-spline weights can be considered a gravitational type force with the magnitude of the weight equal to the pulling
force. The weights are always
always normalized. If no weights are present, the cucurve
rve is considered to be non-rational and
may be NULL. Non-rational curves have weights with a value value of 1.
The B-spline knots define the parameterization of the curve, and they may be periodic. Knots, also known as knot
vectors, must be monotonic and strictly
strictly increasin
increasing.
g. Monotonic refers to the successive terms as non-decreas
non-decreasing
ing or
non-increasing.
The Order property determines the relative accuracy of the poles with regard to the points that are entered to create
the curve. The order returned evaluat
evaluateses as a polynomial
polynomial degree plus one. For example, an order
order of 4 defines cubic.
Since it is more efficient to use even-order b-spline curves, the number of poles (and knots) are maximized by
increasing the order to the next even number.

Syntax
object.CreateByParameters(pConnection, Order, PoleCount, Poles, Weights, Knots, periodic) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

Order long Required. This argument specifies the order of the curve. The type is long.

PoleCount long Required. This argument is the number of poles. The type is long.

Poles double Required. This argument is a SAFEARRAY of poles. The type is double.

Weights double Required. This argument is a SAFEARRAY of weights. The type is double.

Knots double Required. This argument is a SAFEARRAY of knots. The type is double. Generally, this value is
the number of poles plus the order value.
periodic Boolean Required. This argument is a Boolean flag that specifies whether or not the curve is periodic.

169 

CreateByParameters Method (IBSplineSurfaces3d)

Description
The CreateByParameters method creates and returns a pointer (ppObj) to an interface for a BSplineSurface3d object
based on the desired order and a set of poles (weights and knots are optional).
If periodic knots are passed in, but periodic is set to False, the knots will be converted to multiple end knots.
The outward normal is generally U cross V, but if the reverse normal is desired, set ReverseNor to True.
The poles are ordered in the u-direction by v-direction. Weights and knots are optional. The number of poles (u or v)
must be greater than or equal to the order in that direction.

Syntax
object.CreateByParameters(pConnection, uNumPoles, vNumPoles, Poles, Weights, uOrder, vOrder, uKnots, vKnots,
uPeriodic, vPeriodic, ReverseNor) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

uNumPoles long Required. This argument is the number of poles in the u-direction. The type is long.

vNumPoles long Required. This argument is the number of poles in the v-direction. The type is long.

Poles double Required. This argument is a SAFEARRAY of poles. The type is double.

Weights double Required. This argument is a SAFEARRAY of weights. The type is double.

uOrder long Required. This argument is the u-order of the surface, which must be greater than 1. The type is
long.

vOrder long Required. This argument is the v-order of the surface, which must be greater than 1. The type is
long.

uKnots double Required. This argument is a SAFEARRAY of knots. The type is double.

vKnots double Required. This argument is a SAFEARRAY of knots. The type is double.

uPeriodic Boolean Required. This argument is a Boolean flag that specifies whether the surface is periodic in u.

vPeriodic Boolean Required. This argument is a Boolean flag that specifies whether the surface is periodic in v.

ReverseNor
Reverse Nor Boolean Required. This argument is a Boolean flag that specifies whether or not the direction of the normal
is reversed.

CreateByPartOfCurve
CreateByPartOfCurve Method

Description
The CreateByPartOfCurve method creates and returns a part of the input curve.
Note: It is possible to cross the seam.

Syntax
object.CreateByPartOfCurve (pConnection, Obj, startPar, dirPar, endPar) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

Obj Object Required. This argument is the IDispatch interfa ce of the top planar curve.
startParr
startPa double Required. This argument is the start of the part of the curve.

170 

dirPar double Required. This argument is a point as the direction of the part of the curve that is retur
returned.
ned.

endPar double Required. This argument is the end of the part of the curve.

CreateByPoint Method

Description
The CreateByPoint method creates and returns an interface for a Point3d object, given X-, Y- and Z-coordinates.

Syntax
object.CreateByPoint (pConnection, x, y, z) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

x double Required. This argument is the X-coordinate. The type is double.

y double Required. This argument is the Y-coordinate. The type is double.

z double Required. This argument is the Z-coordinate. The type is double.

CreateByPointNormal
CreateByPointNormal Method

Description
The CreateByPointNormal method creates and returns a pointer (ppObj) to the IJPlane interface of an infinite
Plane3d object, based on a point and a normal.

Syntax
object.CreateByPointNormal (pConnection, PointX, PointY, PointZ, NormalX, NormalY, NormalZ)  
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

PointX double Required. This argument is the X-coordinate of the point. The type is double.

PointY double Required. This argument is the Y-coordinate of the point. The type is double.

PointZ double Required. This argument is the Z-coordinate of the point. The type is double.

NormalX double Required. This argument is the X-coordinate of a point on the normal. The type is double.

NormalY double Required. This argument is the Y-coordinate of a point on the normal. The type is double.

NormalZ double Required. This argument is the Z-coordinate of a point on the normal. The type is double.

CreateByPoints Method

Description
The CreateByPoints method creates and returns a pointer (ppObj) to the interface of a LineString3d object. This
method takes as input an array of points. The array is a one-dimensional array of doubles containing the X-, Y-, and
Z-coordinates of the vertex points.
Syntax
object.CreateByPoints (pConnection, PointCount, Points) 

171 

Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

PointCount long Required. This argument is the number of points in the array. The type is long.

Points double Required. This argument is a SAFEARRAY of points. The type is double.

CreateByPtVectLength
CreateByPtVectLength Method

Description
The CreateByPtVectLength method creates and returns a Line3d object, given the starting point, direction vector,
and length.

Syntax
object.CreateByPtVectLength (pConnection, StartX,
StartX, StartY, StartZ, uvX, uvY, uvZ, Length) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

StartX double Required. This argument is the X-coordinate for the starting point. The type is double.

StartY double Required. This argument is the Y-coordinate for the starting point. The type is double.

StartZ double Required. This argument is the Z-coordinate for the starting point. The type is double.

uvX double Required. This argument is the X-coordinate for the ending point. The type is double.

uvY double Required. This argument is the Y-coordinate for the ending point. The type is double.

uvZ double Required. This argument is the Z-coordinate for the ending point. The type is double.

Length double Required. This argument is the length of the line from the starting point. The type is double.

CreateBySingleSweepWCaps
CreateBySingleSweepWCaps Method

Description
The CreateBySingleSweepWCaps method creates a collection of swept surfaces with the option of caps. The output
is surfaces, and then caps.

Syntax
object.CreateBySingleSweepWCaps (pConnection, TrObj, CsObj, cornerOpt, BrkCv, StartOpt, StNorm,
St Norm, EdNorm,
WCaps, numCaps) 
Parameterr
Paramete Data Type Descri
Description
ption

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

TrObj Object Required. This argument is the trace curve. The type is Object.

CsObj Object Required. This object is the cross section curve or curve to sweep. It can be one curve,
or it can be a plane object that contains boundary curves, where the boundary curves
are each swept to make a separate surface; the first boundary of the plane is always the
region, and any following boundaries are holes. The type for CsObj is Object.
cornerOpt SkinningCorne
SkinningCornerOptions
rOptions Required. This argument is an option on how to handle trace curves that are line
strings. If the value is 0, the method averages the left/right tangent to get the plane for

172 

placing the cross section. If the value is 1, the method turns around the trace cusp with
an arc.

BrkCv SkinningBrea
SkinningBreakOptions
kOptions Required. This argument specifies whether or not the curves have breaks. Possible
values include: 0 - No breaks. 1 - If the cross is a GComplexString, then break and
create separate surfaces. 2 - If the trace is a GComplexString, then break and create
separate surfaces. 3 - Break cross and trace.

StartOpt SkinningCros
SkinningCrossSectionStart
sSectionStart Required. This argument is the starting option. Possible values are: 0 - No breaks; 1 -
If the cross is a GComplexString, then break and create separate surfaces; 2 - If the
trace is a GComplexString, then break and create separate surfaces; 3 - Break cross
and trace.

StNorm double Required. This argument specifies the startin


startingg normal. It is a SAFEARRAY of type
double.

EdNorm double Required. This argument specifies the ending normal. It is a SAFEARRAY of type
double.

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the surfaces
have caps. If the value is False, there are no caps; if the value is True, there are caps.

numCaps Int Required. This argument is the number of caps. The type is integer.

CreateBySkinning Method

Description
The CreateBySkinning method creates a skinned surface with the option of caps. The output is caps and the skin
surface.

Syntax
object.CreateBySkinning (pConnection
(pConnection,, pTrElements
pTrElements,, pCsElements, WCaps) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

pTrElements
pTrEleme nts IJElement
IJElementss Required. This argument is a pointer to the trace curves (can be more than 1). If there is one trace
only, the trace curve does not have to touch the cross section, but must cross the plane containing
the cross section. If there is more than one trace, then the trace curves must touch the cross sections.
pCsElementss
pCsElement IJElement
IJElementss Required. This argument is a pointer to the cross section curves The value can be more than 1.
Cross sections are placed exactly how they are to be skinned.

WCaps Int Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the
value is False, there are no caps; if True, there are caps.

CreateConeBy4PtsWCaps
CreateConeBy4PtsWCaps Method

Description
The CreateConeBy4PtsWCaps method creates and returns a bounded Cone3d object based on four points - base
center point, top center point, base starting point, and top starting point. Caps are optional. The output is the surface,
and then caps.
Syntax
object.CreateConeBy4PtsWCaps (pConnection, CenterBx, CenterBy, CenterBz, CenterTx, CenterTy, CenterTz,
StartBx, StartBy, StartBz, StartTx, StartTy, StartTz, Solid, WCaps, numCaps) 

173 

Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CenterBx double Required. This argument is the X-coordinate for the base ellipse center point. The type is double.

CenterBy double Required. This argument is the Y-coordinate for the base ellipse center point. The type is double.

CenterBz double Required. This argument is the Z-coordinate for the base ellipse center point. The type is double.

CenterTx double Required. This argument is the X-coordinate for the top ellipse center point. The type is double.

CenterTy double Required. This argument is the Y-coordinate for the top ellipse center point. The type is double.

CenterTz double Required. This argument is the Z-coordinate for the top ellipse center point. The type is double.

StartBx
StartB x double Required. This argument is the X-coordinate for the base ellipse starting point. The type is double.

StartBy
StartB y double Required. This argument is the Y-coordinate for the top ellipse starting point. The type is double.

StartBzz
StartB double Required. This argument is the Z-coordinate for the base ellipse starting point. The type is double.

StartTx double Required. This argument is the X-coordinate for the top ellipse starting point. The type is double.

StartTy
StartT y double Required. This argument is the Y-coordinate for the top ellipse starting point. The type is double.

StartTzz
StartT double Required. This argument is the Z-coordinate for the top ellipse starting point. The type is double.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input
point; 3 - Toggle the outward normal (no checks).

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the
value is False, there are no caps; if True, there are caps.

numCaps Int Required. This argument is the number of caps. The type is integer.

CreateProjectionByCurveWCaps
CreateProjectionByCurveWCaps Method

Description
The CreateProjectionByCurveWCaps method creates a Projection3d object from a curve, direction, and length.
Valid curves are Line, Arc, Circle, Ellipse, EllipticalArc, LineString, ComplexString, and BSplineCurve. Caps are
optional. The output is the surface, and then the caps.

Syntax
object.CreateProjectionByCurveWCaps (pConnection, CurveObject, uvX, uvY, uvZ, Length, Solid, WCaps,
numCaps) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObject
CurveObje ct Object Required. This argument is the curve to project. The type is Object.

uvX double Required. This argument is the X-coordinate of the point that specifies the vector. The type is
double.
uvY double Required. This argument is the Y-coordinate of the point that specifies the vector. The type is
double.

174 

uvZ double Required. This argument is the Z-coordinate of the point that specifies the vector. The type is
double.

Length double Required. This argument is the projection distance. The type is double.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input
point; 3 - Toggle the outward normal (no checks).

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the
value is False, there are no caps; if True, there are caps.

numCaps Int Required. This argument is the number of caps. The type is integer.

CreateRevolutionByCurveWCaps
CreateRevolutionByCurveWCaps Method

Description
The CreateRevolutionByCurveWCaps method creates a Revolution3d object from a curve, axis vector, point on
axis, and sweep angle (radians). Valid curves are Line, Arc, Circle, Ellipse, EllipticalArc, LineString,
ComplexString, and BSplineCurve. Caps are optional. Output is the surface, and then the caps.

Syntax
object.CreateRevolutionByCurveWCaps (pConnection, CurveObject, AxisX, AxisY, AxisZ, CenterX, CenterY,
CenterZ, SwAngle, Solid, WCaps, numCaps) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObject
CurveObje ct Object Required. This argument is the curve from which to create the revolution. The type is Object.

AxisX double Required. This argument is the X-coordinate of the point that specifies the axis direction. The type
is double.

AxisY double Required. This argument is the Y-coordinate of the point that specifies the axis direction. The type
is double.

AxisZ double Required. This argument is the Z-coordinate of the point that specifies the axis direction. The type
is double.

CenterX double Required. This argument is the X-coordinate of the center point. The type is double.

CenterY double Required. This argument is the Y-coordinate of the center point. The type is double.

CenterZ double Required. This argument is the Z-coordinate of the center point. The type is double.

SwAngle double Required. This argument is the sweep angle. The type is double.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input
point; 3 - Toggle the outward normal (no checks).

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the
value is False, there are no caps; if True, there are caps.

numCaps Int Required. This argument is the number of caps. The type is integer.
175 

CreateRuledByCurvesWCaps
CreateRuledByCurvesWCaps Method

Description
The CreateRuledByCurvesWCaps method creates a RuledSurface3d object from a base curve and a top curve. Valid
curves are Line, Arc, Circle, Ellipse, EllipticalArc, LineString, ComplexString, and BSplineCurve. Caps are
optional. The output is the surface, and then the caps.

Syntax
object.CreateRuledByCurvesWCaps (pConnection, CurveObjectBase, CurveObjectTop,
CurveObjectTop, Solid, WCaps, numCaps) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

CurveObjectBase
CurveObje ctBase Object Required. This argument is the base curve.

CurveObjectTop
CurveObje ctTop Object Required. This argument is the top curve.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input
point; 3 - Toggle the outward normal (no checks).

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the

value is False, there are no caps; if True, there are caps.


numCaps Int Required. This argument is the number of caps. The type is integer.

CreateTorusByAxisMajorMinorRadiu
CreateTorusByAxisMajorMinorRadiusSweepWCaps
sSweepWCaps Method

Description
The CreateTorusByAxisMajorMinorRadiusSweepWCaps method creates and returns a Tori3d (torus) object based
on an axis, a center point on the axis, the direction to the origin in UV space (orthogonal to the axis), a major radius,
and a minor radius. Caps are optional. The output is the surface, and then the caps.

Syntax
object.CreateTorusByAxisMajorMinorRadiusSweepWCaps (pConnection, AxisCenterX, AxisCenterY,
AxisCenterY, AxisCenterZ
AxisCenterZ,,
 AxisVecX, AxisVecY,
AxisVecY, Axis
AxisVecZ,
VecZ, Ori
OriginDirX,
ginDirX, Orig
OriginDirY,
inDirY, Ori
OriginDirZ,
ginDirZ, MajorRa
MajorRadius,
dius, MinorRadi
MinorRadius,
us, SwAngle, So
Solid,
lid,
WCaps, numCaps) 
Parameterr
Paramete Data Type Description

pConnection Unknown Required. This argument is a pointer to IUnknown. It creates a transient object.

AxisCenterX
AxisCenter X double Required. This argument is the X-coordinate of the axis center point. The type is double.

AxisCenterY
AxisCenter Y double Required. This argument is the Y-coordinate of the axis center point. The type is double.

AxisCenterZ
AxisCenter Z double Required. This argument is the Z-coordinate of the axis center point. The type is double.

AxisVecX double Required. This argument is the X-coordinate of the point that specifies the axis direction. The type
is double.

AxisVecY double Required. This argument is the Y-coordinate of the point that specifies the axis direction. The type
is double.

AxisVecZ double Required. This argument is the Z-coordinate of the point that specifies the axis direction. The type
is double.

OriginDirX
OriginDir X double Required. This argument is the X-coordinate of the point that specifies the origin direction. The

176  

type is double.

OriginDirY
OriginDir Y double Required. This argument is the Y-coordinate of the point that specifies the origin direction. The
type is double.

OriginDirZ
OriginDir Z double Required. This argument is the Z-coordinate of the point that specifies the origin direction. The type
is double.

MajorRadius double Required. This argument is the major radius for the torus. The type is double.

MinorRadius double Required. This argument is the minor radius for the torus. The type is double.

SwAngle double Required. This argument is the sweep angle. The type is double.

Solid Boolean Required. This argument is a Boolean flag that specifies whether or not the object is solid. Possible
values are: 0 - Set normal as hollow; 1 - Set normal as solid; 2 - Set normal according to input
point; 3 - Toggle the outward normal (no checks).

WCaps Boolean Required. This argument is a Boolean flag that specifies whether or not the object has caps. If the
value is False, there are no caps; if True, there are caps.

numCaps Int Required. This argument is the number of caps. The type is integer.

The following section shows some examples on how to create some geometry components:

GeometryFactory.Ellipses3dCreateByCenterNormMajAxisRatio
Creates/returns an Ellipse given the center point, normal axis, major axis containing length, and
minor/major ratio.

Function Ellipses3d.CreateByCenterNormMajA
Ellipses3d.CreateByCenterNormMajAxisRatio(pConnectio
xisRatio(pConnection n As Unknown, CenterX As Double, CenterY As
 Double, CenterZ As Double, Nor
NormalX
malX As D
Double,
ouble, NormalY As Double, Norm
NormalZ
alZ As Doubl
Double,
e, MajorX As Double,
 MajorY As Double,
Double, MajorZ As Double, MM
MMRatio
Ratio As Doubl
Double)
e) As Ellipse3d
Ellipse3d

Define the collection item: m_outputColl.ResourceMan


m_outputColl.ResourceManager
ager
Define the center of the ellipse: CenterX, CenterY, CenterZ
Define the normal vector: NormalX, NormalY, NormalZ
Define the major axis vector: MajorPointVecX, MajorPointVecY, MajorPointVecZ
Define the axis ratio: MMRatio

Example:
 Dim ellipse As IngrGeom3D.Ell
IngrGeom3D.Ellipse3d
ipse3d
 Dim circlePointVecX
circlePointVecX As Do
Double,
uble, circleP
circlePointVecY
ointVecY As Double, circlePointVecZ
circlePointVecZ As Double

177  

 Dim circleNormalX
circleNormalX As Double
Double,, circleNormalY As Double, circleNormalZ As Double
 Dim projVecX As Double, projV
projVecY
ecY As Doub
Double,
le, projVecZ As Double

circleCenterX = 0#
circleCenterY = 0#
circleCenterZ = 0#

circleNormalX = 0#
circleNormalY = 0#
circleNormalZ = 1#

circlePointVecX
circlePointVe cX = 0#
circlePointVecY = diameter * 0.5
circlePointVecZ
circlePointVe cZ = 0#
axesRation 1.0

Set ellipse = geomFactory.E


geomFactory.Ellipses3d.Crea
llipses3d.CreateByCenterNorm
teByCenterNormMajAxisRatio(
MajAxisRatio(m_outputColl.R
m_outputColl.ResourceManager,
esourceManager, _
circleCenterX,, circleCenterY, circleCenterZ, _
circleCenterX
circleNormalX,
circleNorma lX, ci
circleNormalY
rcleNormalY,, circleNormalZ
circleNormalZ,, _
circlePointVecX, circlePointVecY, circlePointVecZ, _
axesRatio)

GeomFactory.Projections3d.CreateByCurve
Creates and returns a Projection3d based on a curve, direction and length. Valid curve objects are
Line, Arc, Circle, Ellipse, EllipticalArc, LineString, ComplexString, and BSplineCurve.

Function Projections3d.CreateByCurve(pConnect
Projections3d.CreateByCurve(pConnection
ion As Unknown, CurveObject As Object, projvecX As Double,
 projvecY As Double,
Double, projvecZ As Double, Len
Length
gth As Double
Double,, Capped As Boolean) As Projection3d
Projection3d

Define the collection item: m_outputColl.ResourceMan


m_outputColl.ResourceManager
ager
Define the CurveObject to be projected: CurveObject As Object
Define the projection vector: projVecX, projVecY, projVecZ As Double
Define the projection sidtance: Length As Double
Set the ends to be capped true or false: Capped As Boolean

Example:
 Dim projection As IngrGeom3D
IngrGeom3D.Projection3d
.Projection3d
 Dim projVecX As Double, projV
projVecY
ecY As Doub
Double,
le, projVecZ As Double
 Dim length As Double
Double

178 

 projVecX = 0#
 projVecY = 0#
 projVecZ = 1#

Set projection = geomFactory


geomFactory.Projections3d.Cr
.Projections3d.CreateByCurve(
eateByCurve(m_outputColl.Resour
m_outputColl.ResourceManager,
ceManager, ellipse, _

 projVecX, projVecY,
projVecY, projV
projVecZ,
ecZ, length, True)
179 

GeomFactory.Planes3d.CreateByPoints
Creates and returns a bounded Plane3d based on 3 or more non-linear, coplanar points. The
points must be oriented such that the orientation of the points defines the normal(follows the
right hand rule). 

Function Planes3d.CreateByPoints(pConnection As Unknown, PointCount As Long, Points() As Double) As


Plane3d

Define the collection item: m_outputColl.ResourceMan


m_outputColl.ResourceManager
ager
Define the numbe of point in the co
collection:
llection: PointCount As Long
Input an array of Points(): Points as Double

Example:
 Dim plane As IngrGeom3D.Pla
IngrGeom3D.Plane3d
ne3d
 Dim Points(0
Points(0 To 11) As Double

Points(0) = MinX
Points(1) = MinY
Points(2) = 0#
Points(3) = MaxX
Points(4) = MinY
Points(5) = 0#
Points(6) = MaxX
Points(7) = MaxY
Points(8) = 0#
Points(9) = MinX
Points(10) = MaxY1
Points(11) = 0#

Set plane = geomFactory.Planes3d.Creat


geomFactory.Planes3d.CreateByPoints(
eByPoints(m_outputColl.Reso
m_outputColl.ResourceManager,
urceManager, 4, Points)
180 

GeomFactory.Revolutions3d.CreateByCurve
Creates and returns a Revolution3d based on a curve to revolve, axis vector, point on axis and
sweep angle(radians).Valid curve objects are Line, Arc, Circle, Ellipse, EllipticalArc, LineString,
ComplexString, and BSplineCurve. 

Function Revolutions3d .CreateByCurve(pConnection


.CreateByCurve(pConnection As Unknow
Unknown,
n, CurveObject As Object, AxisX As Double,
 AxisY As Double,
Double, AxisZ As Double, Cen
CenterX
terX As Double
Double,, CenterY As Double,
Double, CenterZ As Double, Sw
SwAngle
Angle As
 Double, Capped As Boolean) As Revolution3d
Revolution3d

Define the Projection vector to be revolved: AxisX, AxisY, AxisZ as Double


Define the point on axis: CenterX, CenterY, CenterZ as Double
Define sweep angle as Double
Set the ends to be capped true or false: Capped As Boolean  

 Example:

 Dim axisCenterX
axisCenterX As Double, axisCenterY
axisCenterY As Double, axisC
axisCenterZ
enterZ As Double
Double
 Dim axisVecX As Double, a
axisVecY
xisVecY As D
Double,
ouble, axisVecZ
axisVecZ As Double
 Dim oRevolution
oRevolution As IngrGeom3D
IngrGeom3D.Revolution3d
.Revolution3d

axisCenterX = 0#
axisCenterY = 0#
axisCenterZ = 0#
axisVecX = 0#
axisVecY = 0#
axisVecZ = 1#

 Dim oLineString As IngrGeom


IngrGeom3D.LineString3d
3D.LineString3d
 Dim planePoints(0
planePoints(0 To 14) As Do
Double
uble

 planePoints(0)
 planePoints(0) = diameter / 2
 planePoints(1) = 0
 planePoints(1)
 planePoints(2)
 planePoints(2) = 0
 planePoints(3)
 planePoints(3) = diameter / 2 + dInsulationThi
dInsulationThickness
ckness
 planePoints(4)
 planePoints(4) = 0
 planePoints(5) = 0
 planePoints(5)
 planePoints(6)
 planePoints(6) = diameter / 2 + dInsulationThi
dInsulationThickness
ckness
 planePoints(7)
 planePoints(7) = 0
 planePoints(8)
 planePoints(8) = length

181 

 planePoints(9)
 planePoints(9) = diameter / 2
 planePoints(10) = 0
 planePoints(10)
 planePoints(11)
 planePoints(11) = length
 planePoints(12)
 planePoints(12) = diameter / 2
 planePoints(13)
 planePoints(13) = 0
 planePoints(14)
 planePoints(14) = 0

Set oLineString = geomFactory.LineStrings3d.Cre


geomFactory.LineStrings3d.CreateByPoints
ateByPoints(m_outputColl.R
(m_outputColl.ResourceManager,
esourceManager, 5,_
 planePoints)

Set oRevolution = geomFactory.R


geomFactory.Revolutions3d.Cr
evolutions3d.CreateByCurve(m
eateByCurve(m_outputColl.Resourc
_outputColl.ResourceManager,
eManager, _
oLineString, axisVecX, axisVecY
axisVecY,, axisVecZ, axisCenterX, axisCenterY,
axisCenterY, axisCenterZ, _
2 * PI, False)
182 

NamingRulesHelper Object
This is the helper object that implements the IJDNamingRulesHelper interface to query the naming rules for an
object type, to create naming relations, and to query for the active naming rule. This is implemented in the middle
tier so that both application commands and business objects can use this implementation.

References
Object Library: Ingr Sp3d Generic NamingRules Helper 1.0

Interfaces
Interface Name lang Descripti
Description
on
IJDNamingRulesHelper vb/c This is the helper interface with the methods that can be used by application
applicati on
commands and business objects for defining naming rules for their objects.

IJDNamingRulesHelper
This is a helper interface that can be used to query the naming rules for an object type, to create naming relations,
and to query for the active naming rule. The functionality of this interface is accessed by adding a project reference
to the "Ingr Sp3d Generic NameRuleSemantics 1.0 Type Library".
This interface inherits from IDispatch.

When To Use
The Visual Basic® NamingRulesHelper Object implements all of the helper functions. This implementation can be
used as long as the applications are using the generic naming rules semantic.

Methods

GetEntityNamingRulesGivenName ( byval strEntityName as String ) as IJElements


Description:
Descripti on: It returns a reference (as NamingRules) to the IJElements interface of the first object in
a collection of the naming rules available in the catalog database for the given object
name input.
Parameters:
[in] strEntityName Class(object) name(interna
name(internall name).

GetEntityNamingRulesGivenProgID ( byval strEntityProgID as String ) as IJElements


Description:
Descripti on: It returns a reference (as NamingRules) to the IJElements interface of the first object in
a collection of the naming rules available in the catalog database for the given object
class ProgID input.
Parameters:
[in] strEntityProgID Object class ProgID.

AddNamingRelations ( byval pDispEntity as Object , byval pNameRuleHolder as IJDNameRuleHolder ) as


IJNameRuleAE
Description:
Descripti on: Adds naming relations "NamedEntity" and "EntityNamingRule" after creating the
Active Entity and returns a reference (as pActiveEntity) to the interface of the active
entity object created. The method deletes the Active Entity if it is there before creating
the new one so it can also be used to delete the relations. If nothing is sent as the
pNameRuleHolder argument, the method deletes the existing relations.
Parameters:
[in] pDispEntity The IDispatch interface of the object to be named.
[in] pNameRuleHolder The interface of the NamingRule.
GetActiveNamingRule ( byval pDispEntity as Object ) as IJDNameRuleHolder
Description:
Descripti on: This method returns a referen
reference
ce (as pNameRuleHolder) to the interface of the active
naming rule that is being used for naming the input object from the relations.
pNameRuleHldr will be nothing if there are no active naming rules on the object.

183 

Parameters:
[in] pDispEntity The IDispatch interface of the named object.

IsGeneratedNameUnique ( byval oEntity as LPDISPATCH , byval oFilter as IJSimpleFilter , byval strGenName as


String , optional byval strIID as String , optional byval strAttributeName as String ) as Boolean
Description:
Descripti on: This method returns a boolean value (as pVal) indicating whether the generated

name is unique
indicates in the
the name domain specified by the user through the oFilter. True
is unique.
The optional arguments strIID and strAttribute Name are to be provided by the
users of this function. They are provided so as to give an option to the user to
specify the Interface and also the Attribute of the object on which the name
uniqueness has to be ensured.
Parameters:
[in] oEntity The IDispatch interface of the named object.
[in] oFilter The interface of the Filter to use in determining the uniqueness.
[in] strGenName The generated name string.
[in] strIID An optional IID as a string to help in making the determination. If the IID is
provided then strAttributeName has to be provided. Default value is null string.
[in] strAttributeName
strAttributeNam e An optional AttributeNam
AttributeNamee as a string to help in making the determination.
determinat ion. Default
value is null string.
Return error codes:
E_FILTER_NOT_SPECIFIED The Filter w
was
as not specified.
184 

Attribute Helper service


CollectionHlp
The role of this object is to operate on one instantiated collection of attributes. A CollectionHlp object is returned by
most of the methods of the IJDAttributes and IJAttributes interfaces. A collection of attributes maps to an interface
definition, i.e., it gathers all the properties that belong to an interface.

References
Object Library: Ingr SmartPlant 3D Attributes 1.0 Type Library

Interfaces

Interface Name lang Descripti


Description
on
IJDAttributesCol
IJDAttributesC ol vb/c Visual Basic® Interface used to manipulate a collection of attributes.

IJDAttributesCol
This interface is used to get information from an item or items in a collection of attributes.
This interface inherits from IDispatch.

When Tointerface
Call this Use when you want to:
Access an item of a collection of attributes.
Access all the items of a collection of attributes.
Count the items of a collection.
Get the metadata about a collection of attributes.

Properties

Item ( byval VItem as Variant ) as IJDAttribute


Description:
Descripti on: IJDAttribute interface
Returns the IJDAttribute  interface of the attribute as ppAttribute. Note that: The For
Each loop is the preferred implementation to iterate through a collection instead of
using a simple index because the DispatchID is NOT a sequential list (1, 2, 3, ...).
Modifiability: Read Only
Parameters:
[in] VItem The VItem can be the DispatchID of the attribute or its name.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

_EnumItem ( ) as LPUNKNOWN
Description:
Descripti on: Enumerates all the attributes of this collection by returning ppEnumUnk.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

InterfaceInfo ( ) as IJDInterfaceInfo
Description:
Descripti on: IJDInterfaceInfo interface
Returns ppInfo, the IJDInterfaceInfo  interface of an InterfaceInfo Object for
Object for this
collection.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

185 

Count ( ) as Long
Description:
Descripti on: Returns the number of attributes of this Collection.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

IJDAttributes
This interface is used to get a CollectionOfAttributes property. This interface is implemented by any component that
is attributes-enabled and aggregates the AttributeHelper object.

When To Use
Call this interface when you want to access the CollectionOfAttributesproperty of an object.

Properties

CollectionOfAttributes( byval InterfaceType as Variant ) as IJDAttributesCol


Description:
Descripti on: Returns a pointer (ppIAttributesCol) to the IJDAttributesCol interface of the
CollectionHlp Object (collection of attributes).
If the UserTypeCLSID property was set to an acceptable value, the method checks to
see that this collection is allowed for this UserType according to the metadata.
If UserTypeCLSID is set to CLSID_NULL, the method only checks to see that this
collection/Interface is described in the metadata.
Modifiability: Read Only
Parameters:
[in] InterfaceType The InterfaceType is a variant that contains a string with the formatt
formatted
ed hexa value of
the IID : "{24E1A26B-1275-11d2-A684-00A0C96F81B9}", or with the interface
name IID : "IJGeometry", or a GUID structure.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).
E_NOINTERFACE The interface is not implemented by the UserType class. The AttributesCol is set to
NULL in this case.

Count ( ) as Long
Description:
Descripti on: Returns the number of collections of this object.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

Attribute
The role of this object is to operate on one instantiated attribute. The Attribute object is returned by most of the
methods of the IJDAttributesCol interface.

References
Object Library: Ingr SmartPlant 3D Attributes 1.0 Type Library

Interfaces

Interface Name lang Descripti


Description
on
IJDAttribute vb/c Visual Basic® Interface used to manipulate an attribute
IJDAttribute
This interface is used to manipulate the value of an attribute.
This interface inherits from IDispatch.

186  

When To Use
Call this interface when you want to:
Access the value of an attribute.
Get the metadata about an attribute.

Properties
Value ( ) as Variant
Description:
Descripti on: Allows you to get or set the value of an attribute. The method using this property is the
generic way to access the value of an attribute. It is not responsible to check and see if
the caller is allowed to write in this field. If one uses put_Value with Val.vt =
VT_NULL or VT_EMPTY, the attribute is removed from the database. For
Hierarchical Code Lists, if one uses put_Value with val.vt = VT_BSTR (implying that
the ShortString value has been passed), it is automatically converted to the ValueID
(val.vt = VT_I4). If one uses get_Value on a removed attribute, the returned variant
will have its vt flag set to VT_EMPTY. This confusion of the VT_EMPTY and
VT_NULL flag allows us to save database space. See the Specific Types Definition
Definition  
below for the definitions.
Modifiability: Read/Write
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

AttributeInfo ( ) as IJDAttributeInfo
Description:
Descripti on: Returns the IJDAttributeInfo
IJDAttributeInfo interface
 interface of an AttributeInfo object
AttributeInfo object for this attribute.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

Specific Types Definition

Enum tagSQLTypes
SQL_VB_CHAR = 1 // CHAR, VARCHAR, DECIMAL, NUMERIC = VT_BSTR =
SQL_C_CHAR = SQL_CHAR
SQL_VB_LONG = 4 // long int = VT_I4 = SQL_C_LONG = SQL_INTEGER
SQL_VB_SHORT = 5 // shrt int = VT_I2 = SQL_C_SHORT = SQL_SMALLINT
SQL_VB_FLOAT = 7 // float = VT_R4 = SQL_C_FLOAT = SQL_REAL
SQL_VB_DOUBLE = 8 // double = VT_R8 = SQL_C_DOUBLE = SQL_DOUBLE
SQL_VB_BIT = -7 // boolean = VT_BOOL = SQL_C_BIT
SQL_VB_DATE = 9 // date = VT_DATE = SQL_C_DATE
End Enum
Note about tagSQLTypes : The type of the attribute is defined in the METADATALib in terms of SQL_C_Types.
The value of an attribute is a VARIANT. We use the correspondence table above. If the type of the VARIANT does
not match the VT type, we try to coerce it using MS API VariantChangeType. If the attribute is hard coded, the
coercion is done by the MS API invoke.

IJDCodeListMetaData
This interface is used to access the codelist metadata and is exported in the COM map of the business object that
aggregates the attribute helper. The method calls are delegated to the POM.
This interface inherits from IDispatch.
When To Use
Call this interface when you want to access the metadata about a codelist.

187  

Properties

ShortStringValue ( byval TableName as String , byval ValueID as Long ) as String


Description:
Descripti on: Gets the short string of a codelist.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either
PackageName:TableName) or justNamespace:TableNa
Namespace:TableName
TableName. When me (i.e.,
there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
[in] ValueID Index of the codelist in the table.
Return error codes:
S_OK Operation succeeded, ShortString returned.
S_FALSE Operation succeeded, no ShortString returned.
E_FAIL (1) No TableName is provided; (2) Duplicated TableNames are found in Metadata
database (need Namespce); (3) Operation failed for other reasons.
Note: This API returns S_FALSE if the CodelistTable does not exist or the CodelistTable
does not have ValueID as its value.

LongStringValue ( byval TableName as String , byval ValueID as Long ) as String


Description:
Descripti on: Gets the long text string of a codelist.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableName
me (i.e.,
PackageName:TableName) or just TableName. When there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
[in] ValueID Index of the codelist in the table.
Return error codes:
S_OK Operation succeeded, longString returned.
S_FALSE Operation succeeded, no longString returned.
E_FAIL (1) No TableName is provided; (2) Duplicated TableNames are found in Metadata
database (need Namespce); (3) Operation failed for other reasons.
Note: This API returns S_FALSE if the CodelistTable does not exist or the CodelistTable
does not have ValueID as its value.

ParentValueID ( byval TableName as String , byval ValueID as Long ) as Long


Description:
Descripti on: Gets the ParentValueID of a codelist. Returns -1 in case a valid ValueID does not have
a ParentValueID.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableName
me (i.e.,
PackageName:TableName) or just TableName. When there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
[in] ValueID Index of the codelist in the table.
Return error codes:
S_OK Operation succeeded, ParentValueID returned.
S_FALSE Operation succeeded, no ParentValueID returned.
E_FAIL (1) No TableName is provided; (2) Duplicated TableNames are found in Metadata
database (need Namespce); (3) Operation failed for other reasons.
Note: This API returns S_FALSE if the CodelistTable does not exist or the CodelistTable
does not have ValueID as its value.

CodelistValueCollection ( byval TableName as String ) as IJDInfosCol


Description:
Descripti on: Returns (pEnumCodeList as RetVal) the IJDInfosCol interface of the first item of the
collection of tables. The IJDInfosCol is a collection of IJDCodelistValue.
Modifiability: Read Only
Parameters:

188 

[in] TableName Name of the table. Can be either Namespace:TableNa


Namespace:TableNameme (i.e.,
PackageName:TableName) or just TableName. When there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
Return error codes:
S_OK Operation succeeded.
E_INVALIDARG No TableName provided.
E_FAIL (1) Duplicated TableNames are found in Metadata database (need Namespce); (2)
Operation failed for other reasons.
Note: This API returns a codelist value collection cotaining "Unidentified" if a non-existing
Codelist table name is passed in.

ChildValueCollection ( byval TableName as String , byval ValueID as Long ) as IJDInfosCol


Description:
Descripti on: Returns (pEnumCodeList as RetVal) the IJDInfosCol interface of the first item of the
collection of tables associated with a specific ValueID. The IJDInfosCol
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableNameme (i.e.,
PackageName:TableName) or just TableName. When there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
[in] ValueID Index of the codelist in the table.
Return error codes:
S_OK Operation succeeded.
S_FALSE TableName does not have a ChildTable.
E_FAIL (1) TableName has duplicates in Metadata; (2) Operation failed for other reasons (no
detail).

ParentTable ( byval TableName as String ) as String


Description:
Descripti on: Gets ParentTable name of a given a codelist table.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableName
me (i.e.,
PackageName:TableName) or just TableName. When there are two tables
with same name in different packages and no namespace is specified, an error
will be returned.
Return error codes:
S_OK Operation succeeded, ParentTable returned.
S_FALSE Operation succeeded, no ParentTable returned.
E_CL_TABLENAMEDUPLICATED TableName has duplicates in Metadata database.
E_FAIL More than one ParentTable name is found (require namespace); Operation
failed (no detail).

ChildTable ( byval TableName as String ) as String


Description:
Descripti on: Gets ChildTable name of a given a codelist table.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableName
me (i.e.,
PackageName:TableName) or just TableName. When there are two tables
with same name in different packages and no namespace is specified, an error
will be returned.
Return error codes:
S_OK Operation succeeded, ChildTable returned.
S_FALSE Operation succeeded, no ChildTable returned.
E_CL_TABLENAMEDUPLICATED TableName has duplicates in Metadata database.
E_FAIL More than one ChildTable name is found (require namespace);
namespace) ; Operation
failed (no detail).

189 

TableDescription ( byval TableName as String ) as String


Description:
Descripti on: Gets the description of the codelist table.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableName
me (i.e.,
PackageName:TableName) or just TableName. When there are two tables
with same name in different packages and no namespace is specified, an error
will be returned.
Return error codes:
S_OK Operation succeeded, TableDescri
TableDescription
ption returned.
S_FALSE Operation succeeded, no TableDescripti
TableDescription
on returned.
E_CL_TABLENAMEDUPLICATED TableName has duplicates in Metadata database.
E_FAIL More than one ChildTable name is found (require namespace);
namespace) ; Operation
failed (no detail).

TableCollection ( ) as Unknown
Description:
Descripti on: Returns (pEnumCodeList as RetVal) the IUnknown interface of the first item of the
collection of tables. Gets an enumerated collection of CodeList tables.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).
Note: This API returns S_OK no matter if a TableCollection is reurned or not.

ValueIDByShortString ( byval TableName as String , byval ShortStringValue as String ) as Long


Description:
Descripti on: Returns the ValueID of a codelist entry given the codelist TableName and the
ShortStringValue of the entry.
Modifiability: Read Only
Parameters:
[in] TableName Name of the table. Can be either Namespace:TableNa
Namespace:TableNameme (i.e.,
PackageName:TableName) or just TableName. When there are two tables with same
name in different packages and no namespace is specified, an error will be returned.
[in] ShortStringValue The short string value of a codelist.
Return error codes:
S_OK Operation succeeded, ValueId returned.
S_FALSE Operation succeeded, no ValueId returned.
E_INVALIDARG No TableName or ShortString is provided.
E_FAIL More than one TableName is found in Metadata database (require namespace);
Operation failed (no detail).
190 

Relation Helper service


DRelationHelper

In the MS repository model of relationships, the Automation object CollectionHelper can be retrieved from any
component that is relationships-enabled by getting the CollectionRelations property of the interface that the
relationship is established to.

References
Object Library: Ingr SmartPlant 3D Relation 1.0 Type Library

Interfaces

Interface Name lang Descripti


Description
on
IJDAssocRelation
IJDAssocRelat ion vb/c Visual Basic® Interface used to access a CollectionOfRelations
CollectionOfRelat ions property.
IJDTargetObjectCol
IJDTargetObjectC ol vb/c Dual interface to manipulate the collection of target objects.
IJDRelationshipCol
IJDRelationshi pCol vb/c Dual interface to manipulate the collection of relati
relationships.
onships.

IJDAssocRelation
This interface accesses the Collection of Relations in which a business object participates. It should be implemented
by any business object that is relationship-enabled.
The relationship types are defined between interfaces of the two participant objects, and that relationships are
gathered per homogenous collections. The Core uses this alternative accessor as an interface on the business object
where both the interface and the property are input arguments when asking for the collection. This interface inherits
from IDispatch.

When To Use
Call this interface when you want to access a collection of relationships on a business object.

Properties

CollectionRelations ( byval InterfaceID as Variant , byval CollectionName as String ) as Object


Description:
Descripti on: Returns the IDispatch interface of the Collection of relati
relationships.
onships. This collection should
implement the interfaces IJDRelationshipCol and IJDTargetObjectCol. If using the
provided RelationHelper Object, the returned object is of the type CollectionHelper
Object.
Modifiability: Read Only
Parameters:
[in] InterfaceID IID that the collection is associated to. This variant contains a string with the formatted
hexa value of the IID : "{24E1A26B-1275-11d2-A684-00A0C96F81B9}" or with the
interface name IID : "IJGeometry", or a GUID structure.
[in] CollectionName Name of the collection.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

IJDRelationshipCol
This is one of the two basic interfaces that collections of relationships should implement.
This interface inherits from IDispatch.

When To Use
Use this interface to manage the relationships that belong to a particular relationship collection. This includes the set
of relationships that:
Is of the same type.
Is attached to a particular source object.

191 

Have objects playing the same role, have the same origin, or the same destination in the relationship.
With this interface, you can:
Get a count of the number of relationships in the collection.
Add and remove relationships to and from the collection.
If the collection is sequenced (which requires it to be an origin collection), place a relationship in a specific spot in
the collection sequence or modify the sequencing of the collection.
Retrieve a specific relationship from the collection.
Obtain information about the collection and the relation to which it is associated.

Methods

Add ( byval TargetObject as Unknown , byval Name as String ) as IJDRelationship


Description:
Descripti on: Adds a relati
relationship
onship between the source object containing this collection
of relationships and the given target object. Returns the
IJDRelationship interface (CreatedRelationship) of the created
relationship. If the business object is aggregating a RelationHelper
Object, this object is a RelationshipHelper Object. Following the
Repository API, if the relationship is of the ordered type, the added
relationship is always added at the end of the existing ones.
Parameters:
[in] TargetObject Target Object to be connected.
[in] Name Name of the relation
relationship.
ship. This requires the relati
relation
on to support naming.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).
E_OBJECTS_NOT_WITHIN_SAME_DB The error is returned when DBCo DBContainment
ntainment flag on relati
relation
on metadata is
WITHIN_DB and a relation is being created between objects belonging
to different databases.

Insert ( byval TargetObject as Unknown , byval Index as Long , byval Name as String ) as IJDRelationship
Description:
Descripti on: Adds a relati
relationship
onship between the source object containing this collection of relati
relationships
onships
and the given target object. Returns the IJDRelationship interface (CreatedRelationship)
of the inserted relationship. If the business object is aggregating a RelationHelper
Object, this object is a RelationshipHelper Object. This method can only be used when
the origin side of the relation supports ordering.
Parameters:
[in] TargetObject Target object to be connected.
[in] Index Index of the new relationship.
relati onship.
[in] Name Name of the relati
relationship.
onship.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

IsSourceOrigin ( )
Description:
Descripti on: Returns if the source (i.e., the object that the collection has been retrieved from) is the
origin of the relationships contained by the collection.
Return error codes:
S_OK Source is origin in the relationships.
relati onships.
S_FALSE Source is destination in the relationships.

Remove ( byval TargetItem as Variant )


Description:
Descripti on: Remove a relati
relationship.
onship.
Parameters:
[in] TargetItem Identifies the Relationship to be removed by an index of type long or by a string
(BSTR) when the relation supports unique naming and requires the collection to be the
origin of the relation.

192 

Return error codes:


S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

Move ( byval oldIndex as Long , byval newIndex as Long )


Description:
Descripti on: Move a relati
relationship
onship in a sequenced origin colelction.
Parameters:
[in] oldIndex Identifies the relati
relationship
onship to be moved by it's index.
[in] newIndex Identifies the index to which the relation should be moved.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

Refresh ( )
Description:
Descripti on: Refresh the collection with the current data from the database.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).
Note: That method refresh
refreshss only a non associati
associative
ve collection. The method does nothing for an
associative relation.

Properties

Count ( ) as Long
Description:
Descripti on: Returns the count of relation
relationships.
ships.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Infos ( InterfaceID as Variant , pCollectionName as String )


Description:
Descripti on: Returns the name of the collection and the interface that the collection is associated to.
Modifiability: Read Only
Parameters:
[out] InterfaceID The IID of the interface with which the collection is associated.
[out] pCollectionName The name of the collection.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Item ( byval TargetItem as Variant ) as IJDRelationship


Description:
Descripti on: Returns the IJDRelationship interface of an object describing the requested relationship.
If using the provided helpers, this object is a RelationshipHelper.
Modifiability: Read Only
Parameters:
[in] TargetItem Either the name or the index.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).
Note: The TargetItem value identifies the relati
relationship
onship to be returned by a string (BSTR) when
the relation supports unique naming and requires the collection to be origin of the
relation or by an index of type long.
ItemByKey ( byval Key as String ) as IJDRelationship
Description:
Descripti on: Returns the IJDRelationship interface of an object describing the requested relationship.
If using the provided helpers, this object is a RelationshipHelper.

193 

Modifiability: Read Only


Parameters:
[in] Key The relati
relation
on key relati
relative
ve to the origin collection.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).
Note: This property requires the collection to be the origin of the relation.
Source ( ) as Unknown
Description:
Descripti on: Returns the IUnknown interface of the source object. This is the object that the
collection of relationships is associated to.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Type ( ) as Variant
Description:
Descripti on: Returns the GUID identifying the relation
relati on to which the current collection is associated.
Then the interface IJRelationMetaData on the source of the collection permits access to
the complete meta-data information of this relation type.
Modifiability: Read Only

Return error codes:


S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

IJDTargetObjectCol

This is one of the two basic interfaces that collections of relationships should implement.
With this interface, you can:

Get a count of the number of destinations in the collection.


Add and remove relationships to and from the collection.
If the collection is sequenced (which requires it to be an origin collection), place a relationship in a specific spot in
the collection sequence, or modify the sequencing of the collection.
Retrieve a specific relationship from the collection.
Obtain information about the collection and the relation with which it is associated.

This interface inherits from IDispatch.

When To Use

Use this interface to manage the objects that are the destination of a particular relationship collection. This is the set
of objects that are related to the source object (from which the current collection has been retrieved) by
relationships:
of the same type.
attached to this particular source object.
where the objects in the relationship play the same role, origin, or destination.

Methods

Add ( byval TargetObject as Unknown , byval Name as String , byval CreatedRelationship as IJDRelationship )
Description:
Descripti on: Adds a relati
relationship
onship between the source object containing this collection
of relationships and the given target object. Following the Repository
API, if the relationship is of the ordered type, the added relationship is
always added at the end of the existing ones.
Parameters:

194 

[in] TargetObject Target Object to be connected.


[in] Name Name of the relation
relationship.
ship.
[in] CreatedRelationship
CreatedRelat ionship Pointer to the created relationship. If the business object is aggregating
a RelationHelper , this object is a RelationshipHelper.
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).
E_OBJECTS_NOT_WITHIN_SAME_DB The error is returned when DBCo
DBContainment
ntainment flag on relati
relation
on metadata is
WITHIN_DB and a relation is being created between objects belonging
to different databases.

Insert ( byval TargetObject as Unknown , byval Index as Long , byval Name as String , byval CreatedRelationship
as IJDRelationship )
Description:
Descripti on: Adds a relati
relationship
onship between the source object containing this collection of
relationships and the given target object. This method could only be used when the
origin side of the relationship supports ordering.
Parameters:
[in] TargetObject Target object to be connected.
[in] Index Index of the new relationship.
relati onship.
[in] Name Name of the relati
relationship.
onship.
[in] CreatedRelationship
CreatedRelat ionship Pointer to the created relationship. If the business object is aggregating a

Return error codes: RelationHelper, this object is a RelationshipHelper.


S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

IsSourceOrigin ( )
Description:
Descripti on: Returns if the source (i.e., the object that the collection has been retrieved from) is the
origin of the relationships contained by the collection.
Return error codes:
S_OK Source is origin in the relationships.
relati onships.
S_FALSE Source is destination in the relationships.

Move ( byval ActualIndex as Long , byval NewIndex as Long )


Description:
Descripti on: Moves the relati
relationship
onship to another location (for sequenced relati
relations).
ons).
Parameters:
[in] ActualIndex The index before the move where it actually is.
[in] NewIndex The index to move it to.
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Remove ( byval TargetItem as Variant )


Description:
Descripti on: Removes a relati
relationship.
onship.
Parameters:
[in] TargetItem Identifies the Relationship to be removed by: - a string (BSTR) when the relati
relation
on
supports unique naming (requiring the collection to be the origin of the relation). - an
index (long).
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).
EnumTargetMoniker ( byval ppEnumMoniker as LPENUMMONIKER * )
Description:
Descripti on: Enumerates monikers of target objects.
Parameters:
[in] ppEnumMoniker Enumerates monikers of target objects. This enumeration will be sometimes useful in

195 

avoiding binding all target objects. This enumeration can be used in VB also (see code
example below).
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Properties
Count ( ) as Long
Description:
Descripti on: Returns the count of target entities.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
S_FAIL Operation failed (no detail).

Infos ( byval InterfaceID as Variant ) as String


Description:
Descripti on: Returns the name of the collection and the interface that the collection is associated to.
Modifiability: Read Only
Parameters:
[in] InterfaceID The InterfaceID value passed out is the IID of the interface with which the collection is
associated.

Return
S_OK error codes: Operation succeeded.
S_FAIL Operation failed (no detail).

Item ( byval TargetItem as Variant ) as Unknown


Description:
Descripti on: Returns the IUnknown interface of a target object.
Modifiability: Read Only
Parameters:
[in] TargetItem TargetItem value passed in identifies the Relationship to be removed by: - a string
(BSTR) when the relation supports unique naming (requiring the collection to be the
origin of the relation). - an index (long).
Return error codes:
S_OK Operation succeeded.
E_ACCESSDENIED Access to the target is denied.
E_FAIL Operation failed (no detail).

Source ( ) as Unknown
Description:
Descripti on: Returns the IUnknown interface of the source object.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).

Type ( ) as Variant
Description:
Descripti on: Returns the GUID identifying the relationship
relati onship with which the current collection is
associated. Then use the interface IJRelationMetaData on the source of the collection
to have access to the complete metadata information of this relation type.
Modifiability: Read Only
Return error codes:
S_OK Operation succeeded.
E_FAIL Operation failed (no detail).
196  

SP3D References Tool


The software consists of hundreds of type libraries that provide the programmatic interfaces to
the data model and its underlying data. These libraries consist of the data model's interfaces and

their methods and properties.


The ability to integrate user-definable components into the environment is a key capability of the
software. The mechanism of creating custom commands provides this extensibility.
To reference the available type libraries in Visual Basic:
•  Click Project > References.
To perform the task of referencing your type libraries more quickly and efficiently:
•  Click Project > SP3D References.

Using the SP3D References Tool


The SP3D References tool is a very useful utility that you can use to locate and reference type
libraries quickly and easily. You only need to know the name of your class object or variable in
which to perform a search.

1.  Open Visual Basic.


2.  Click Add-Ins > Add-In Manager....
3.  Select SP3D References and make sure that the Loaded/Unloaded and Load on
Startup boxes under Load Behavior are both checked.
4.  Click OK.
5.  Click Project > SP3D References to invoke the dialog.

6.  Enter a class or variable name to search..


7.  Click Find.
8.  Check the appropriate type libraries.

197  

Note: If this is the first time that you have invoked the tool, it begins reading your system to
generate a data file that contains information about all existing registered type libraries.
198 

Debugging Your Code

No matter how carefully you create your code, errors can occur. To handle these errors, you need
to add error-handling code to your procedures.

You perform
Visual the process
Basic provides of locating
several tools toand fixing
help bugshow
analyze in applications by debugging
your application operates. the code.
These
debugging tools are useful in locating the source of bugs, but you can also use the tools to
experiment with changes to your application or to learn how other applications work.

Note: You must add the TaskHost project to the integrated development environment (IDE)
before you can debug your Visual Basic project.

Before you can use the TaskHost project, you must set new paths in your computer's
environment variables. Click Start -> Settings -> Control Panel -> System. Select the Advanced
tab and then click Environment Variables. Finally add the following path statements according to
the location in which you installed the software:

PATH=[Product Directory]\Core\Runtime; [Product Directory]\GeometryTopology\Runtime


Adding the TaskHost Project to your
yo ur Project

1.  Open your Visual Basic .vbp project to debug.


2.  Click File > Add Project.
3.  Select the Existing tab.
4.  Open SP3DTaskHost.vbp in the following path: ..\Debug\Container\Src\Host
5.  In the Project window, right-click over SP3DTaskHost and then select Set as Start Up.
6.  Right-click again on SP3DTaskHost and then select SP3DtaskHost Properties...
7.  On the Project Properties dialog, change the Project Type to Standard EXE.
8.  Set the breakpoint in your project to debug.
9.  Click Run and wait for processing to begin. Your Visual Basic project becomes active when
the breakpoint is reached.
10. Click to view <your project>, which returns you back to the code view. Then step through
your code.

Important

Do not stop the debug process by clicking the End command. If you end processing this way,
you will throw an exception, crash all the software that is running, and lose your changes.
To safely end processing, click File > Exit from the SmartPlant 3D TaskHost software.
199 

Creation of Cab Files

Introduction:

This document describes the step-by-step procedure for creating cab files

Procedure:

1.  Start the “Package & Deployment Wizard” Under Programs


Pr ograms ->Microsoft
->Microsoft Visual Basic 6.0 ->
Microsoft Visual Basic 6.0 Tools.
T ools.
Go to the “Select Project:” Click on the Browse button and navigate to the Symbol Project
folder. Select the .vbp file of the symbol project
Click on the Package Icon Button

2.  Next, select the “Package Type” as Internet Package.


Package. Click Next.
 200 

3.  Select the Package Folder. Select the symbol share folder. (The Cab file must be created in the
symbol share). Click Yes  if it asks if we want to create the folder. Click Next.
Yes if
 201 

4.  In the Missing Dependency Information dialog, do not check any of the dependency files. Click OK.

5.  Next, uncheck all the files except the symbol dll file.

6.  Next, let the File Source option be “Include in this cab”.
 202 

7.  Retain the Safety Settings indicated. Click Next.


8.  Click Finish. The cab file for the symbol gets built and a summary Report is displayed.

 203 

Hit close button.

You might also like