Академический Документы
Профессиональный Документы
Культура Документы
Programming Help
Trademarks
Intergraph, the Intergraph logo, SmartSketch, FrameWorks, SmartPlant, INtools, MARIAN, and PDS are registered
trademarks of Intergraph Corporation. Microsoft and Windows are registered trademarks of Microsoft Corporation.
ISOGEN is a registered trademark of Alias Limited. Other brands and product names are trademarks of their
respective owners.
Table of Contents
Table of Contents
Welcome..............................................................................................................................4
Using the Command Wizard ........................................................................................5
Introduction...................................................................................................................6
Command Wizard - Step 0.................................................................................................. 6
Identification.................................................................................................................7
Command Wizard - Step 1.................................................................................................. 7
Properties ......................................................................................................................9
Command Wizard - Step 2.................................................................................................. 9
Visual Aspects ............................................................................................................11
Command Wizard - Step 3................................................................................................ 11
References and Services .............................................................................................14
Command Wizard - Step 4................................................................................................ 14
Utilities and Debugging Aids .....................................................................................16
Command Wizard - Step 5................................................................................................ 16
Notification and Event Handlers ................................................................................17
Command Wizard - Step 6................................................................................................ 17
SmartStep Definition ..................................................................................................19
Command Wizard - Step 7................................................................................................ 19
Prompt and Selection Characteristics .........................................................................21
Command Wizard - SmartStep Definition 1..................................................................... 21
Constraints and Options..............................................................................................23
Command Wizard - SmartStep Definition 2..................................................................... 23
Finish ..........................................................................................................................25
Index..................................................................................................................................26
Welcome
The Command Wizard Help provides introductory information to developers who want to create
custom commands. Before creating commands or programs, you should 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.
Note: You must add the TaskHost project to the integrated development environment (IDE)
before you can debug your Visual Basic project. For information on adding the TaskHost
project to your project, see "Debugging Your Code" in the "Recommended Guidelines" section
of the SmartPlant 3D/IntelliShip Programmer's Guide.
For more information about using the TaskHost project and creating commands using the
software's application programming interface (API), please contact Intergraph Services.
After you have created your command, you can run the command by clicking Tools > Custom
Commands. You can complete all the steps performed by the Command Wizard with regular
Visual Basic tools, but the Command Wizard makes the process very easy.
Introduction
This step allows you to choose whether or not to display this introductory form the next time you
run the wizard.
Identification
Current Project - Can be selected only if there is at least one project open. When you select this
option, all of the boxes in the Create a new project frame are disabled.
New Project - If selected, any currently open projects are closed. The new project is created and
appears as the active project in the Visual Basic environment.
New Project Description: This string appears in the Visual Basic references listing, and should
follow naming rules.
Type of new project: The project type can be either an ActiveX control OCX (default) or
Dynamic Link Library (DLL).
DLL - Creates a separate ribbon bar ActiveX control project to house the ribbon, if one is
required.
Reset Default
Applies all default settings to Step 1.
- Normal priority commands can commit and abort transactions. They must stop their transaction
when they are stopped or 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 fail.
Modify Command - Implements the IModifyCmd class and is designed to be used by modify
commands. SelectCmd interface uses this interface to inform its subordinate modify command
of state changes. You should implement this interface in all modify commands that are started
and controlled by the SelectCmd interface.
Modify commands are subordinate to the SelectCmd interface. The SelectCmd interface starts
and stops them and passes edited GraphicView events on to them. Normally, the SelectCmd
interface examines all mouse events in its own context to perform locates, fences, changes to the
select set, and so forth. There are times when the ModifyCmd interface needs to do the
processing instead of the SelectCmd interface. For example, the ModifyCmd interface might
need to locate and select a reference object.
Command Name: Regardless of which project creation option is selected, you must enter a
unique name for your command. Spaces are not allowed in the command name. Keep in mind
that this string becomes part of the ProgID.
Author: The Author information becomes part of the comments inserted into the Visual Basic
project's header information.
Company: The Company information becomes part of the comments inserted into the Visual
Basic project's header information.
Properties
Modal: Can be stopped immediately after it is started, for example, Delete (no dialog), Edit
Properties, Open Session.
Suspendable: An event-driven command, which can be interrupted. This means that it can be
added onto the stack while another command is executed.
Note: If you check the Command is modal option, you cannot define SmartStep or
SmartSketch3d functionality, because they are higher priority commands.
Enabling Characteristics
Needs active view
View type: If the command requires an active view, the default view type is the
IJDGraphicView interface.
Needs active connection - If your command needs an active database connection. The
enumerated value imsEnableCmdOnActiveConnection is added to
IJCommand2_EnableUIFlags.
Needs non-empty select set - If the command needs a non-empty SelectSet, and the command is
to act on already selected elements upon activation. The enumerated value
imsEnableCmdOnSelectSet is added to IJCommand2_EnableUIFlags.
Needs EnableSpecial check - If the command needs to be enabled. The enumerated value
imsEnableCmdOnEnableSpecial is added to IJCommand2_EnableUIFlags.
Note: The CommandMgr compares each of these flags against the state of the system before it
actually starts a command.
Visual Aspects
• Adds a control to the project or creates a separate ribbon project to house the control.
• Adds references to the ribbon project in the new command.
• Depending on your type of command, adds code to IJCommand2_Start or
IModifyCmd_Start.
Start(ByVal CommandID As Long, ByVal arg As Variant)
Starts the command. Priority is used to determine whether the active command is stacked or
killed.
'***************************************************************************
'The ribbonbar project referenced by the following two lines was
'created with the commandWizard at the same time as this command was created.
'Reference to the ribbonbar must be completed before this command will
'compile.
'To complete the process do the following:
'1. Make BEBCmdRB the active project
'2. Run File > Make BEBCmdRB.ocx
'3. Make BEBCmd the active project.
'4. Run Project > Components
'5. Mark the box beside BEBCmdRB Ribbonbar and select OK.
'****************************************************************************
In either ActiveX project, the correct ProgID is inserted into the field.
Has a form - Adds a starter form along with appropriate global variables and code in the
appropriate IJCommand2 or the IModifyCmd command Start, Stop, Suspend, and Resume
modules.
Supply Localizer - References Ingr Marine Localizer 2.0 Library, adds code to initialize the
localizer, and adds the helper function GetLocalizedString to CommonSubs.bas. This BAS file
is automatically created for your Visual Basic command project. The localizer is provided for
your commands that must address internationalization requirements, that is, need to be used by
more than one language group.
IJCommandHelpInfo
This interface is supported by ActiveX® DLL commands and provides context-sensitive help.
The interface returns the help topic index to the OnlineHelp object.
OnlineHelp Object
Context-sensitive help assists users by providing help based on specific commands. This enables
users to get specific information about whatever part of the program they are using at any given
moment.
The help author creates a compiled help (CHM) file that contains the context-sensitive help
topics and information that maps the topics to specific commands.
Help for each command is written in an individual HTML page and has a context number (or tag
index) associated with it. The index is supplied to OnlineHelp using the IJCommandHelpInfo
interface. At initialization of a task, the Task Manager must initialize the IMSHelp component,
which contains the OnlineHelp object. The initialization consists of specifying the path and root
name of the compiled help file. (The root name does not include the CHM extension).
AutoMath - Specifies a reference to the Ingr SmartPlant3D AutoMath 1.0 Library, which is
contained in the AutoMath.dll file.
The math objects are designed to provide you with a basic collection of vector math
functionality. The math objects are non-persistent objects that implement default interfaces with
methods and properties for abstract manipulation of the underlying data types.
Objects Description
DPosition Implements the interface methods and properties for a point object in 3D
space.
DVector Implements the interface methods and properties for a 3D vector object.
DT4x4 Implements the interface methods and properties for a 4x4 column-major
matrix object.
The Registry object provides the initial connection to the system registry. In fact, it is the only
IMSRegistryHandler object that a client can safely create directly (as when using Visual
Basic's New operator). You can create new Registry objects to connect to the local registry.
The Registry object provides two separate but compatible types of access to the connected
system registry:
• It provides various service-like methods to directly and easily get or set values, add
registry keys, and so on. For example, given a key name and an item name, the client
can retrieve the corresponding value in a single call. Most clients find these methods
sufficient for most registry access.
• It provides methods to allocate RegistryNode objects and the rest of the
IMSRegistryHandler objects. Collectively, these objects provide the means by
which to navigate through the system registry hierarchy, as well as complete access to
the registry.
Client-Side element display - Adds client-side element display service and specifies references
to the Ingr SP3D CSElementDisplay 1.0 Type Library and Ingr SP3D
CSElementDisplayMgr v 1.0.
Relationships - Adds the ability to manipulate relationships and specifies a reference to the Ingr
SmartPlant 3D Relation v 1.0 Library.
StepFilter - Provides an interface with methods and properties to filter a collection of elements
according to a set of criteria. The StepFilter object can be used to check whether an element or
list of elements match the criteria. It can modify an existing collection of elements by removing
those that do not match the criteria set that are using the interface.
The criteria used with this object can be customized. The set of criteria is a string composed of a
list of criteria. A set of criteria can be viewed as a logical mask. Each criteria can be defined with
the conjunctive OR or AND or prefixed by NOT.
Four kinds of criteria are allowed: interface name, IID (string) of an interface, a Visual Basic
function, or the ProgID of an object class.
Entity support - Specifies a reference to the Ingr SP3D Entity Support 1.0 Type Library.
The EntitySupport component defines the interface and basic template objects for application
components. The EntitySupport component also provides the implementations of a Template
Business Object (BO) and a Template Persistent Object (JPO). Every application business
object must inherit from the Template Business Object.
StyleRuleMgr - Specifies a reference to the Ingr SP3D StyleRuleMgr 1.0 Type Library.
JCommand - Allows the user to make queries on a database. This option specifies a reference to
the Ingr SP3D JClientCommand 1.0 Type Library so you can use the JCommand object.
Units of measure - References the Ingr SmartPlant 3D Units Of Measure v 1.0 Client
Library and Ingr SmartPlant 3D UnitsOfMeasure Services v1.0 Library. This option also
declares the module variable m_UnitsOfMeasure and adds the appropriate initialization to the
applicable IModifyCmd or IJCommand2 modules.
ValueMgr - References the Ingr SmartPlant 3d ICDPInterface v 1.0 Library, if it has not
already been included by another option.
This singleton object is exported to the Trader as ValueMgr (TKTValueMgr is the Const String
in CoreTraderKeys.bas) that provides, in essence, a global dictionary. Tasks and other
components can use this object to interrogate and set the values for keys on a global scale.
Debug Aids
Uses debug support - Adds debug support. This functionality provides an easy-to-use debug log
component.
Disable OnIdle in Debug - Adds code to the Start method to disable idle processing.
Disable OnIdle in Release - Adds code to the Start method to disable idle processing.
Helper routines
Convert string to GUID - Provides the ability to convert a string such as IJPlane and return its
GUID.
Convert device to model coordinates - Returns model coordinates from device coordinates.
Routines are added to the CommonSubs.bas file.
Convert model to device coordinates - Returns the device coordinates from model coordinates.
Routines are added to the CommonSubs.bas file.
Display status bar messages - Adds a reference to the Ingr sp3d CommonApp Utilities v1.0
Library, and includes the DisplayStatus procedure to assist in writing messages to the status
bar.
'/////////////////////////////////////////////////////////////////////////
'// Use RaiseEvent to pass it on to interested parties, such as commands.
'/////////////////////////////////////////////////////////////////////////
RaiseEvent MouseMove( generatingView, Button, Shift, X, Y )
The previous Event example is based on the one in the Visual Basic PictureBox object class.
Uses SmartSketch3D - Includes this functionality for your command. The SmartSketch3D
interface is the default interface for the CSmartSketch object. It provides the methods that
commands use in order to get a new position to place an object. This interface is also used to
determine how the QuickPick object is used with the CSmartSketch object.
listeners.
F1Only Boolean Key-up or key-down actions (F1Only =
False), or just F1 key-up or key-down
actions (F1Only = True)
Events Available
When you select the Uses GraphicViewMgr events option , any of the following can be
selected as event handlers: MouseUp, MouseDown, MouseMove, KeyDown, KeyPress,
KeyUp, OnClose, Click, Double Click, GotFocus, Hide, LostFocus, Paint, Resize, or Show.
Event Handlers
Items appear according to GraphicViewMgr events that you select for your command.
SmartStep Definition
Command uses SmartStep - Implements SmartStep functionality. This selection generates the
following changes to your command:
Member Description
Trader Allows clients to access services exposed dynamically by
servers. The server exports functionality in the form of "Offers"
to the Trader component, and clients can query the Trader to
try and find a server to provide services that the client requires.
Services are found by "name" rather than identity, such as
CLSID.
CommandMgr The CommandManager permits the application to start, pause,
resume, and stop commands. The application can also set the
DefaultCommand property, which is defined as the only
command running. The CommandManager can be obtained
from the Trader using the key "CommandMgr" (no subkey).
WorkingSet Contains the various objects used to define and access the data
available to a client.
Select number of steps to define: Allows you to set the number of SmartStep steps that you
need for your command.
Select Step - Allows you to select the specific SmartStep step to be defined or edited.
Edit Step - Allows you to enter the two-step process of defining the SmartStep commands.
Define prompt for step: You can specify the prompt to display when this step becomes active.
You should define its meaning to be concise and clear to the user in the context of the active
command.
'The command line for this option:
m_CmdSmartStep.Step(0).Prompt = "<i.e. Select stuff>"
Maximum selectable elements: You can specify a limited number of selectable elements for
your command. The default value is one. This option generates the following code:
m_CmdSmartStep.Step(0).MaxElements = (NoElements)
Enable QuickPick - Provides QuickPick functionality for your command and references the
Ingr SP3D ICDPInterfaces 1.0 Type Library and the Ingr SP3D QuickPick 1.0 Interface
Definition Type Library. This option generates the following code:
m_CmdSmartStep.step(0).QuickPickEnabled = True
Note: Checking the option Use SmartSketch3D disables the Enable QuickPick option and vise
versa.
You can use the QuickPick component in commands that need to present the user with a
graphical user interface (GUI) element for choosing among multiple objects. To achieve this
interaction, the SelectCmd object uses certain features of QuickPick. The QuickPick
component does not perform all of the feedback alone. In addition, QuickPick provides events
and methods that allow the command to perform necessary functionality.
Enable fence-locate - Provides the ability to use a fence to locate a select set. This option adds
the following to your command:
m_CmdSmartStep.step(0).FenceEnabled = True
If the property is set to False, a fenced selection is ignored.
Use SmartSketch3D - Allows your command to use SmartSketch3D functionality. This option
adds the following to your command:
m_CmdSmartStep.Step(0).SmartSketchOn = True
If this property is set to True, then a number of SmartSketch3D options are enabled and defined
in your code in the SmartStep Definition 2, Constraints and Options, page 23.
Listen for step List modifications - Allows your command to reference methods on the
IJElemsByMonikerModified interface as listeners to modifications in the elements collection.
These methods are called when any object is selected in the graphic view. This option allows
your command to process things such as enabling and disabling controls, selection validation,
and so forth.
Listen for step HilitedElements modifications - This event is valid only for the SmartStep
definition. It is triggered when the elements list is hilited. The list count is zero when no element
is hilited.
This option allows you to define a filter string for your command. Step Filter allows selection to
be limited only to the ClassIDs provided in the filter list.
Filter criteria:
If you check Use step Filter, you must complete this text box. Following are valid examples you
can enter for this option:
Point creation ON - Generates a temporary graphic point in the code by which SmartSketch3D
functionality returns a coordinate. This option is for commands that do not need to select
elements.
Supply default point if no point returned - Allows the default point to be returned if the user-
defined point maker fails to return a point.
Center point
Key point
Horizontal
Intersection
Point on curve
Mid point
Offset
Parallel
Perpendicular
Finish
This step allows you to build your command based on all settings you have selected.
Save current settings as default - Saves all the settings that you selected to be the default
settings.
Index
Command Wizard creating commands
creating commands, 5 Command Wizard, 5