GUI Python SDK Reference Manual

apex_sdk.ToolPropertyContainer Class Reference

ToolPropertyContainer is a class that derives from System.Windows.Controls.UserControl.

Custom tool scripts must return an instance of ToolPropertyContainer from the script method getUIContent. This instance must define the contents of the custom tool.

Constructors


ToolPropertyContainer()

Constructs a tool property container.


Public Attributes


bool IsAutoAppliedVisible

Gets or sets the visibility of the Auto button (lightning bolt).


bool IsAppliedVisible

Gets or sets the visibility of the Apply button (green check).


bool IsAppliedEnabled

Gets or sets the availability of the Apply button.


bool IsHeaderExpanderVisible

Gets or sets the visibility of the tool “Advanced Properties” expander, visible if True, hidden if False.


string TitleImageUriString

Gets or sets the image URI for the tool, such as "file:///C:/path/to/image.png”.


string TitleText

Gets or sets the title for the title bar.


bool ShowPickChoice

Gets or sets the visibility of the pick filter, visible if True, hidden if False.


FrameworkElement ToolPropertyContent

Gets or sets the content of the tool; this must be a subclass instance of System.Windows.Controls.Panel, such as System.Windows.Controls.Grid or System.Windows.Controls.StackPanel.


FrameworkElement PickFilterContent

Do not use; use apex_sdk.PickFilterRegistration.RegisterTool instead.


FrameworkElement PickFilterVisibilityPickingContent

Do not use.


string ToolPropBorderVerticalAlignment

Gets or sets the vertical alignment of the tool: “Top”, the default, “Center”, “Bottom”, or “Stretch”.


bool ShowBorderEffect

Do not use.


bool IsAutoApplied

Gets or sets the tool mode: True is automatic, False is manual.


ICommand AppliedCommand

Gets or sets the command to call when the Apply button is clicked. The command is an instance of apex_sdk.ActionCommand. Use a System.Action delegate for a Python function as the argument to the ActionCommand constructor. The Python function must take no parameters.


ICommand ExitCommand

Gets or sets the command to call when the Exit button is clicked. The command is an instance of apex_sdk.ActionCommand. Use a System.Action delegate for a Python function as the argument to the ActionCommand constructor. The Python function must take no parameters.


bool UseDefaultExitBehavior

Do not use.


bool IsCustomTool

Gets or sets a flag indicating that the tool is a custom tool. Always set it to True.


string WorkFlowInstructions

A string of HTML-encoded text to be used for tool workflow instructions.


System.Windows.Visibility WorkFlowInstructionsVisibility

Gets or sets the visibility of the tool workflow instructions.


bool IsObjectPropertyControl

Gets or sets a flag indicating that the tool is an object property control. Always set it to False.


bool IsRoundCornerContainer

Do not use.


apex_sdk.ActionCommand Class Reference

Use an ActionCommand to define an event handler for custom tool Apply or Exit buttons.

Constructors

ActionCommand(System.Action action)

Constructs an action command from an Action delegate. An ActionCommand is used when assigning a Python function to use as an event handler for the Apply and Exit buttons of a custom tool.

Arguments:

action                                    an instance of a System.Action delegate for a Python function. The Python function must take no parameters.


apex_sdk.PickFilterTypes Class Reference

Use attributes of PickFilterTypes to define the contents of the custom tool pick filter.

Public Attributes

Picking Behaviors:

string ExclusivePicking                       add this type to show the ExclusivePicking option button.
string VisibilityPicking                        add this type to show the VisibilityPicking option button.

Model Organization Entity Types

string Assembly                                  add this type to show assemblies on the pick filter.
string Part                                           add this type to show parts on the pick filter.

Geometry Entity Types

string Solid                                        add this type to show solid bodies on the pick filter.
string Surface                                    add this type to show sheet bodies on the pick filter.
string Curve                                       add this type to show curve bodies on the pick filter.
string Point                                        add this type to show point bodies on the pick filter.
string Cell                                          add this type to show cells on the pick filter.
string Face                                         add this type to show faces on the pick filter.
string Edge                                        add this type to show edges on the pick filter.
string Vertex                                      add this type to show vertexes on the pick filter.
string AveragePoint                           add this type to show average point on the pick filter.

Mesh Entity Types

