SP3DProgGuide08 2014
SP3DProgGuide08 2014
SP3DProgGuide08 2014
Programmers Guide
Version 2014R1
August 2014
DSP3D-PE-200039I
Copyright
Copyright 2009-2014 Intergraph Corporation . All Rights Reserved. Intergraph is part of Hexagon.
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 from Intergraph Corporation.
Portions of the user interface copyright 2012-2013 Telerik AD.
Documentation
Documentation shall mean, whether in electronic or printed form, Users Guides, Installation Guides, Reference
Guides, Administrators Guides, Customization Guides, Programmers Guides, Configuration Guides and Help
Guides delivered with a particular software product.
Other Documentation
Other Documentation shall mean, whether in electronic or printed form and delivered with software or on
eCustomer, SharePoint, or box.net, and documentation related to work processes, workflows, and best practices that
is provided by Intergraph as guidance for using a software product.
Terms of Use
a.
Use of software product and Documentation is subject to the End User License Agreement (EULA) delivered
with software product unless the Licensee has a valid signed license for this software product with Intergraph
Corporation. If the Licensee has a valid signed license for this software product with Intergraph Corporation,
the valid signed license shall take precedence and govern the use of this software product and Documentation.
Subject to the terms contained within the applicable license agreement, Intergraph Corporation gives Licensee
permission to print a reasonable number of copies of the Documentation as defined in the applicable license
agreement and delivered with the software product for Licensees internal, non-commercial use. The
Documentation may not be printed for resale or redistribution.
b.
For use of Documentation or Other Documentation where end user does not receive a EULA or does not have a
valid license agreement with Intergraph, Intergraph grants the Licensee a non-exclusive license to use the
Documentation or Other Documentation for Licensees internal non-commercial use. Intergraph Corporation
gives Licensee permission to print a reasonable number of copies of Other Documentation for Licensees
internal, non-commercial use. The Other Documentation may not be printed for resale or redistribution. This
license contained in this subsection b) may be terminated at any time and for any reason by Intergraph
Corporation by giving written notice to Licensee.
Disclaimer of Warranties
Except for any express warranties as may be stated in the EULA or separate license or separate terms and
conditions, Intergraph Corporation disclaims any and all express or implied warranties including, but not limited to
the implied warranties of merchantability and fitness for a particular purpose and nothing stated in, or implied by,
this document or its contents shall be considered or deemed a modification or amendment of such disclaimer.
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, Documentation and Other Documentation discussed in this document are furnished under a license
and may be used or copied only in accordance with the terms of this license. 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 their project work.
Limitation of Damages
IN NO EVENT WILL INTERGRAPH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED
TO, LOSS OF USE OR PRODUCTION, LOSS OF REVENUE OR PROFIT, LOSS OF DATA, OR CLAIMS OF
THIRD PARTIES, EVEN IF INTERGRAPH CORPORATION HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
UNDER NO CIRCUMSTANCES SHALL INTERGRAPH CORPORATION'S LIABILITY EXCEED THE
AMOUNT THAT INTERGRAPH CORPORATION HAS BEEN PAID BY LICENSEE UNDER THIS
AGREEMENT AT THE TIME THE CLAIM IS MADE. EXCEPT WHERE PROHIBITED BY APPLICABLE
LAW, NO CLAIM, REGARDLESS OF FORM, ARISING OUT OF OR IN CONNECTION WITH THE
SUBJECT MATTER OF THIS DOCUMENT MAY BE BROUGHT BY LICENSEE MORE THAN TWO (2)
YEARS AFTER THE EVENT GIVING RISE TO THE CAUSE OF ACTION HAS OCCURRED.
IF UNDER THE LAW RULED APPLICABLE ANY PART OF THIS SECTION IS INVALID, THEN
INTERGRAPH LIMITS ITS LIABILITY TO THE MAXIMUM EXTENT ALLOWED BY SAID LAW.
Export Controls
Intergraph Corporation's software products and any third-party Software Products obtained from Intergraph
Corporation, its subsidiaries, or distributors (including any Documentation, Other Documentation or technical data
related to these products) are subject to the export control laws and regulations of the United States. Diversion
contrary to U.S. law is prohibited. These Software Products, and the direct product thereof, must not be exported or
re-exported, directly or indirectly (including via remote access) under the following circumstances:
a.
To Cuba, Iran, North Korea, Sudan, or Syria, or any national of these countries.
b.
To any person or entity listed on any U.S. government denial list, including but not limited to, the U.S.
Department of Commerce Denied Persons, Entities, and Unverified lists, the U.S. Department of Treasury
Specially Designated Nationals List, and the U.S. Department of State Debarred List.
c.
To any entity when Licensee knows, or has reason to know, the end use of the Software Product is related to the
design, development, production, or use of missiles, chemical, biological, or nuclear weapons, or other unsafeguarded or sensitive nuclear uses.
d.
To any entity when Licensee knows, or has reason to know, that an illegal reshipment will take place.
Any questions regarding export or re-export of these Software Products should be addressed to Intergraph
Corporation's Export Compliance Department, Huntsville, Alabama 35894, USA.
Trademarks
Intergraph, the Intergraph logo, Intergraph Smart, PDS, SmartPlant, SmartMarine, FrameWorks, I-Sketch,
IntelliShip, ISOGEN, 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. MicroStation is a registered trademark
of Bentley Systems, Inc. Other brands and product names are trademarks of their respective owners.
Table of Contents
Table of Contents
Preface .................................................................................................................................7
Smart 3D Product Documentation ................................................................................8
Administrative Guides ........................................................................................................ 8
Table of Contents
Using ActiveX Components .......................................................................................35
Creating an Implementation .............................................................................................. 35
Table of Contents
IJDwgExternalModule ...................................................................................................... 78
IJDwgWrapperCompound ................................................................................................ 79
IJDwgWrapperPseudoFilter .............................................................................................. 79
Table of Contents
DefineNozzle Method ...............................................................................................169
DefinePlacePoint Method .........................................................................................170
DefinePoint Method..................................................................................................171
DrawArc Method ......................................................................................................172
DrawComplexSurface Method .................................................................................173
DrawLine Method .....................................................................................................174
InitializeGlobals Method ..........................................................................................174
MoveAlongAxis Method ..........................................................................................175
MoveToPlacePoint Method ......................................................................................175
NozzleDefineDirectionVector Method .....................................................................176
NozzleInitialize Method ...........................................................................................176
NozzlePlace Method .................................................................................................177
RotateOrientation Method ........................................................................................178
Using the Equipment Symbol Upgrade Wizard ..........................................................179
Introduction...............................................................................................................180
Before You Upgrade ....................................................................................................... 180
Register and Launch the Equipment Symbol Upgrade Wizard ...................................... 180
Log Files ......................................................................................................................... 181
Upgrade to the Equipment Component........................................................................... 181
Finish ........................................................................................................................188
Index ................................................................................................................................189
Preface
Preface
This document is a user's guide for programming and customization using Intergraph
Smart 3D and provides information about custom commands, naming rules, project
management, symbol programming, and drawings customization.
Preface
Administrative Guides
Intergraph Smart 3D Installation Guide - Provides instructions on installing and
configuring the software.
Project Manager Users Guide - Provides information about setting up permission
groups and specifications in the software.
Reference Data Guide - Provides instructions about the Bulkload utility and the
reference data common to several disciplines.
3D Symbols Reference Data Guide - Provides information about the threedimensional symbols used in all tasks.
Preface
Documentation Comments
Send documentation comments or suggestions to PPMdoc@intergraph.com.
Introduction
Introduction
The Intergraph Smart 3D Programmer's Guide provides introductory information to
developers who want to create custom commands or custom programs using special
tools and the software. Before creating commands or programs, you must be very
familiar with the software interactively and understand its basic concepts of projects,
engineering, architecture, concurrency, and datastores.
For more specific information about creating commands using the software
application programming interface (API), please contact Intergraph Services.
This programming guide includes:
Introduction
In the Debugging Your Code section are instructions for users to increase the stack size
for Visual Basic before debugging IFC rules.
Software Architecture
Software Architecture
The software has an architecture that is component-oriented and built on three tiers.
The software makes extensive use of the Microsoft Component Object Model, or
COM. The COM paradigm is deeply rooted in the idea of separating the interface of
an object from its data. Interface names, such as IUnknown, IDispatch, and so forth,
begin with the letter I by convention. Interfaces developed in the software always
begin with IJ, such as IJAppInfo. The J distinguishes interfaces from other sources
and reduces the risk of namespace collision.
Because the software is task-oriented, it uses one datastore. The datastore is the entity
that stores the data of the persistent business object instances. The term task-oriented
means that, rather than developers producing one large executable file or several
smaller ones, all the major functional subdivisions of the software are built as
separable COM objects. These "COMponents" are known as tasks. One datastore
means that all these separate tasks operate against a single underlying database.
Software Architecture
Three-Tier Architecture
The three-tier architecture of the software includes the client, middle, and server tiers.
These tiers separate the graphical user interface, or GUI, stored in the client tier, from
the business logic in the middle tier. The business logic is further separated from the
physical database in the server tier.
The architecture emphasizes programming ease in producing functionality for the
client tier. The client tier mainly consists of commands, plus some components,
ActiveX controls, and services.
Client Tier
The client tier's functionality is loaded on user demand in the form of tasks, services,
and commands.
The client tier contains the menus, toolbars, views, dialog boxes, and frames. In the
client tier, you can manipulate the GUI with services, such as the SelectSet and
GraphicViewMgr, and with software-supplied components, such as Locators,
Highlighters, and View manipulations.
A set of commands make up each task in the client tier. Eighty to ninety percent of
the code in a task is written in the form of a command or to support a command.
Each task has its own COMponent called the EnvironmentMgr and an associated
XML file. This XML file defines the look and feel for the task and specifies the
services that it uses.
Services and other components support the commands and tasks by providing a set of
commonly-used functionalities. Services should respond to task switches. When a
task starts or ends, services are notified of the event to initialize or to clean up.
A service implements one or more service-specific interfaces. Generally, a service
wraps a specific bit of re-usable functionality. A service exists as a singleton, which is
the one and only instance of its class.
A service can persist its state in a session file when the session file is saved. The
SessionMgr, a service, coordinates this activity. When a session is saved,
SessionMgr checks each service to see if it supports an interface for persistence. If
the service does support an interface for persistence, then this interface is called to
allow the service to save persistent information. When the SessionMgr loads a
session file, the reverse happens - the SessionMgr first creates the service; then, if the
service can persist, SessionMgr calls the service to restore saved information.
Software Architecture
For more information about session files, see the Managing Sessions: An Overview
section of the Common User's Guide.
A deck must maintain some minimum distance from the decks above and
below it.
Relationships are the software business rules. Relationships react to changes as they
take place, ensuring referential integrity and data consistency. Relationships and
business objects are closely tied to each other and the tasks that define and manipulate
them. A task or set of closely-related tasks defines business objects and relationships.
The RevisionMgr is a middle tier component that manages the associative
relationships between the objects and is the center of any engineering solution. This
service continuously keeps every entity consistent with all other data in the system.
This consistency is defined by the relationships of the entities.
The RevisionMgr works in cooperation with the business objects and relationships
by detecting changes to business objects. Using the relationships that business objects
are involved in, the RevisionMgr declares changes to any business objects defined as
outputs of the relationships. The RevisionMgr continues this promulgation until all
affected business objects are up-to-date.
The RevisionMgr notifies the TransactionMgr, a client tier service, after all
affected business objects have been modified. The TransactionMgr in turn notifies
any client tier services that are listening.
Server Tier
The server tier is made up of one or more physical datastores.
The server tier also provides storage for the metadata, which is contained in the
Repository. The Repository is the name of the location in which all the UML data is
saved. Metadata is the total description of all the classes, interfaces, relationships, and
semantics in the system.
Software Architecture
The RevisionMgr service in the middle tier accesses this metadata.
Getting Started
Getting Started
Before you begin customizing the software, you should be familiar with the
following:
Getting Started
MSDN Library
Printed Documentation
Hardcore Visual Basic, Microsoft Press. Also available from the MSDN
Library.
IFC Rules
Before debugging IFC post processor rules, you must increase the stack size by 4
megabytes for Visual Basic. The default value is only 1 megabyte, but IFC rules
require a minimum of 4 megabytes of stack memory.
Using the Command prompt, run the following command to increase the stack size:
$EDITBIN.exe /stack:4096000 /heap:65536 "[VB 6.0 Installation
folder]\VB98\VB6.EXE"; default: ($EDITBIN.exe /stack:4096000 /heap:65536
"C:\Program Files (86)\Microsoft Visual Studio\VB98\VB6.EXE").
Early Binding
A client program can access this information at design time by statically binding to
the ClassID of the classes in the type library. This process is called "early binding".
The ClassID is a unique name given to each object class at compile time, representing
the status of the exposed methods and properties on the binary level. A binarycompatible version of the type library retains the same ClassIDs, which indicates that
the binary footprint of all the methods and properties remains unchanged and
backward compatible.
Late Binding
If binary compatibility is not guaranteed, then the client program cannot statically
bind itself to the ClassID. Instead it must query the object at runtime to verify that it
continues to support the methods and properties required by the client. This
verification is called "late binding".
Command Priorities
Command Priorities
When a command is started, it is assigned a priority, and (if successfully started) a
command ID is returned. Note that commands do not possess an intrinsic priority.
They are assigned one by the task that starts them. Thus, it is possible to start the
same command with different priorities in two different tasks. However, you should
avoid this practice unless there is a valid reason for this kind of implementation.
The command ID can be stored for subsequent use by issuing
IJCommandManager2.StopCommand. Otherwise, it can be ignored.
The priority is used to determine the stacking that can be done in conjunction with the
command. If the command being started is given a higher priority than the currently
active command, and the current command is suspendable (stackable), then the
current command is (suspended) stacked. If the current command is not suspendable,
or if its priority is equal to or less than the command being started, the current
command is stopped.
There are three possible priority values: Low, Normal, and High.
Caution:
Normal priority commands can commit and abort transactions. They must
stop their transaction when they are stopped or when they fail (to leave the
system in a clean state).
Low priority commands can use transactions. They must stop their
transaction when they are stopped, suspended, or when they fail.
If these rules are not respected, a higher priority command could potentially terminate
a transaction opened by a stacked (lower priority) command. The stacked command,
upon being resumed, would be in a highly indeterminate state.
Error Handling
Error Handling
Trapping and resolving errors is one of those tasks that all developers must address. It
is important to remember several guidelines when you add code to your projects for
error handling.
Provide a unique name for each error handler label in a procedure that will
not conflict with any other element in the procedure.
You should code your class modules to handle every error that occurs within that
module. You should also try to handle errors in the module that arise in an object
being referenced elsewhere, when the errors are not being handled by that object.
Error Handling
To perform the task of referencing your type libraries more quickly and efficiently:
For more information on using the Speedy References tool in Visual Basic, see Using
the References Tool, page 28.
button.
The time your search requires depends on how many type libraries can be found
containing your information, but it usually takes only a few seconds.
I-> Result
If your search finds a match, it returns an output dialog consisting of columns that
contain the member name, the type library's complete file path and name, and the
type library description.
Check/uncheck to reference or not the typelib - Allows you to automatically
reference a type library. Being able to reference a type library here saves valuable
time otherwise spent searching using the Project > References command.
Member - The class or variable name to be located in a type library.
Typelib Filename - Complete file path and name.
Typelib Description - Matches the name that you can find in Available References,
when you click Project > References.
Click to display a popup menu that provides two options: Exact Search
and Update Data.
If you select the Project > Speedy References command, and it does not
display the utility, then the last screen position of the tool stored in the
Registry is out of the current screen resolution. To resolve this problem,
exit from all Visual Basic programs, and remove the following Registry
key:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Speedy
References
This Registry key will be re-created when you start Visual Basic 6 again.
Undo Functionality
The TransactionManager service in the software provides the ability to perform
undo functionality in addition to other kinds of transaction notifications such as
commit, abort, or compute.
When you develop a custom command that requires undo functionality, be sure to
include a string in your project that serves as the marker for undo capability.
'////////////////////////////////
'Example of undo
'////////////////////////////////
Dim strPlacePipe As String
oTransaction.Commit(strPlacePipe)
Naming Rules - Each task in the software that creates new parts in the
model automatically generates a name using defined rules. You can create
a custom name rule by creating a COM object that implements the
IJNameRule interface and adds the name rule to the catalog. For more
information, see Customizing Naming Rules, page 36
Creating an Implementation
Option Explicit
Implements <Abstract_Class_Name>
Implement your functions and properties of the abstract class in the new
class.
NameGeneratorService
NamingRulesHelper
CNameRuleAE
The following sections define the minimal set of references that a custom naming rule
needs to have referenced in the Visual Basic project.
The GSCADNameRuleSemantics component provides interfaces, methods, and
properties in which to generate object names automatically. Names for these objects
are composed of a base name, object type, and index. To begin using this component,
reference the Ingr Sp3d Generic NameRuleSemantics 1.0 Type Library,
NameRuleSemantics.dll, in your Visual Basic project.
The GSCADNameGenerator component provides interfaces, methods, and
properties in which to return names and indexes as appropriate. To begin using this
component, reference the Ingr Sp3d NameGenerator 1.0 Type Library,
NameGenerator.dll, in your Visual Basic project.
Important: When creating naming rules or using labels as weld identifiers for
isometric drawings, there must not be any spaces generated in the identifier.
Object
Interface
Methods/Properties
IJNameRule
GetNamingParents
ComputeName
CNameRuleAE
IJNameRuleAE
Frozen
NamingParentsString
NameGeneratorService IJNameCounter
GetCount
GetCountEx
IJDNamingRulesHelper AddNamingRelations
GetActiveNamingRule
GetEntityNamingRulesGivenName
GetEntityNamingRulesGivenProgID
IsGeneratedNameUnique
IJNameRule Interface
The IJNameRule interface supports the naming rule implementation for the
GSCADNameRuleSemantics component. The IJNameRule interface is
implemented as the actual naming rule.
The GetNamingParents and ComputeName methods of the IJNameRule interface
allow you to implement generation of object names automatically.
The IJNameRule interface, which implements the naming rule, contrasts with the
IJDNameRuleHolder interface, which holds the naming rule name.
ComputeName Method
Description
This method computes the name for the given entity.
Signature
Function ComputeName(pEntity, pParents, pActiveEntity)
Important: When creating naming rules or using labels as weld identifiers for
isometric drawings, there must not be any spaces generated in the identifier.
Parameters
Data Type
Description
pEntity
Object
pParents
IJElements
Object
GetNamingParents Method
Description
This method returns the naming parents from which the name should be derived.
Signature
Function GetNamingParents(pEntity) As IJElements
Parameters
Data Type
Description
pEntity
Object
CNameRuleAE Object
The CNameRuleAE object is the active entity for the name rule. An active entity
serves as the hub or management node for relationships in the software.
The relationship mechanism maintains data model consistency when entities are
modified, copied, or deleted. This mechanism maintains referential integrity when
entities are created, connected, or disconnected.
CNameRuleAE is a persistent object that has a relationship to the named object as
well as the naming parents. This object implements the IJNameRuleAE interface.
The CNameRuleAE object is created by the system and is passed to the Custom
Name Rule component.
IJNameRuleAE Interface
The IJNameRuleAE interface supports the naming rule implementation for the
GSCADNameRuleSemantics component.
This interface has two properties, Frozen and NamingParentsString.
Frozen Property
Description
This property returns whether the name of the object is frozen or not.
Signature
Frozen As Long
NamingParentsString Property
Description
This property returns the naming parents string, which contains the Base Name.
Signature
NamingParentsString As String
Important: When creating naming rules or using labels as weld identifiers for
isometric drawings, there must not be any spaces generated in the identifier.
Remarks
This string is returned after generating the name of an object. Then it is used with the
ComputeName method of the IJNameRule interface to decide whether there should
be a new index number created.
NameGeneratorService Object
The NameGeneratorService class supports the naming rule implementation for the
GSCADNameGenerator component.
This class is the middle tier service that implements the IJNameCounter interface.
IJNameCounter Interface
The IJNameCounter interface supports the naming rule implementation for the
GSCADNameGenerator component.
The GetCount, GetCountEx, and GetCountRange methods of the IJNameCounter
interface provide a counter based on the base name. The base name is translated into a
moniker and resolved in the database.
GetCount Method
Description
This method returns a new index number when the NamingParentsString property
of the IJNameRuleAE interface and the current base name are different.
Signature
Function GetCount(pResourceManager, strBaseName) As Long
Parameters
Data
Type
Description
pResourceManager
Unknown
strBaseName
String
Remarks
If the base name is found in the database, the counter is incremented by one. If not, a
new object is created and the count is returned as one.
GetCountEx Method
Description
This method returns the count and the location prefix.
This method returns a new index number when the NamingParentsString property
of the IJNameRuleAE interface and the current base name are different.
Signature
Function GetCountEx(pResourceManager, strBaseName, strLocation) As Long
Parameters
Data
Type
Description
pResourceManager
Unknown
strBaseName
String
strLocation
String
Remarks
If the base name is found in the database, the counter is incremented by one. If not, a
new object is created and the count is returned as one.
GetCountRange Method
Description
The GetCountRange method returns a unique index to a counter based on the base
name and an option to customize the user range.
This method is similar to the GetCountEx method except that the user range received
from the COM server can be customized. To reduce gaps between numbers, a lesser
value than ten (default) can be passed in for user range. If less than ten is entered,
more DCOM calls will be made to the COM server, which impacts performance.
Signature
Function GetCountRange(pResourceManager, strBaseName, strLocation,
userRange) As Long
Parameters
Data
Type
Description
pResourceManager
Unknown
strBaseName
String
strLocation
String
userRange
Long
Remarks
Error Codes
S_OK = operation succeeded
E_INVALIDARG = invalid argument passed in
E_UNEXPECTED = unexpected exception occurred during execution
NamingRulesHelper Object
The NamingRulesHelper object is the middle tier service that implements the
IJDNamingRulesHelper interface.
IJDNamingRulesHelper Interface
The IJDNamingRulesHelper interface is used by commands to associate a business
object to a name rule and to determine if a name is unique.
The GetEntityNamingRulesGivenName, GetEntityNamingRulesGivenProgID,
AddNamingRelations, GetActiveNamingRule, and IsGeneratedNameUnique
methods of the IJDNamingRulesHelper interface provide the ability for commands
to get naming rules, to add naming relations, and to get the active naming rule to be
used for naming the object.
The IsGeneratedNameUnique method is typically used by a custom name rule to
verify that the name is unique. It is typically only used when one of the methods on
the IJNameRuleCounter interface is not used to return a unique counter for a name.
The other methods listed are used by commands that are assigning a name rule to an
object or getting a list of name rules for a specific object type.
AddNamingRelations Method
Description
This method adds naming relations after creating the active entity and returns a
reference to the IJNameRuleAE 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.
Signature
Function AddNamingRelations(pDispEntity, pNameRuleHolder, pActiveEntity)
Parameters
Data Type
Description
pDispEntity
Object
pNameRuleHolder
IJDNameRuleHolder
pActiveEntity
IJNameRuleAE
GetActiveNamingRule Method
Description
This method returns a reference to the IJDNameRuleHolder interface of the active
naming rule that is being used for naming the input object. The pNameRuleHolder
argument returns nothing if there are no active naming rules on the object.
Signature
Function GetActiveNamingRule(pDispEntity, pNameRuleHolder)
Parameters
Data Type
Description
pDispEntity
Object
pNameRuleHolder
IJDNameRuleHolder
GetEntityNamingRulesGivenName Method
Description
This method returns a reference to the IJElements interface of the first object in a
collection of the naming rules. These rules are available in the Catalog database for
the given object name input.
Signature
Function GetEntityNamingRulesGivenName(strEntityName, NamingRules)
Important: When creating naming rules or using labels as weld identifiers for
isometric drawings, there must not be any spaces generated in the identifier.
Parameters
Data Type
Description
strEntityName
String
NamingRules
IJElements
GetEntityNamingRulesGivenProgID Method
Description
This method returns a reference to the IJElements interface of the first object in a
collection of the naming rules. These rules are available in the Catalog database for
the given class ProgID input.
Signature
Function GetEntityNamingRulesGivenProgID(strEntityProgID, NamingRules)
Parameters
Data Type
Description
strEntityProgID
String
NamingRules
IJElements
IsGeneratedNameUnique Method
Description
The IsGeneratedNameUnique method returns a Boolean specifying whether the
new name is unique in the domain specified by the given oFilter parameter. The
name is unique if the method returns True.
Signature
Function IsGeneratedNameUnique(oEntity, oFilter, strGenName, [strIID],
[strAttributeName]) As Boolean
Important: When creating naming rules or using labels as weld identifiers for
isometric drawings, there must not be any spaces generated in the identifier.
Parameters
Data Type
Description
oEntity
Object
oFilter
IJSimpleFilter
strGenName
String
strIID
String
strAttributeName
String
Remarks
This method is typically used by a custom name rule to verify that the name is
unique. It is typically only used when one of the methods on the
IJNameRuleCounter interface is not used to return a unique counter for a name.
Methods
IJHgrAutomation
CreateSupport
ModifySupport
IJHgrAutomation Interface
The IJHgrAutomation interface supports the creation and modification functionality
for the HgrSupProgAutoComp component.
The CreateSupport and ModifySupport methods of the IJHgrAutomation
interface allow you to create and modify support objects such as pipes, ducts, and
cable trays.
CreateSupport Method
CreateSupport Method Example, page 54
Description
This method creates the support object.
Signature
Function CreateSupport(eHgrDisciplineType, [oParent], [dblMaxLoad],
[oSupportedObjects], [oSupportingObjects], [oLocation], [bRule],
[oSupportAssembly], [strSupportName], [strSupportRuleName]) As Object
Parameters
Data Type
eHgrDisciplineType
oParent
Object
dblMaxLoad
Double
oSupportedObjects
Object
oSupportingObjects
Object
oLocation
Object
bRule
Boolean
oSupportAssembly
Object
strSupportName
String
strSupportRuleName String
Description
ModifySupport Method
Description
This method modifies the support object.
Signature
Function ModifySupport(oSupport, [oParent], [dblMaxLoad], [oSupportedObjects],
[oSupportingObjects], [oLocation], [bRule], [oSupportAssembly], [strSupportName],
[strSupportRuleName]) As Object
Parameters
Data Type
Description
oSupport
IJHgrSupport
oParent
Object
dblMaxLoad
Double
oSupportedObjects
Object
oSupportingObjects
Object
oLocation
Object
bRule
Boolean
oSupportAssembly
Object
strSupportName
String
strSupportRuleName
String
Methods
ProjectMgmtEntitiesFactory
AddLocation
AttachPDSProject
CreateProjectRoot
CreateModelDatabaseObject
CreateCatalogDatabaseObject
CreateFolder
CreatePermissionGroup
CreateAccessControlRule
CreateReportsDatabaseObject
CreateDBObject
GetNameGeneratorServerPath
GetPDSSite
ValidateNameServer
GetDisplayChildren
Parent
AddAccessControlRule
BackupPlantDatabases
RestorePlantDatabases
ProjectMgmtEntitiesFactory Object
The ProjectMgmtEntitiesFactory object provides the methods in which to create
objects such as Plant/Ship, Folder, Permission Group, Access Control Rule, and
so forth.
Before using the ProjectMgmtEntitiesFactory object, a connection to the data store
must be established. This connection is made by starting the services of the Session
Manager, Transaction Manager, and Command Manager.
To begin using this object, reference Ingr Sp3d ProjectMgmtEntities 1.0 Type
Library, ProjectMgmtEntities.dll, in the Visual Basic project.
'///////////////////////////////////////////////////
'// Example using ProjectMgmtEntitiesFactory object
'///////////////////////////////////////////////////////////////////
Dim oProjectMgmtEntitiesFactory As IJProjectMgmtEntitiesFactory
Set oProjectMgmtEntitiesFactory = New ProjectMgmtEntitiesFactory
AddLocation Method
Description
The method creates a Location object.
Signature
Function AddLocation(pResourceManager As Unknown) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
Remarks
You must define the project connection as the active connection on the WorkingSet.
AttachPDSProject Method
Description
This method references a PDS project (Model) to the selected model (Plant/Ship).
Signature
Function AttachPDSProject(pResourceManager, pIJDProjectRoot, pIJLocation,
PDSDBName) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pIJDProjectRoot
Unknown
pIJLocation
Location
PDSDBName
String
Remarks
You must set the permission group ID of the Project Root = active condition ID and
the project connection = active connection on the WorkingSet. There can be only one
PDS project attached (referenced) to a plant/ship.
CreateProjectRoot Method
Description
This method creates the Plant/Ship object.
Signature
Function CreateProjectRoot(pResourceManager, pIJLocation) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pIJLocation
Location
Remarks
You must define the project connection = active connection and the condition ID on
the WorkingSet = "8" (PROJMGMT_PERMISSIONID).
Error Codes
E_ACCESSDENIED = -2147024891
CreateModelDatabaseObject Method
Description
This method creates the Model database object.
Signature
Function CreateModelDatabaseObject(pResourceManager, pIJDProjectRootUnk,
pIJLocation, strDatabaseProviderType, schema, server, physDbName,
[bIsDatabaseInitialised]) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pIJDProjectRootUnk
Unknown
pIJLocation
Location
strDatabaseProviderType
String
schema
String
server
String
blsDatabaseInitialised
Boolean
Remarks
You must define the project connection = active connection on the WorkingSet.
Error Codes
lDISK_NO_SPACE = -2147216355
E_ACCESSDENIED = -2147024891
CreateCatalogDatabaseObject Method
Description
This method creates the Catalog database object.
Signature
Function CreateCatalogDatabaseObject(pResourceManager, pIJDProjectRoot,
pIJLocation, strDatabaseProviderType, physDbName, server,
strSchemaDatabaseName, strSchemaServerName) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pIJDProjectRoot
Unknown
pIJLocation
Location
strDatabaseProviderType
String
physDbName
String
server
String
strSchemaDatabaseName
String
strSchemaServerName
String
Remarks
You must define the project connection = active connection on the WorkingSet.
Error Codes
E_ACCESSDENIED = -2147024891
CreateFolder Method
Description
This method creates the Folder object.
Signature
Function CreateFolder(pResourceManager, pParentFolder) As Object
Parameters
Data
Type
Description
Unknown
pParentFolder
IJFolder
Remarks
You must define the active connection on the WorkingSet as follows:
The condition ID of the plant or catalog under which the folder is created should be
set as the active condition ID on the WorkingSet.
If the folder is created under another folder, the Input folder parent object should be
set = "Nothing".
Error Codes
E_INVALIDHIERARCHY = -2147220224
E_ACCESSDENIED = -2147024891
CreatePermissionGroup Method
Description
This method creates the Permission Group object.
Signature
Function CreatePermissionGroup(pResourceManager, pFolder, pIJLocation) As
Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pFolder
IJFolder
pIJLocation
Location
Remarks
The condition ID of the plant/ship or catalog under which the folder is created should
be set as the active condition ID on the WorkingSet.
You must define the project connection = active connection on the WorkingSet.
Error Codes
E_INVALIDHIERARCHY = -2147220224
E_ACCESSDENIED = -2147024891
CreateAccessControlRule Method
Description
This method creates the Access Control Rule object.
Signature
Function CreateAccessControlRule(pResourceManager) As Object
Parameters
Data
Type
Description
pResourceManager
Unknown
Remarks
You must define the active connection on the WorkingSet as follows:
Note: Default permissions should be defined after the Access Control Rule objects
are created for the Plant/Ship or Catalog. There should be at least one user defined
with "Full Control".
CreateReportsDatabaseObject Method
Description
This method creates the Reports database object.
Signature
Function CreateReportsDatabaseObject(pResourceManager, pIJDProjectRoot,
pIJLocation, ReportDbName, DatabaseServer, SchemaName, SchemaServer) As
Object
Parameters
Data
Type
Description
pResourceManager
Unknown
pIJDProjectRoot
Unknown
pIJLocation
Location
ReportDbName
String
DatabaseServer
String
SchemaName
String
SchemaServer
String
Remarks
You must define the project connection = active connection on the WorkingSet.
Error Codes
lDISK_NO_SPACE = -2147216355
E_ACCESSDENIED = -2147024891
IJHierarchy Interface
In addition to creating objects, GetDisplayChildren and GetParent methods of the
IJHierarchy interface allow you to return the collection of plant objects and, given a plant
object, to traverse the project folders and permission groups.
The classes that implement the IJHierarchy interface are ProjectCollection, ProjectRoot,
Database, Folder and PermissionGroup classes respectively.
'/////////////////////////////////////////////////////////////////////////
'// Example using methods of IJHierarchy and the ProjectCollection object.
'// Similarly, use the GetParent method to return the parent.
'///////////////////////////////////////////////////////////////////////
Dim oProjectsColl as IJProjectsCollection
Set oProjectsColl = oProjMgmtfactory. GetProjectsCollectionObject _
(oConnection.ResourceManager)
Dim oHierarchy As IJHierarchy
Set oHierarchy = oProjectsColl
Dim oChildren as IJDObjectCollection
Set oChildren = oHierarchy.GetDisplayChildren(oConnection.ResourceManager)
GetDisplayChildren Method
Description
This method returns the children of the object.
Signature
Function GetDisplayChildren(pResourceManager) As IJDObjectCollection
Parameters
Data
Type
Description
pResourceManager
Unknown
Remarks
You must input the connection resource managers as follows:
Project Collection
Project Root
Catalog Database
Folder
Permission Group
Parent Property
Description
This property returns the parent of the object.
Signature
Parent As Object
IJAccessRuleHelper Interface
The IJAccessRuleHelper interface provides the means for access control rules to be
added.
AddAccessControlRule Method
Description
The method returns the access control rule as IJAccessControlRule.
Signature
Function AddAccessControlRule(pResourceManager As Unknown, strUserName
As String, strAccessRight As String, [IsCurrentUser As Boolean = False]) As
IJAccessControlRule
Parameters
Data
Type
Description
pResourceManager
Unknown
strUserName
String
strAccessRight
String
IsCurrentUser
Boolean
IJBackupRestoreHelper Interface
Backup and restore functionality for Project Management is exposed on the interface
IJBackupRestoreHelper, accessed by referencing the ProjectMgmtEntities.dll type
library.
Validation and Error Handling
Any errors or problems during backup and restore will be written to a log file.
All inputs will be validated. If there are invalid inputs, the error values will be either
E_INVALID_BACKUPUINPUT (-2147219456)
or E_INVALID_RESTOREUNINPUT (-2147219455), including a description.
Other problems, such as errors in deleting log files where backup configuration files
exist with the same names at the specified location, can occur with an error value of
E_FILEACCESSERROR (=75).
BackupPlantDatabases Method
Description
This method will backup specified databases.
Note: The site database and site server name entries need to be updated in the
Registry.
Signature
Function BackupPlantDatabases(ppastrPlantNames(), strServerName,
strDatabaseFileLocation, strBCFFileLocation, strLogFileLocation)
Parameters
Data
Type
Description
ppastrPlantNames()
String
strServerName
String
strDatabaseFileLocation
String
strBCFFileLocation
String
strLogFileLocation
String
BackupRestoreErrorConstants
E_INVALID_BACKUPUINPUT
E_INVALID_RESTOREUINPUT
'//////////////////////////////////////////////////////////////////////
'// Example using BackupPlantDatabases method of IJBackupRestoreHelper.
'//////////////////////////////////////////////////////////////////////
Dim oBackupRestoreHelper As IJBackupRestoreHelperDim arrPlantNames() As
StringDim iArrayIndex As IntegerSet oBackupRestoreHelper = New
BackupRestoreHelperIArrayIndex = 0ReDim Preserve arrPlantNames(0 To
iArrayIndex) As StringarrPlantNames (iArrayIndex) = "rlakkaraPlant"
Call oBackupRestoreHelper. BackupPlantDatabases (arrPlantNames (),
RestorePlantDatabases Method
Description
This method can restore the databases of only plant at a time. You can restore the
catalog & model databases at the same time or individually depending upon the
ProjectManagementRestoreOptions definition.
Signature
Function RestorePlantDatabases(strCatalogServerName,
strCatalogDBDataFileLocation, strCatalogDBLogFileLocation,
strModelServerName, strModelDBDataFileLocation, strModelDBLogFileLocation,
strSymbolFileLocation, eRestoreOption)
Parameters
Data Type
Description
strPlantName
String
Required.
Name of the
plant name
whose model
and catalog
databases
need to be
restored.
strDatabaseFileLocation
String
Required.
Location of
the backup
.dat files
from which
the databases
are restored.
strBCFFileLocation
String
Required.
Backup
configuratio
n file name
and location.
String
Required.
Log file
name and
location. If
the log file is
sent as an
empty string,
it will be
generated
internally.
strCatalogServerName
String
Required.
Catalog
server name.
strCatalogDBDataFileLocatio
n
String
Required.
Catalog
database
.mdf file
location.
strCatalogDBLogFileLocation
String
Required.
Catalog
database .ldf
file location.
strModelServerName
String
Required.
Model server
name.
strModelDBDataFileLocation
String
Required.
Model
database
.mdf file
location.
strModelDBLogFileLocation
String
Required.
Model
database ,ldf
file location.
strSymbolFileLocation
String
Required.
Symbol files
folder
location.
eRestoreOption
ProjectManagementRestoreOption
s
Required.
Restore
options.
Customizing Drawings
Annotations are generated in the software by applying a set of annotation templates
against a set of 3D objects.
Drawings Package Versioning describes the new versioning attribute.
Graphic Wrapper Modules can be used to assist in processing by determining what
should be processed, and how the object should be processed by the drawings
generation process.
The Drawings Label and Dimensions XML Reference provides information to
developers who want to customize automatic dimensioning rules or labels and
generate reports.
Package Versioning
A Drawings Package is an XML file that contains data about a snap-in drawing or a
hierarchy of snap-ins. The package contains information that allows the software to
create the same type of objects and set properties from the time the package was
saved.
As Drawings Packages evolve, it is important to know the software version in which
they were created. This means that you are alerted to whether the data in the packages
needs to be modified to support a different version of software from which it was
created.
Packages are currently stored on the symbol share. You might restore a copy of
packages from another location containing data in an old format after migration has
occurred. The <package version=" "> attribute assists detection of old file formatting.
In the following example, the version attribute means that the package was created
with the v7.0 software of that it was migrated to the v7.0 schema.
<?xml version="1.0" encoding="utf-8"?>
<package version=7.0.0.0>
<snapin clsid="{AF2EE992-B592-11D4-8B30-0050DA23CBE0}"/>
<pkginfo foldername="Folder">
<progid progid="DataForPackages.cSnapInPackageData">
<name id="genericname"/>
<description id="genericdescription"/>
<tab id="generaltab"/>
<icon id="generic"/>
</progid>
<categories>
<type><![CDATA[folder]]></type>
<type><![CDATA[all]]></type>
</categories>
</pkginfo>
</package>
Note: All existing packages need to be modified to contain the version attribute. For
packages created in v6.1 of the software to be delivered for v7.0, this attribute will
need to be added manually.
Children
When creating a graphic wrapper, you should consider whether it has any children. A
graphic wrapper without children simply encapsulates the original object, changing
some (graphic) property. A graphic wrapper with children is usually used to separate
an object into individual components. In the latter case, there can be several extra
objects, to which you can apply separate view styles.
Requirements
A Graphic Wrapper Module must implement IJDwgExternalModule interface.
Other interfaces that can be included are IJDwgWrapperCompound,
IJDwgWrapperPseudoFilter, IJGraphicEntity, or IJGraphicCompound.
All delivered modules are located in the bin directory of the following path on your
system: ..\Drawings\Symbols\DrawingsWrappers\bin. See the "Use Cases" section
for information about using these DLLs.
During software installation, all symbols are located under the top-level \CatalogData
directory. This directory serves as the symbols share for the model. Symbols must be
in a common folder so that the View Style Manager has a single location in which to
search when view styles are created, loaded, or used.
IJDwgExternalModule
The IJDwgExternalModule interface is used by the director and the action analyzer
to set the inner IUnknown of the graphic wrapper (the original business object being
"wrapped") and to pass some view information to the wrapper. The view information
is passed to the wrapper in case it needs to alter the graphic representation of the
original object. All graphic wrapper objects should implement this interface.
Properties
Name and Syntax
Description
Parameters
ViewDirection
(
[put, get]
IJDVector* pVec
)
UpDirection
(
[put, get]
IJDVector*
pVec
)
ScaleFactor
(
[put, get] double
dScale
)
dScale - the
view scale.
Methods
Name and Syntax
Description
Parameters
SetInnerUnk
(
[in] IUNknown*
pInnerUnk
)
pInnerUnk - the
IUnknown of the
original object.
GetInnerUnk
(
[out, retval]
IUnknown**
ppInnerUnk
)
ppInnerUnk - the
IUnknown of the
original object.
IJDwgWrapperCompound
The IJDwgWrapperCompound interface is used by the director to return the
children of a compound wrapper object. Compound wrapper objects are used to
replace the original object with several new objects. Each one of the new objects
(children) is processed separately and independently by the drawings engine, and
therefore different graphic, label, and dimension rules can be applied to them.
Any graphic wrapper object with child elements (an object with components) should
implement this interface.
Methods
Name and Syntax
Description
Parameters
EnumerateEntities
(
[out, retval]
IEnumUnknown**
ppEnumChildElements
)
IJDwgWrapperPseudoFilter
The IJDwgWrapperPseudoFilter interface is used by the director to pass the name
of the filter to the wrapper for which it was applied. This filter name is taken from the
Graphic Preparation Rule selected for the particular view style.
This interface is also used by the Request Service. When testing an object to see if it
meets a certain filter, the Request Service first checks whether the object supports
IJDwgWrapperPseudoFilter. If so, it checks the name of the filter against the
values from IJDwgWrapperPseudoFilter::Filter and
IJDwgWrapperPseudoFilter::SubFilter.
The interface can also be used by a compound wrapper object to pass filter
information to its children.
Implement this interface when any wrapper object needs to preserve a filter name. A
most likely case - by simply delegating to the inner IUnknown of the wrapper, the
filter name cannot be matched to the correct filter. Also, all children of compound
wrappers for which separate view styles can be applied should implement this
interface. Those children are referenced in the Filter column of the View Style
Manager by Filter Name:: SubFilter Name (e.g. Equipment::Nozzles).
Properties
Name and
Syntax
Description
Parameters
Filter
(
[put, get] BSTR
bstrFilter
)
SubFilter
(
[put, get]
BSTR
bstrSubFilter
)
ElbowToSingleArc
Use this module when re-symbolizing an object in a drawing. For example, you can
use it to re-symbolize an elbow as a single arc. In this case the graphic module returns
an arc from its IJGraphicEntity interface instead of a revolution.
MakeDrawable
Use this module to force an object to be "drawable", that is, changing the
IJGraphicEntity::NotDrawable bit from IJGraphicEntity::GetProperties.
ElbowToSingleArc Module
The ElbowToSingleArc module was created so that you can change the
symbolization of an elbow business object that is part of a pipe run. If you defined the
view style to process the single line representation of a pipe run, you do not want the
full elbow as part of the output.
The drawings generation process passes the elbow business object into this wrapper.
Then the process communicates to the wrapper for the geometry to process the elbow.
Finally the wrapper calculates the arc that represents the elbow. This representation of
the arc is in the center of the elbow.
To view these examples, open the online programming documentation from Start >
Programs > Intergraph Smart 3D > Programming and go to this section to click
any of the hot-linked file names.
Sample Code
ElbowToSingleArcConverter.cpp
ElbowToSingleArcConverter.h
The following common files should be used in all wrappers.
SimpleDelegator.cpp
SimpleDelegator.h
SimpleCoDelegator.cpp
SimpleCoDelegator.h
MakeDrawable Module
The MakeDrawable module was created in order to make an object drawable. A
property indicates whether an object is drawable or not, thus determining whether an
object should be processed for the drawing.
The business objects that display in the graphic views must implement the
IJGraphicEntity interface. This interface exposes a method called GetProperties.
To determine whether the object is drawable, testing is performed against the value
(NotDrawable = 0x0200). A business object that uses the MakeDrawable module
must already implement IJGraphicEntity or IJGraphicCompound. The wrapper
itself does not implement the interface for the object. It simply overwrites its
drawable property.
Note: This wrapper returns that the object is drawable, no matter what the real
business object returns.
To view these examples, open the online programming documentation from Start >
Programs > Intergraph Smart 3D > Programming and go to this section to click
any of the hot-linked file names.
Sample Code
MakeDrawable.cpp
MakeDrawable.h
MakeDrawableGraphicHelper.cpp
MakeDrawableGraphicHelper.h
The following common files should be used in all wrappers:
SimpleDelegator.cpp
SimpleDelegator.h
SimpleCoDelegator.cpp
SimpleCoDelegator.h
To view these examples, open the online programming documentation from Start >
Programs > Intergraph Smart 3D > Programming and go to this section to click
any of the hot-linked file names.
Sample Code
EquipmentNozzleSep.cpp
EquipmentNozzleSep.h
EquipNozzSepGraphicHelper.cpp
EquipNozzSepGraphicHelper.h
The following common files should be used in all wrappers:
SimpleDelegator.cpp
SimpleDelegator.h
SimpleCoDelegator.cpp
SimpleCoDelegator.h
Note: When the command and ribbon bar projects were created, the wizard
automatically inserted a ProgID automatically in the code. The ProgID for the ribbon
bar was modified. The project also needed more type libraries to be referenced than
were provided by default.
The threading model for the ribbon bar project is defined as Apartment Threaded by
default. The ribbon bar threading model was modified as Single Threaded to interact
properly with the Hierarchy Combo control and the RAD2d Unit control.
For defining localized (internationalized) strings, you can use the Microsoft Visual
Basic Resource Editor to create your resource file.
1. Open Visual Basic.
2. Click Add-Ins > Add-In Manager....
3. Select VB 6 Resource Editor and make sure that the Loaded/Unloaded and
Load on Startup boxes under Load Behavior are both checked.
4. Click OK.
5. Click Tools > Resource Editor to invoke the dialog.
Step 1
In step 1, the new command's name, authoring, and type are defined. By designating
this type of command as normal, it means that the command implements the
IJCommand2 interface.
Note: The string entered in the New project description box appears in the Visual
Basic Project > References dialog that lists the type libraries that are available.
Step 2
In step 2, the command is defined as suspendable. The classification means that it is
an event-driven command that can be interrupted. Therefore, this command can be
added onto the stack while another is started. This command also needs an active
view and an active connection to the database.
Step 3
In step 3, the command is defined to have a ribbon bar. The ProgID is given so the
command can be run in the software. A localizer is added to provide
internationalization capability. Context-sensitive Help (F1) can be supplied for the
command by adding code to the IJCommandHelpInfo interface property.
Step 4
In step 4, the command is defined with the following references and services:
Step 5
In step 5, the command is defined with a reference for debug support and the ability
to display status bar messages.
Step 6
In step 6 no selections are required for this command.
Step 7
In step 7, the command is defined to use the SmartStep functionality. As shown, two
SmartStep steps are set to be defined, one at a time, in the next series of steps. This
step initializes to begin defining the first step.
SmartStep 1, Page 1
In the SmartStep 1 Definition - Page 1, this command is defined with the following
options:
Prompt to be displayed
QuickPick functionality
Use the step filter string ISPSMemberSystem, which allows only the
ClassIDs in that type library for the filter list.
SmartStep 1, Page 2
In this step, no selections are required for this command.
Step 7 Step 2
In step 7, the command is defined to use the SmartStep functionality. As shown, two
SmartStep steps are set to be defined, one at a time. This step initializes to begin
defining the second step.
SmartStep 2, Page 1
In the SmartStep 2 Definition - Page 1, this command is defined with the following
options:
Prompt to be displayed
QuickPick functionality
Use the step filter string IJShape interface, which allows only the
ClassIDs in that type library for the filter list.
SmartStep 2, Page 2
In this step, no selections are required for this command.
Step 8
In step 8 the command's settings are saved.
Creating Part Occurrence Symbols with the Part Definition Wizard: An Overview,
page 111
If the symbol dll already exists on the client computer, the software
compares the version number of the dll on the client computer with the
version number of the CAB file on the server. If the dll in the CAB file is
newer, the software automatically pulls to the client computer the newer
dll in the CAB file, and then automatically registers the dll on the client
computer.
Note
2. On a client machine, copy the dll from the server to the local [Product Directory]\
RefData\SharedContent\bin\{component} folder.
3. Register the new .dll by clicking Start > Run and typing: regsvr32 "[Product
Directory]\\RefData\SharedContent\bin\{component} \<name of dll>".
Tip
You can drag the file into the Run box rather than typing the entire
path.
4. Repeat steps 2 and 3 on each client machine.
Related Topics
Custom Component
A custom component is a specialized form of a symbol. If the symbol definition has
the property igSYMBOL_CACHE_OPTION_NOT_SHARED (meaning that the
result of its computation cannot be shared by other symbol occurrences) and the
property igSYMBOL_SUPPORT_UPDATE (the computation of the definition
supports the update of the outputs), a custom component is created instead of a
symbol by the IJDSymbolEntitiesFactory::PlaceSymbol method.
The custom component is seen as a group of entities resulting from the computation
of the definition. It does not hold a matrix. The result of the computation of the
symbol definition is directly attached to the custom component (using the output
Intergraph Smart 3D Programmers Guide 111
For instructions on how to install the Part Definition Wizard, see the
Intergraph Smart 3D Installation Guide available from the Help >
Printable Guides command.
The first page of the wizard contains a brief description of the wizard.
You can select an option to skip this page in the future.
2. On the Step 1 page, complete the project information.
You have just used the wizard to create a VB project, VB modules, and an
Excel workbook. Before you can test your symbol in the model, you must
add code, compile, distribute and register the .dll, edit the Excel
workbook, and bulk load into the Catalog Database. For more information,
see Distributing Symbols Automatically, page 108 or Distributing Symbols
Manually, page 110.
Creating Part Occurrence Symbols with the Part Definition Wizard: An Overview,
page 111
Creating Part Occurrence Symbols with the Part Definition Wizard: An Overview,
page 111
The wizard checks to see if the delivered module files already exist in the
location specified. If files already exist in the location, the wizard does not
copy over them, and the existing files are included in the resulting VB
project. If the files do not exist in the location, the wizard copies the
Intergraph .bas files from the wizard's Templates folder to the specified
location, and the files are also included in the resulting VB project.
6. If you want the wizard to create an Excel workbook with the symbol information,
make sure the Create bulkload spreadsheet box is selected.
Notes
The maximum length of the project name and class name together is 39
characters.
You cannot advance to the next page of the wizard until you have
completed the Project name, Class name, Intergraph library location,
and Save project as boxes.
Related Topics
You must complete both the Part class name and Classification boxes
before you can advance to the next page of the wizard.
Related Topics
You should begin the interface name with IJUA (for user-defined
interfaces) or IJ (for system interfaces).
2. Type a name for the fixed property in the Attribute Name column. This name
must not contain spaces.
3. Type a user-friendly name for the property in the Attribute User Name column.
This name can contain spaces.
4. In the Data Type column, select the type of data, such as double or char.
5. In the Unit Type column, select the unit category for the data, such as distance or
angle. The list of unit types originates from the file uom.xml delivered with the
VB Part Definition Wizard.
6. In the Primary Unit column, select the unit abbreviation, such as mm or deg.
The list of primary units is filtered based on your selection in the Unit Type
column.
7. In the Description column, type a brief description of the property.
8. In the Default column, type the default value for the property.
9. In the Symbol Parameter column, type the symbol parameter name. The name
cannot have any blanks or special characters. This name will appear in the
Head/Start/End section of the part class sheet. In the VB code, the symbol
parameter is prefixed by par-.
Notes
When defining angles in symbol code, the angle values must be in radians.
The branch angle is the angle between the header port direction to the
branch port direction.
Both interface names and attributes names must not exceed 30 characters.
The columns on this page are similar to the columns on the Custom
Interfaces sheet in the reference data workbooks.
Related Topics
If you want an insulation aspect for an output of the symbol, you must
include the IJInsulationThickness interface.
Attribute Name - Type a name for the property. This name must not contain spaces.
Attribute User Name - Type a user-friendly name for the property. This name can
contain spaces.
Data Type - Provides the type of data, such as double or char.
Unit Type - Provides the category of units, such as distance or angle. For a list of
unit types, see the UOM sheet in the AllCommon.xls workbook delivered with the
catalog bulkload files.
Primary Unit - Gives the unit abbreviation, such as mm or deg, for the property.
Description - Type a brief description of the property.
Default - Provides the default value for the property. Users can change this value for
each part occurrence. The value in the Default box is not required for a complete
property definition.
Symbol Parameter - Type the symbol parameter name. The name cannot have any
blanks or special characters. This name will appear in the Head/Start/End section of
the part class sheet. In the VB code, the symbol parameter is prefixed by par-.
Related Topics
Occurrence properties are not required for symbols, so you can leave the
grid blank and advance to the next page of the wizard if you want.
Tip
If you want an insulation aspect for an output of the symbol, you must
include the IJInsulationThickness interface.
2. Type a name for the fixed property in the Attribute Name column. This name
must not contain spaces.
3. Type a user-friendly name for the property in the Attribute User Name column.
This name can contain spaces.
4. In the Data Type column, select the type of data, such as double or char.
5. In the Unit Type column, select the unit category for the data, such as distance or
angle. The list of unit types originates from the file uom.xml delivered with the
VB Part Definition Wizard.
6. In the Primary Unit column, select the unit abbreviation, such as mm or deg.
The list of primary units is filtered based on your selection in the Unit Type
column.
7. In the Description column, type a brief description of the property.
8. In the Default column, type the value for the property. Users can change this
value for each part occurrence. The value in the Default column is not required
for a complete property definition.
9. In the Symbol Parameter column, type the symbol parameter name. The name
cannot have any blanks or special characters. This name will appear in the
Head/Start/End section of the part class sheet. In the VB code, the symbol
parameter is prefixed by par-.
Notes
Both interface names and attributes names must not exceed 30 characters.
Related Topics
Identify Outputs
1. In the Nozzles box, select the number of nozzles on the symbol.
2. In the Nozzle type box, select the type of nozzle, either Piping or HVAC.
3. In the Name column, type the name of the output in the VB program.
4. In the Description column, type a brief comment about the object. This
description is optional.
5. In the Type column, select a port type.
Tip
Examples of types include body, equipment nozzle, valve operator,
primary, piping port, secondary piping port, HVAC port, conduit port,
and cable port.
6. Select an aspect for the output.
Notes
The text that you type in the Name and Description columns appears in
the resulting VB program to help you find where to type additional code
for the output geometry and position.
For each output, you must enter the name of the output, the type of object,
and an aspect.
The wizard generates a class module for each aspect type that you specify.
For example, if you specify the simple physical aspect for one or more
outputs, the results will include CSimplePhysical.cls.
Related Topics
The wizard adds a comment line for each output you specified.
Tip
The first input is usually a Part Facelet object. The remaining inputs
are the inputs given to the Symbol Wizard. For example, if you were
creating a symbol of a ball valve which had three inputs, the code
could look like the following:
'Inputs
Set oPartFclt = arrayOfInputs(1)
parFacetoFace = arrayOfInputs(2)
parOperatorHeight = arrayOfInputs(3)
parOperatorLength = arrayOfInputs(4)
You can declare these variables as a standard data type such as double,
single, string, and so forth.
Related Topics
Electrical Conduit
Conduit is very similar to pipe, except that it is used to route electrical cables. Many
of the properties and features of conduit and piping are equivalent in the software.
The codelist for conduit measurements is available in AllCodeLists.xls on the Piping
Point Usage tab. The last option is #130 Conduit Port. The Nominal Piping Diameter
and Outside Diameter of electrical conduit are available as generic data so that they
can be standard with equipment. This information is located in AllCommon.xls.
To determine whether a nozzle is a conduit or pipe nozzle, you must trigger 130 for
Nozzle(1):PipingPointBasis as an attribute. When the command is launched, the
nozzle is automatically identified as conduit. If equipment has been created with
conduit, you must go to the catalog and trigger 130. PipingPointBasis for conduit
should be 130 and ConduitSelectionBasis should be 1 or 5.
For example, if a piece of equipment has two nozzles, one piping and one conduit, the
PipingPointBasis for the first may be 1 or 5 and the PipingPointBasis of the conduit
nozzle will be 130.
When you place conduit nozzles as equipment, they become part of the equipment
system in the hierarchy. They behave as equipment, even if they are not.
Cable Trays
Cable trays are open on one side and used to carry electrical cables through the
model. Similar to piping or conduit, they can be routed. However, they are
fundamentally different.
According to the National Electrical Code, a cable tray system is a unit or assembly
of units or sections and associated fittings forming a rigid structural system used to
securely fasten or support cables and raceways. A cable tray is the structural
component of the electrical system of a building or plant.
Because cable trays are open on the top, they cannot be rotated or mirrored as pipe or
conduit can. This creates a need for may different components, such as Branch left,
Branch right, Elbow down, Turn left, Reduce right, and so on. Every possible move
that can be made by a cable tray must be represented by a component symbol. The
joint where two cable trays meet is the port.
Some of the specifications that can identify a cable tray are:
Material
IsTraySpec
Reducers
An occurrence of a cable tray that is wider on one end and narrower on the other is a
reducer. Visual Basic symbols for reducers will typically have three principal
measurements:
Face to Face -- Length between the location where the cable enters and
exits the tray.
Vectors
The vector directions are especially important when you construct cable tray symbols.
If a vector is facing the wrong direction, the cable tray may be built backwards,
causing the cable to go in the wrong direction, or upside down causing the cable to
fall out.
The cable tray requires two vectors emerging from the port. The port for a cable tray
begins at the center of the bottom edge of Width 1, along the Y edge. The X axis
vector, or axial orientation, begins at the port and extends outward away from the
direction in which the cable will run, along the center line of the cable tray. The Z
axis, or radial orientation, begins at the port and extends upward, toward the open end
of the tray. In dimensional terms, X represents tray length, Y represents width, and Z
represents depth. The vector settings would be (-1, 0, 0) for the axial orientation, and
(0, 0, 0) for the radial.
Related Topics
Specifications
The catalog data for HVAC specs resides in the Hvac.xls workbook under the
HvacSpec sheet. On this sheet is a Specname of Spec-0, which allows for rectangular,
round, oval, and flat oval shapes. These shapes correspond to their own part numbers.
Rectangular = PDS-100
Round = PDS-150
Oval = PDS-200
HVAC Nozzles
HVAC components can contain nozzles, which are similar in form to those contained
in piping. They have measurements such as flange thickness, ports and port depths,
offset, nozzle length, and so on.
To create HVAC nozzles in a Visual Basic symbol, use the CreateNozzleFromPart
sub routine function. For example:
Set oNozzle = NozzleFactory.CreateHVACNozzleFromPart(part input,
index, False, objOutputColl.ResourceManager)
OA=Width in IJDuctSize
All information must be fed to the port, as the part does not exist. The component will
consist entirely of Occurrence Attributes supplied by the user.
Division
The division is an HVAC component used to split the flow from one duct run into
multiple duct runs. The most common division types split the duct run into two
Intergraph Smart 3D Programmers Guide 131
The creator of the port is responsible for setting its orientation and name. Orientation is set
using the following method.
Sub IJHgrPort_PutOrientation(OriginX As Double, OriginY As Double, OriginZ
As Double, XAxisX As Double, XAxisY As Double, XAxisZ As Double, ZAxisX As
Double, ZAxisY As Double, ZAxisZ As Double)
The port's name is set using the "name" property on the port object. The following conventions
should be used when naming ports.
The provided curve is used by other tasks such as Piping and Structure to generate detailed
features on the structural and routing objects associated with the support.
The feature's type is set using the Type property on the feature object. Valid values are shown
in the following table.
enum HgrMfgFeatType
WeldedType
HoleType
CutoutType
...
The feature's type determines the logic used when creating any manufacturing features.
Related Topics
Stock piping parts with asymmetrical ports must have which port is flow
in and which port is flow out defined in the catalog data. You cannot
define both ports as flow in or both as flow out when they are not
symmetrical.
When defining angle values in the symbol code, the value must be in
radians..
The branch angle is the angle between the header port direction to the
branch port direction.
Related Topics
Programming Notes for Visual Basic: An Overview, page 128
Defining Nozzles
There are several ways that you can use a nozzle to connect a pipe with valves or
equipment. These differences are called end preparations. The three most commonly
used end preparations are:
Butt Weld -- the pipe and valve butt up against each other and are welded
together. The port is at the Face to Face of the valve itself.
Bolted Connection -- two nozzles with equally sized flanges are bolted
together through holes in the flange. The port is at the outside surface of
the flange that is attached to the valve.
Female Socket Weld -- the valve flange has a depression, or socket, that
recedes back into it. The pipe is inserted into the socket with a small
offset. To determine the position of the port, use one of the following
formula:
PortPos = -FF/2 - Offset + Depth
PortPos = FF/2 - (Depth - Offset)
1. Nozzle Length
2. Flange Thickness / Hub Thickness / Face to Face
3. Socket Offset
4. Socket Depth
5. Vector
6. Flange Diameter
7. Pipe Outside Diameter
Note
Set Face to Face as the first input in the Part Definition Wizard.
Port Index
The port index (PortID) is a unique identifier that represents each port. You can write
code to communicate with this PortID because it has an interface. You can retrieve
information, such as the flange thickness, by calling the PortID. The PortID, in turn, calls
to the generic data residing in the AllCommon.xls file for the flange thickness and returns
it. This is useful when you need generic data about a part that you want to place in your
Visual Basic program. With these values, you can make calculations and perform actions
related to those calculations.
The first input to any Visual Basic program is the part. To retrieve information about this
part, add a line of code similar to the following:
RetrieveParameters 1, oPartFclt, mOutputColl, pipeDiam, flangeThick, _
flangeDiam, cptOffset, depth
You would have to inquire about the value of the flangeThick parameter from generic
data to determine the distance between the center of the valve and the beginning of the
flange.
Notes
oPartFclt is the parent directory for all parts called in Visual Basic. It is declared
as the first DIM statement to contribute parts to symbols.
flangeThick, as used in the previous example, is not the attribute name for flange
thickness. It is a variable used to hold the result of this value.
When defining a piping stock part with asymmetrical ports, you must specify
which port is flow in and which port is flow out in the catalog data.
Insulation
When you add insulation to a symbol using the Part Definition Wizard, list it as an
Occurrence Attribute under the insulation aspect. There are two inputs for insulation on a
simple object, such as a ball valve.
The first input should always be Face To Face, Face to Center, and so on.
If this was a straight pipe with nozzles, you would probably describe its length using
a simple Face to Face value, such as dimension 3. If you want to describe the length
of the center pipe, neither the Face to Face value, nor the pipe diameter, will provide
the length. A Face to Center value, or combination of Face1 to Center and Face2 to
Center values, better meet the need.
Face to Center values can also be useful when describing the length between the
center of the symbol and a port. A simple formula for center to port is:
Face1toCenter - (Depth - Offset)
or
F1C - (D - O)
Next, set the direction. The vector always begins on the same plane as the surface for
which you are setting the vector. Specify any coordinate in the correct direction
through which the vector will run. For example:
Left Facing oDir.set -1, 0, 0
Right Facing oDir.set 1, 0, 0
Upper Left Facing oDir.set -1, 1, 0
Axis Orientation
The line between two ports of a symbol is its axis orientation. Certain types of
symbols should have different axis orientations based on the needs of that symbol.
For example, piping components such as valves run along pipe runs and generally
have ports along the X-axis where the component connects with the rest of the run.
There may be a second Y-axis along the valve operator of the same pipe component.
Flanges
The flange is the connection face of the nozzle. Typically, flange diameters are
significantly wider than the nominal piping diameter and are welded to the pipe.
Three common types of flanges used in the software are:
Weld Neck Flange -- Flange and neck, welded at end of neck on both
sides with pipe.
Plate Flange -- Plate for the flange, but no neck. Welded at the end of the
pipe inside of the flange, and at the outside of the flange to the pipe.
Slip-on Flange -- Flange and neck, slips on to pipe and is welded to the
pipe both at the outside of the neck and the inside of the flange.
Flanges contain two ports; one to connect with other equipment, and another to
connect with the pipe. The distance between Port 1 (connection with other
equipment) and Port 2 (connection with pipe) is also the Face to Face value. If there
is no distance between the two ports, as in a plate flange, the Face to Face value is
zero.
Related Topics
PortIndex
Npd
EndPreparation
ScheduleThickness
EndStandard
PressureRating
FlowDirection
A fully parametric symbol differs from a regular symbol in the following ways:
All the input parameters are given as occurrence attributes in the PartClass
sheet (bulkload sheet).
In addition to the regular inputs, nozzle data such as NPD and End
Preparation are defined as inputs.
Modified nozzle data is not available for the Insulation class. You can use
static variables to account for this. When you create nozzles in the
physical class file, store the nozzle data (such as flangedia and
flangethickness) in static array variables. For example:
Dim pipeDiam(1 To 2) As Double
Dim sptOffset(1 To 2) As Double
Then, in the Insulation class the nozzle data is retrieved from these static variables
and used to create the geometry.
The following example shows code for creating a fully dynamic nozzle. All the
geometry output creation would be similar as in a regular symbol.
'Place Dynamic Nozzle
Dim oLogicalDistPort As GSCADNozzleEntities.IJLogicalDistPort
Dim oDistribPort As GSCADNozzleEntities.IJDistribPort
Dim oPipePort As GSCADNozzleEntities.IJDPipePort
Dim oNozzleFactory As GSCADNozzleEntities.NozzleFactory
Dim oNozzle As GSCADNozzleEntities.IJDNozzle
Set oNozzleFactory = New GSCADNozzleEntities.NozzleFactory
Private m_oCodeListMetadata As IJDCodeListMetaData
Set m_oCodeListMetadata = m_OutputColl.ResourceManager
TerminationSubClass1 =
m_oCodeListMetadata.ParentValueID("EndPreparation", EndPreparation1)
TerminationClass1 =
m_oCodeListMetadata.ParentValueID("TerminationSubClass"
TerminationSubClass1)
SchedulePractice1 =
m_oCodeListMetadata.ParentValueID("ScheduleThickness"
ScheduleThickness1)
EndPractice1 = m_oCodeListMetadata.ParentValueID("EndStandard"
EndStandard1)
RatingPractice1 =
m_oCodeListMetadata.ParentValueID("PressureRating", PressureRating1)
Set oNozzle = oNozzleFactory.CreatePipeNozzle(PortIndex1, Npd1, _
NpdUnitType1, EndPreparation1, ScheduleThickness1, EndStandard1, _
PressureRating1, FlowDirection1, PortStatus, Id1, _
TerminationClass1, TerminationSubClass1, SchedulePractice1, _
5, EndPractice1, RatingPractice1, False,
m_OutputColl.ResourceManager, oCatalogConnection.ResourceManager)
Set oLogicalDistPort = oNozzle
Set oDistribPort = oNozzle
Set oPipePort = oNozzle
pipeDiam1 = oPipePort.PipingOutsideDiameter
flangeDiam1 = oPipePort.FlangeOrHubOutsideDiameter
flangeThick1 = oPipePort.FlangeOrHubThickness
depth = oPipePort.SeatingOrGrooveOrSocketDepth
CptOffset = oPipePort.FlangeProjectionOrSocketOffset
oNozzle.Length = flangeThick1
'Direction of the Nozzle
oDir.Set -1, 0, 0
oDistribPort.SetDirectionVector oDir
'Position of the nozzle should be the connect point of the nozzle
oPlacePoint.Set -(faceToFace / 2 + CptOffset - depth), 0, 0
Related Topics
Defining Valves
You can create valve symbols with or without operators. If you create the valve
symbol with the operator, then the operator geometry is included in the valve
geometry. That means that you must create a separate symbol for each combination of
valve and operator.
If you create the valve symbol and operator symbol separately, you can associate the
operator symbols with the valve symbols when you bulkload the valves. The valve
symbol code contains the information for placing an operator at the required
orientation.
To attach an operator with a given symbol do the following:
1. Create one output in the physical class file for Operator. For example:
'Insert your code for output 4 (Valve Operator)
Dim oSymbolHelper As IJSymbolGeometryHelper
Set oSymbolHelper = New SP3DSymbolHelper.SymbolServices
oSymbolHelper.OutputCollection = m_OutputColl
On Error Resume Next
Dim oDirX As IJDVector
Dim oDirY As IJDVector
Dim oDirZ As IJDVector
Set oDirX = New DVector
Set oDirY = New DVector
Set oDirZ = New DVector
oDirX.Set Cos(parRotation), 0, Sin(parRotation)
oDirY.Set 0, 1, 0
oDirZ.Set -Sin(parRotation), 0, Cos(parRotation)
Dim oPipeComponent As IJDPipeComponent
Set oPipeComponent = oPartFclt
On Error GoTo ErrorLabel
Dim oOperatorPart As IJDPart
Dim oOperatorOcc
As IJPartOcc
If Not oPipeComponent Is Nothing Then
Set oOperatorPart = oPipeComponent.GetValveOperatorPart
If Not oOperatorPart Is Nothing Then
Dim OpOrigin As IJDPosition
Set OpOrigin = New DPosition
OpOrigin.Set 0, 0, 0
Set oOperatorOcc =
oSymbolHelper.CreateChildPartOcc("ValveOperator", oOperatorPart,
OpOrigin, oDirX, oDirY, oDirZ)
End If
End If
Set oSymbolHelper = Nothing
Set oOperatorPart = Nothing
2. While bulkloading the Valve Body, specify the operator (part number OperatorPartNumber) that you want to combine with the valve body on the
PipingcommodityMatlControlData sheet in the ValveOperatorPartNumber
column. For example:
In the example you can specify, PortIndex, Npd, endpreparation, and so on as input
parameters to the symbol. The function creates a nozzle according to the data values
passed to it and not from the catalog database.
You can create the following types of nozzles using part information:
Pipe Nozzle
Cable Nozzle
Conduit Nozzle
HVAC Nozzle
Related Topics
Using SymbolHelper
The SymbolHelper object (SymbolHelper.SymbolServices) implements two
interfaces; IJDUserSymbolServices and IJSymbolGeometryHelper.
SymbolHelper provides the default implementation of the methods in the
IJDUserSymbolServices interface.
The Part Definition Wizard-generated code implements the methods of
IJDUserSymbolServices in the main class file of the symbol project. Because of this,
the implementation code of these methods is copied into each symbol project. Using
the SymbolHelper object can reduce this repetition of code.
The SymbolHelper project also implements the methods of
IJSymbolGeometryHelper, which provides implementation for creation of some
primitive geometric shapes such as cylinder, sphere, and so on. You can use these
shapes to create the symbol geometry.
For more detailed information about the SymbolHelper API, refer to the
"SymbolHelper Math Reference" in the Intergraph Smart 3D Programmer's Guide.
Note
Example
The following example shows the main Symbol class file for a SP3DcheckValve
created using the SymbolHelper object.
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'
' Copyright 1999 Copyright 1999 Intergraph
' All Rights Reserved
'
' CCheckValve.cls.cls
' ProgID: SP3DCheckValve.CCheckValve
' Author:
' Creation Date: Monday, Jan 22 2001
' Description:
' TODO - fill in header description information
'
' Change History:
' Joe Programmer : Thursday , Jan 2003
' Modified existing symbol to check for Symbol creation using
SP3DSymbolHelper.SymbolServices
' ----------- --- -----------------'
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Option Explicit
4
1, "Body", "Check Valve Body",
2, "InsulatedBody", "Insulated
3, "PNoz1", "Nozzle 1",
4, "PNoz2", "Nozzle 2",
' Aspects
m_oSymbolHelper.NumAspects = 2
m_oSymbolHelper.AddAspectDef 1, "Physical", "Physical",
SimplePhysical
m_oSymbolHelper.AddAspectDef 2, "Insulation", "Insulation",
Insulation
Exit Sub
ErrorHandler:
ReportUnanticipatedError MODULE, METHOD
End Sub
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub Class_Terminate()
Set m_oSymbolHelper = Nothing
End Sub
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Public Function IJDUserSymbolServices_InstanciateDefinition( _
ByVal CodeBase As String, _
ByVal defParameters As Variant, _
ByVal ActiveConnection As Object) As Object
' call symbol services default implementation of this method
Related Topics
2
1,
2,
2
1,
2,
"O1", "O1", 1
"O2", "O2", 1073741824
"SimplePhysical", "Simple", SimplePhysical
"UseDefinedAspect", "UserDefined",
Related Topics
The part (PartFacelets.IJDPart) contains information regarding the part you are
placing in the model. For example, it could contain the number of ports and end
preparations, end standard, and so on. If the symbol you are placing contains some
number of inputs and some number of nozzles, the RetrieveParameters function will
get the nozzle information such as pipe diameter, end preparation, pressure rating,
and so on using the input part PartFacelets.IJDPart.
The RetrieveParameters function uses the information in PartFacelets.IJDPart to
retrieve the pipe diameter, flange diameter, and so on of nozzles associated with the
part while placing the symbol in the model.
Related Topics
Converting PDS EDEN to Smart 3D Visual Basic Symbols: An Overview, page 152
Piping
[Product Directory]\Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe EDENPiping
<EDENSymbol> <SP3DProjectName> <SP3DSymbolName> <Author>
<PDSTranslatorExcelFile> <PDSModelCode> <SP3DTabName>
EDENPiping denotes that this is a Piping symbol. This should not be changed.
<PDSTranslatorExcelFile> the filename (with full path) to the PDS translator excel
file.
<PDSModelCode> the PDS model code in the "Physical Data" sheet of the PDS
translator.
<SP3DTabName> the SmartPlant3D Tab Name in the "Physical Data" sheet of the
PDS translator.
Equipment
[Product Directory] \Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe
EDENEquipment <EDENSymbol> <SP3DProjectName> <SP3DSymbolName>
<Author>
EDENEquipment denotes that this is an Equipment Symbol. This should not be
changed.
Electrical
[Product Directory] \Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe
EDENElectrical <EDENSymbol> <SP3DProjectName> <SP3DSymbolName>
<Author>
Examples
The following are examples of using the tool:
[Product Directory] \Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe EDENPiping
I15AZ.mg SP3DGlobeValveF CGlobeValveF John
"M:\CatalogData\PDSTranslator\Docs\Piping Translation Rules.xls" GLO
GlobeValve
[Product Directory] \Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe.exe
EDENEquipment e405.eqp Pump PumpServices John
[Product Directory] \Programming\Programming\Example
Code\PDSTranslator\EDEN2SP3D\Template_Piping\EDEN2SP3D.exe
EDENElectrical thl SP3DElectricalSymbol HTrayElbow John
Related Topics
Converting PDS EDEN to Smart 3D Visual Basic Symbols: An Overview, page 152
The translator also generates a log file, <SP3DProjectName>.log, that contains any
errors or warnings and reports on the parsing of the EDEN code.
Related Topics
Converting PDS EDEN to Smart 3D Visual Basic Symbols: An Overview, page 152
Note, that in Visual Basic the symbol input can be called by some other name, say,
"ImpellerDiameter", "PumpHeight", and so forth. You will have to modify the name
of the input to match the one that is defined in the excel data files. For example, you
can modify the generated code as follows:
m_oSymbolHelper.AddInputDef 3, "ImpellerDiameter",
"ImpellerDiameter", 3
If-Then-Else Conditions
EDEN does not require you to declare all the outputs of a symbol beforehand.
However, in Visual Basic you are required to list all the outputs of a symbol in the
Depending upon the condition, either a cylinder or a cone will be drawn, but not both.
The translator generates the Visual Basic code as:
If (oNozzleData(1).dPipeDiameter = oNozzleData(2).dPipeDiameter)
Then
oT4x4Temp.LoadIdentity
oT4x4Temp.IndexValue(12) = length
Dim oCylinderCapped2 As Object
Set oCylinderCapped2 = PlaceCylinder(m_OutputColl, oOriginPos,
oT4x4Temp.TransformPosition(oOriginPos),
CDbl(oNozzleData(1).dPipeDiameter), True
oCylinderCapped2.Transform oT4x4Current
oOutputCol.Add oCylinderCapped2
oT4x4Current.MultMatrix oT4x4Temp
Else
oT4x4Temp.LoadIdentity
oT4x4Temp.IndexValue(12) = length
Dim oConeCapped1 As Object
Set oConeCapped1 = PlaceCone(m_OutputColl, oOriginPos,
oT4x4Temp.TransformPosition(oOriginPos),
CDbl(oNozzleData(1).dPipeDiameter) / 2,
CDbl(oNozzleData(2).dPipeDiameter) / 2, True)
oConeCapped1.Transform oT4x4Current
oOutputCol.Add oConeCapped1
oT4x4Current.MultMatrix oT4x4Temp
End If
The translator also adds both the outputs in the symbol initialization:
m_oSymbolHelper.AddOutputDef 1, "oCylinderCapped1",
"oCylinderCapped1", 1
m_oSymbolHelper.AddOutputDef 2, "oCylinderCapped2",
"oCylinderCapped2", 1
This causes a problem at runtime because one of the outputs will be "Nothing" at
runtime. To avoid this problem, remove the extra output as follows:
m_oSymbolHelper.AddOutputDef 1, "oCylinderorCone1",
"oCylinderorCone1", 1
The symbol graphics code may also be modified for better readability, however the
code will function even if it is not modified.
Note
Approximations to Zero
Visual Basic symbols have difficulty in drawing cones with zero radii. In these cases,
the generated code will compile successfully, however, at runtime it may raise some
problems from the math calculations. This is avoided by changing the value of zero to
a value that is very close to zero. For example:
Dim diameter As Variant
diameter = DELTA_TOLERANCE ' 0#
Set oCone1 = PlaceCone(..) ' this call uses the `diameter'
variable
In the above code, a value of zero is replaced with a value of "0.00001". The
DELTA_TOLERANCE constant is defined for this purpose.
Aspects (Equipment)
Symbols in Equipment can have aspects, and each graphic that is drawn can belong to
one or many aspects. In Visual Basic we handle aspects by having separate ".cls" file
for each aspect (for those symbols not using SmartEquipment). The translator does
not generate separate code for each aspect. Thus, the code generated will not contain
any information on the aspects. All the code generated will belong only to the
SimplePhysical aspect. You will have to cut, copy and paste portions of the code into
different aspects as needed.
Nozzles (Equipment)
Equipment nozzles are now defined with a PlaceHolder in the symbol file and the
actual nozzle is placed in a "_Def.cls" file. The translator does not generate this "Def"
file automatically. You will have to generate this file either with the wizard or by
copying this file from another symbol and editing it as needed.
Note
Related Topics
Converting PDS EDEN to Smart 3D Visual Basic Symbols: An Overview, page 152
8. In the code, find the "parametric_shape" definition. In this example, "V11" is the
module that should be extracted and converted.
This process assumes you have not customized the EDEN symbol. If you
have customized the EDEN symbol and user-defined Symbol Processors
Converting PDS EDEN to Smart 3D Visual Basic Symbols: An Overview, page 152
Definition Options
igSYMBOL_ARGUMENTS_TYPE_MASK =
0x0000000f
igSYMBOL_ARGUMENTS_TYPE_STATIC =
0x00000000
igSYMBOL_ARGUMENTS_TYPE_PARAMETRIC =
0x00000001
igSYMBOL_ARGUMENTS_TYPE_ASSOC =
0x00000002
igSYMBOL_CACHE_OPTION_MASK = 0x000000f0
igSYMBOL_CACHE_OPTION_AUTOMATIC =
0x00000010
A result is sharable by
several symbols. If there's
already a placed symbol
occurrence with the same set
of arguments and same
active representations, share
the cached graphic outputs.
igSYMBOL_CACHE_OPTION_NOT_SHARED =
0x00000030
igSYMBOL_GEOM_OPTION_MASK = 0x00000f00
igSYMBOL_GEOM_FREE = 0x00000100
igSYMBOL_GEOM_DRIVEN_BY_ARG =
0x00000200
igSYMBOL_GEOM_FIX_TO_ID = 0x00000600
igSYMBOL_ELLIPSIS_INPUTS = 0x00001000
igSYMBOL_METADATA_OPTION_MASK =
0x00002000
igSYMBOL_STATIC_METADATA = 0x00000000
igSYMBOL_DYNAMIC_METADATA = 0x00002000
igSYMBOL_SUPPORT_ONLY_OPTION_MASK =
0x00004000
igSYMBOL_SUPPORT_ONLY = 0x00000000
igSYMBOL_NOT_SUPPORT_ONLY = 0x00004000
igSYMBOL_POOL_DESC_OPTION_MASK =
0x000f0000
igSYMBOL_UNPOOL_DESCRIPTORS =
0x00020000
igSYMBOL_SUPPORT_UPDATE_OPTION_MASK
= 0x00400000
igSYMBOL_SUPPORT_UPDATE = 0x00400000
igSYMBOL_NOT_SUPPORT_UPDATE =
0x00000000
DefineActiveOrientation Method
Description
The DefineActiveOrientation method sets the active orientation with respect to a
predefined value.
Syntax
Parameter
Data Type
Description
oNozzleData
oT4x4Current
IJDT4x4
lPrimary
Long
lSecondary
Long
DefineNozzle Method
Description
The DefineNozzle method returns a nozzle according to the given part,
transformation, index, and type.
Syntax
Parameter
Data
Type
Description
oOutputColl
Object
oPart
IJDPart
oT4x4Current
IJDT4x4
strNozzleString
String
lNozzleIndex
Long
INozzleType
Long
DefinePlacePoint Method
Description
The DefinePlacePoint method defines placement for a 3D point in space.
Syntax
Parameter
Data Type
Description
oOrientationPoint
OrientationPoint
oPoint
IJDPosition
oT4x4Current
IJDT4x4
DefinePoint Method
Description
The DefinePoint method defines a 3D point in space according to the given
transformation, position object, and respective of the tolerance values to the reference
point.
Syntax
Parameter
Data Type
Description
oT4x4Current
IJDT4x4
oPoint
IJDPosition
oRefPoint
dDeltax
Double
dDeltay
Double
dDeltaz
Double
lFlag
Long
DrawArc Method
Description
The DrawArc method creates an arc given the major and minor radius, the start angle,
and the sweep angle.
Syntax
Parameter
Data
Type
Description
oOutputColl
Object
oT4x4Current
IJDT4x4
dMajorRadius
Double
dMinorRadius
Double
dStartAngle
Double
dSweepAngle
Double
oOutputCol
Remarks
The appearance of the sweep angle for an ellipse contrasts to that of a circle object
because the major and minor axis measurements are different.
DrawComplexSurface Method
Description
The DrawComplexSurface method creates a complex surface geometry according to
the given arguments providing elements from two surface values.
Syntax
Parameter
Data
Type
Description
oOutputColl Object
lArg1
Long
lArg2
Long
oOutputCol
DrawLine Method
Description
The DrawLine method creates linear object according to the given transformation and
starting and ending positions.
Syntax
Parameter
Data Type
Description
oOutputColl
Object
oT4x4Current
IJDT4x4
oFromPoint
oToPoint
IJDPosition
oOutputCol
Collection
InitializeGlobals Method
Description
The InitializeGlobals method initializes the place points and datum points of the
nozzle data.
Syntax
Parameter
Data Type
Description
oNozzleData
MoveAlongAxis Method
Description
The MoveAlongAxis method moves the current drawing position along the given axis
according to the given distance.
Syntax
Parameter
Data
Type
Description
oT4x4Current
IJDT4x4
lAxisDirection
Long
lDistance
Double
MoveToPlacePoint Method
Description
The MoveToPlacePoint method defines the move transformation for placement of a
3D point in space.
Syntax
Parameter
Data Type
Description
oPlacePoint
OrientationPoint
oT4x4Current
IJDT4x4
NozzleDefineDirectionVector Method
Description
The NozzleDefineDirectionVector method initializes the nozzle direction vector
according to the given EDEN geometry type.
Syntax
Parameter
Data Type
Description
oNozzleData
lGeometryType
Long
NozzleInitialize Method
Description
The NozzleInitialize method initializes the nozzle data.
Syntax
Parameter
Data Type
Description
oPipeComponent
IJDPipeComponent
oNozzleData
NozzleData
NozzlePlace Method
Description
The NozzlePlace method places a nozzle and includes the origin of the nozzle ID=0.
Syntax
Parameter
Data Type
Description
m_OutputColl
Object
oPart
IJDPart
oNozzleData
lNozzleId
Long
oPlacementPoint
IJDPosition
oT4x4Current
IJDT4x4
oNozzleCol
Collection
oOutputCol
Collection
RotateOrientation Method
Description
The RotateOrientation method rotates the drawing position along the given axis by
the given angle.
Syntax
Parameter
Data
Type
Description
oT4x4Current
IJDT4x4
lAxis
Long
dAngle
Double
Introduction
The Equipment Symbol Upgrade Wizard upgrades regular version 5.0 Equipment
symbols to Smart Occurrence-based version 6.0 Equipment symbols. Smart
Occurrence-based Equipment gives better control of the Nozzles to the design. As
opposed to the regular Equipment symbols that require only one class for the symbol
definition, version 6.0 Equipment symbols require an additional class for custom
assembly definition. Also, the format of the spreadsheet is slightly different.
Note: To override the default settings of the strings that are appended during the
upgrade process, you can edit the Registry with the following key string values:
Key: HKEY_CURRENT_USER\Software\VB and VBA Program
Settings\Microsoft Visual Basic AddIns
\SP3D EqpSymbolToSO Upgrade Wizard
String Values (equivalent to default):
AppendToPart, "_Asm"
AppendToProject, "Asm"
AppendToPartClass, "Asm"
AppendToNode, " Asm"
AppendToTopNodeUserName, " Assemblies"
Log Files
The wizard generates two log files during the upgrade process. These are:
SP3DV6UpgradeSO_<Time&Date>.log
SP3DV6UpgradeSO_<Time&Date>Checkin.log - contains the list of modified files if
a source control system is used.
The following are descriptions of results of the upgrade process:
Upgrade to the Visual Basic Code
Upgrade to the Excel Workbooks
Note: The ProgID for Equipment cannot be reused for an Equipment Component.
Therefore, you must upgrade some parts of Equipment Component before you
perform a bulk load.
Define Locations
Equipment Symbol Upgrade Wizard - Step 1
This step captures the various inputs for the upgrade process.
First you need to select the spreadsheets of your Equipment symbols that need to be
upgraded. Browse to the root location of the original symbols source and to the target
locations for the source and binary files of the upgraded symbols. Select the location
where your upgrade log file will be generated.
Remember that you must have write access to all of the files.
The list view displays the actions, the status, and the time.
Note: This step can take a few minutes or as much as several hours to process
depending on the number of projects that need to be upgraded and compiled.
Finish
The Equipment spreadsheets have been copied and updated for the parts and part
classes using the ProgIDs that have been upgraded.
Index
Index
ActiveX components
abstract class, 34
client, 34
DLLs, 34
implementation, 34
AddAccessControlRule method
IJAccessRuleHelper, 67
AddNamingRelations method
customizing, 45
architecture
business objects, 12
client, 12
metadata, 12
middle, 12
server, 12
three-tier, 12
aspects
custom, 148
AttachPDSProject method
ProjectMgmtEntitiesFactory, 58
axis orientation, 135
BackupPlantDatabases method
IJBackupRestoreHelper, 70
binary compatibility, 20
binding
early, 20
late, 20
body of symbols, 125
CAB files, 107
cable trays, 127
catalog database valves, 142
classification of symbols, 118, 119
CNameRuleAE object
active entity, 38
Custom Name Rule, 38
customizing, 38
command priorities
stacking, 23
suspendable, 23
ComputeName method
customizing, 36
conduit, 127
converting
PDS symbols to SP3D, 151, 152, 153, 155, 156
PDS symbols to SP3D examples, 160
CreateAccessControlRule method
ProjectMgmtEntitiesFactory, 63
CreateCatalogDatabaseObject method
ProjectMgmtEntitiesFactory, 61
CreateFolder method
ProjectMgmtEntitiesFactory, 61
CreateModelDatabaseObject method
ProjectMgmtEntitiesFactory, 60
CreatePermissionGroup method
ProjectMgmtEntitiesFactory, 62
CreateProjectRoot method
ProjectMgmtEntitiesFactory, 59
CreateReportsDatabaseObject method
ProjectMgmtEntitiesFactory, 64
CreateSupport method
HgrDisciplineType, 48
creating
symbols, 104, 110, 112, 117
custom aspects, 148
custom commands
TransactionManager, 32
undo, 32
custom component, 110
Custom Name Rule
CNameRuleAE object, 38
customizing, 36
custom supports
CreateSupport method, 48
CreateSupport method example, 53
customizing, 48
HgrDisciplineType, 48
HgrSupProgAutoComp, 48
IJHgrAutomation, 48
IJHgrSupport, 51
ModifySupport method, 51
customizing
naming rules, 35
customizing Part Definition Wizard output, 126
debugging your code
TaskHost, 18
DefineActiveOrientation, 167
DefineNozzle, 168
DefinePlacePoint, 169
DefinePoint, 170
definition properties, 120
definitions
symbols, 164
differences between parametric and regular symbols,
139
directions, 135
distributing symbols
automatically, 107
manually, 109
divisions, 130
DrawComplexSurface, 172
DrawLine, 171, 173
EDEN symbols, 151, 152, 153, 155, 156, 160
Index
command line structure, 153
translator outputs, 155
VB modifications, 156
workflow, 152
workflow examples, 160
electrical
cable trays, 127
conduit, 127
parts versus features, 127
reducers, 127
vectors, 127
end preparations, 135
Equipment Symbol Upgrade Wizard
log files, 180
upgrading symbols, 178
errors
Error Log Component, 24
handling, 24
example using String type, 149
example using SymbolHelper, 145
examples
Vertical Vessel Supports Placement Example, 89
Excel workbooks, 118, 119
Face to Center Versus Face to Face, 135
features, 127
first input, 150
fixed properties, 112, 120, 121
flanges, 135
flavors, 164
Frozen property
customizing, 38
GetActiveNamingRule method
customizing, 45
GetCount method
customizing, 41
GetCountEx method
customizing, 42
GetCountRange method
customizing, 43
GetDisplayChildren method
IJHierarchy, 66
GetEntityNamingrulesGivenName method
customizing, 46
GetEntityNamingRulesGivenProgID method
customizing, 46
GetNamingParents method
customizing, 37
GetParent property
IJHierarchy, 66
graphical output, 112
HVAC
divisions, 130
nozzles, 130
specifications, 130
IJAccessRuleHelper
AddAccessControlRule method, 66
IJBackupRestoreHelper
BackupPlantDatabases method, 69
RestorePlantDatabases method, 69
IJDNamingRulesHelper
customizing, 44
determine unique name, 44
IJHgrAutomation
HgrSupProgAutoComp, 48
IJHierarchy
GetDisplayChildren method, 65
GetParent method, 65
IJNameCounter interface
customizing, 40
IJNameRule interface
customizing, 36
IJNameRuleAE interface
customizing, 38
InitializeGlobals, 173
inputs, 150
insulation, 135
IsGeneratedNameUnique
customizing, 47
determine unique name, 47
limitation of PDS translation
discussed, 156
ModifySupport method
IJHgrSupport, 51
MoveAlongAxis, 174
MoveToPlacePoint, 174
NameGeneratorService object
customizing, 40
implements IJNameCounter, 40
naming rules
adding library references, 35, 36, 38
adding to Catalog, 35
AddNamingRelations method, 45
CNameRuleAE object, 38
COM, 35
ComputeName method, 36
Custom Name Rule, 36
customizing, 35
determine unique name, 44, 47
Frozen property, 38
GetActiveNamingRule method, 45
GetCount method, 41
GetCountEx method, 42
GetCountRange method, 43
GetEntityNamingrulesGivenName method, 46
GetEntityNamingRulesGivenProgID method, 46
GetNamingParents method, 37
IJDNamingRulesHelper, 44
IJNameCouter interface, 40
IJNameRule interface, 36
IJNameRuleAE interface, 38
implements IJDNamingRulesHelper, 44
IsGeneratedNameUnique, 47
Index
NameGeneratorService object, 40
NamingParentsString property, 39
NamingRulesHelper object, 44
NamingParentsString property
customizing, 39
NamingRulesHelper object
customizing, 44
implements IJDNamingRulesHelper, 44
nested symbols, 110
NozzleDefineDirectionVector, 175
NozzleInitialize, 175
NozzlePlace, 176
nozzles, 130
axis orientation, 135
end preparations, 135
Face to Center Versus Face to Face, 135
flanges, 135
insulation, 135
port indexes, 135
vectors and directions, 135
occurrence properties, 112, 122, 123
output information for symbols, 124
parametric symbols
differences, 139
parametric valves, 142
part class templates, 119
part classes for symbols, 118
Part Definition Wizard, 114
PartFacelets.IJDPart, 150
parts, 127
as first input, 150
PDS symbols, 151, 152, 153, 155, 156, 160
command line structure, 153
translator outputs, 155
VB modifications, 156
workflow, 152
workflow examples, 160
port indexes, 135
ports, 125
support parts, 132
preface, 7
programming notes for Visual Basic, 127
project management
AddAccessControlRule method, 67
AddLocation method, 57
AttachPDSProject method, 58
BackupPlantDatabases method, 70
CreateAccessControlRule method, 63
CreateCatalogDatabaseObject method, 61
CreateFolder method, 61
CreateModelDatabaseObject method, 60
CreatePermissionGroup method, 62
CreateProjectRoot method, 59
CreateReportsDatabaseObject method, 64
GetDisplayChildren method, 66
IJAccessRuleHelper, 66
IJBackupRestoreHelper, 69
IJHierarchy, 65
Ingr Sp3d ProjectMgmtEntities 1.0 Type Library,
56
Parent property, 66
ProjectMgmtEntitiesFactory, 56
RestorePlantDatabases method, 71
Project Management
access control rules, 54
backup/restore, 54
customizing, 54
traverse permision groups, 54
traverse project folders, 54
ProjectMgmtEntitiesFactory
CreateAccessControlRule method, 56
CreateCatalogDatabaseObject method, 56
CreateFolder method, 56
CreateFolderParent method, 56
CreateModelDatabaseObject method, 56
CreatePermissionGroup method, 56
CreateProjectRoot method, 56
CreateReportsDatabaseObject method, 56
projects for symbols, 117
properties
symbols, 121, 123
reducers, 127
references, 17
setting, 27, 29
resources, 17
RestorePlantDatabases method
IJBackupRestoreHelper, 71
RetrieveParameters function, 150
RotateOrientation, 177
samples
using the Command Wizard, 92
Vertical Vessel Supports Placement, 92
specifications for HVAC, 130
String type
example, 149
SymbolHelper
example, 145
SymbolRepid, 148
symbols
adding to reference data, 105
aspects, 124
converting PDS to SP3D, 151, 152, 153, 155, 156
converting PDS to SP3D examples, 160
creating, 104, 110, 112, 114
creating with Visual Basic, 115, 118, 120
definitions, 164
distributing automatically, 107
distributing manually, 109
flavors, 164
geometry, 125
inputs, 126
nested, 110
Index
occurrence properties in Visual Basic, 122
outputs, 124, 125, 126
variables, 120
TaskHost
debugging your code, 18
templates for part classes, 119
type libraries
referencing, 26
undo
custom commands, 32
TransactionManager, 32
upgrade to the Equipment Component
upgrading symbols, 180
upgrading symbols
Equipment Symbol Upgrade Wizard, 178
getting started, 179
log files, 180
register and launch the wizard, 179
upgrade to the Equipment Component, 180
using
Speedy References tool, 27, 29