string SolidMesh                               add this type to show 3D meshes on the pick filter.
string SurfaceMesh                           add this type to show 2D meshes on the pick filter.
string CurveMesh                              add this type to show 1D meshes on the pick filter.
string CellMesh                                 add this type to show 3D sub-meshes on the pick filter.
string FaceMesh                                add this type to show 2D sub-meshes on the pick filter.
string EdgeMesh                               add this type to show 1D sub-meshes on the pick filter.
string VertexMesh                             add this type to show 0D meshes on the pick filter.
string Element1D                              add this type to show 1D elements on the pick filter.
string Element2D                              add this type to show 2D elements on the pick filter.
string Element3D                              add this type to show 3D elements on the pick filter.
string Node                                       add this type to show mesh nodes on the pick filter.
string MeshSeed                               add this type to show mesh seeds on the pick filter.
string SeedPoint                                add this type to show mesh seed points on the pick filter.
string ElementEdge                           add this type to show edges of 2D or 3D elements on the pick filter.
string ElementFace                            add this type to show faces of 3D elements on the pick filter.

Interactions and Connections Types

string DiscreteTie                               add this type to show discrete ties on the pick filter.
string Connector                                add this type to show connectors on the pick filter.
string EdgeTie                                    add this type to show edge ties on the pick filter.
string Joint                                         add this type to show joints on the pick filter.
string Glue                                         add this type to show glue connectors on the pick filter.
string Bolt3D                                     add this type to show Bolt3D on the pick filter.
string ContactBody                           add this type to show ContactBody on the pick filter.

Load and Constraint Types

string Pressure                                   add this type to show pressure on the pick filter.
string Gravity                                     add this type to show gravity on the pick filter.
string Constraint                                add this type to show displacement constraints on the pick filter.
string ForceMoment                          add this type to show forces - moments on the pick filter.
string EnforcedMotion                      add this type to show enforced motions on the pick filter.
string LoadTemperature                    add this type to show load temperature on the pick filter.
string InitialTemperature                   add this type to show initial temperature on the pick filter.
string LoadPressure                           add this type to show load pressure on the pick filter.
string Force                                        add this type to show force on the pick filter.
string Moment                                   add this type to show moment on the pick filter.
string LoadScaleFactor                       add this type to show load scale factor on the pick filter.
string BeamDistributedLoad              add this type to show beam distributed load on the pick filter.
string DynamicLoad                           add this type to show dynamic load on the pick filter.
string Temperature                             add this type to show temperature on the pick filter.
string BeamTemperature                    add this type to show beam temperature on the pick filter.
string DeformationAxial1D                 add this type to show deformation axial1D on the pick filter.
string Acceleration                              add this type to show acceleration on the pick filter.
string LoadCombination                     add this type to show load combination on the pick filter.
string Support                                     add this type to show support on the pick filter.
string ExcludDof                                  add this type to show ExcludDof on the pick filter.
string InitialStress                                add this type to show initial stress on the pick filter.
string InitialStrain                                add this type to show initial strain on the pick filter.
string InitialDisplacementVelocity       add this type to show initial displacement velocity on the pick filter.
string InitialBeamTemperature            add this type to show initial beam temperature on the pick filter.
string RotationalForce                         add this type to show rotational force on the pick filter.

Attribution Property Types

string CompositeZone                         add this type to show composite zones on the pick filter.
string InterfacePoint                            add this type to show interface points on the pick filter.
string LayeredPanel                             add this type to show layered panels on the pick filter.
string Offset                                         add this type to show offsets on the pick filter.
string BeamSpan                                 add this type to show beam span on the pick filter.
string PointMass                                  add this type to show point masses on the pick filter.

Sensor Types

string ClearanceSensor                        add this type to show clearance sensors on the pick filter.
string CrossSectionSensor                   add this type to show cross-section sensors on the pick filter.
string MotionEnvelopeSensor             add this type to show motion envelope sensors on the pick filter.
string PointSensor                               add this type to show point sensors on the pick filter.

Adams Entity Types

string AdamsJoint                               add this type to show Adams Joint on the pick filter.
string AdamsJPrim                              add this type to show Adams JPrim on the pick filter.
string AdamsPointCurve                     add this type to show AdamsPoint Curve on the pick filter.
string AdamsCurveCurve                    add this type to show AdamsCurve Curve on the pick filter.
string RigidPartRep                             add this type to show Rigid PartRep on the pick filter.
string FlexiblePartRep                         add this type to show Flexible PartRep on the pick filter.
string AdamsSForce                            add this type to show Adams SForce on the pick filter.
string AdamsSTorque                          add this type to show Adams STorque on the pick filter.
string AdamsContact                          add this type to show Adams Contact on the pick filter.
string AdamsVForce                            add this type to show Adams VForce on the pick filter.
string AdamsVTorque                         add this type to show Adams VTorque on the pick filter.
string AdamsRotationalMotion          add this type to show Adams Rotational Motion on the pick filter.
string AdamsTranslationalMotion      add this type to show Adams Translational Motion on the pick filter.
string AdamsPointMotion                  add this type to show Adams Point Motion on the pick filter.
string AdamsBushing                         add this type to show Adams Bushing on the pick filter.
string AdamsTranslationalSpringDamper                add this type to show Adams Translational SpringDamper on the pick filter.
string AdamsRotationalSpringDamper                    add this type to show Adams Rotational SpringDamper on the pick filter.

Other Types

string DatumPlane                               add this type to show datum planes on the pick filter.
string CoordinateSystem                     add this type to show user coordinate systems on the pick filter.


apex_sdk.PickFilterRegistration Class Reference

Use PickFilterRegistration to specify the contents of the custom tool pick filter.

Methods

RegisterTool(toolName, filterList)

Arguments:

string toolName               the name of the custom tool.

System.Collections.Generic.List[System.String] filterList
a list of PickFilterTypes attributes that specify the pick filter contents. Use the List method Add to add items to the filter list.


apex_sdk.errorhandler Decorator Reference

@apex_sdk.errorhandler

This decorator catches Python exceptions thrown in the function it decorates and presents them to the user in a dialog. Use of this decorator for event handler functions is mandatory to avoid unexpected termination of the Apex application.


apex_sdk.runScript Function Reference

apex_sdk.runScript(script)

This function will run an external Python script. It is mandatory to use this function to avoid stalling the Apex user interface while the external script runs. Avoid running external scripts directly in the custom tool script.

Arguments:

string script                         the path of the Python script.


apex_sdk.runScriptFunction Function Reference

apex_sdk.runScriptFunction(script, function, dictionary)

This function will run a function in an external Python script. It is mandatory to use this function to avoid stalling the Apex user interface while the external script runs. Avoid importing external scripts and running their methods directly in the custom tool script.

Arguments:

string script                       the path of the Python script.

string function                   the name of a Python function defined in the script.

dict dictionary                   a dictionary of key and value pairs that the function can use as inputs. This provides a means for passing values that the user defines with the custom tool dialog. Keys and values can be any type but will be converted to strings in this function.


apex_sdk.DataDescriptor Class Reference

apex_sdk.runDataDescriptor(script, function, dictionary)

When the stage button is ExpandableStageButton, you can use a DataDescriptor instance collection as the ExpandableStageButton 's ExpandableContent. StageButton will generate a caption and textbox for each instance of DataDescriptor.

Constructors


DataDescriptor()

Constructs a DataDescriptor.


Public Attributes


event EventHandler<ExpressionChangedData> ExpressionChanged;

Event fires when the expression changed

string GlyphName

When UTM show, after you manipulate the manipulator, there is a status message would show to inform which object be transformed

This property let you to set the object name.


string Caption

The caption show before the textbox. If you set DataDescriptorType to be GlyphLocation/GlyphOrientation this property would be set to "Location"/"Orientation" by framework


string Dimension

The dimension of the textbox value (e.g. length/angle). If you set DataDescriptorType to be GlyphLocation/GlyphOrientation this property would be set to "Length"/"Angle" by framework


bool IsReadOnly

The property to make the textbox is read only or not.


bool IsEnabled

The property to make the textbox is enabled or disabled


string ToolTip

The property to set the textbox's tooltip


bool NeedAxesComponents

The property to set if this stage need to show axes glyph preview. This property only works when DataDescriptorType to be GlyphLocation/GlyphOrientation


bool IsVisible

The property to set the caption and textbox are visible or not


DataDescriptorType DataDescriptorType

This property to set current data descriptor's type. The value can be GlyphOrientation/GlyphLocation/Custom

  • When the value is GlyphLocation, framework would set Caption to "Location", Dimension to "UnitDimensions.Length", and support show glyph preview and UTM automatically
  • When the value is GlyphOrientation, framework would set Caption to "Orientation", Dimension to "UnitDimensions.Angle", and support show glyph preview and UTM automatically
  • When the value is Custom, custom tool needs set Caption and Dimension by itself. If this custom tool needs UTM and glyph, then it needs use GlyphLocation and GlyphOrientation values.

apex_sdk.ExpandableStageButton Class Reference

apex_sdk.ExpandableStageButton(script, function, dictionary)

ExpandableStageButton is a class that derives from System.Windows.Controls ListBoxItem. You can use this class instance to create stage button.

Constructors


ExpandableStageItem()


Public Attributes


object ExpandableContent
The content of the expander. When the content is a collection of DataDescriptors, it would generate a caption and a textbox for each DataDescriptor automatically


bool IsExpanded
control the expander is expanded or not


object Header
The header of the expander