Geometry

Geometry
This container holds imported or generated geometry from an instance of DesignModeler.

Methods

Edit

The Edit command starts DesignModeler session, if it is not already running. If DesignModeler session is already running, this command brings the DesignModeler window in focus.

If a CAD file is assigned to geometry component, the file is loaded in the DesignModeler.

Available options:

Interactive This optional boolean type argument indicates whether DesignModeler is to be started in Interactive mode or batch mode. Its default value is True

Optional Arguments

Interactive    Whether to edit in batch mode
    Type    bool
    Default Value    True
IsSpaceClaimGeometry    Whether to edit geometry in SpaceClaim. If the user wants to use SpaceClaim as the geometry editor, then IsSpaceClaimGeometry should be set to true. The default value of IsSpaceClaimGeometry is false. If the user edits the geometry using DesignModeler then "IsSpaceClaimGeometry" will be false.
    Type    bool
    Default Value    False
StartupArguments    Additional arguments to send to the modeler. These are to be supplied as comand line options when we launch the geometry editor. SpaceClaim is the only one that consumes it right now.
    Type    string
Example

Required example does not exist.


Exit

Exit command shuts down the running session of the Geometry Editor. Before shuting down, the geometry is brought up-to-date generates the editor saves its database.

The editor session can not be closed if it is busy in generating features or seeking user's input. In such situations, this command throws an ApplicationBusyException exception.


Export

The export command exports geometry data in running Geometry Editor to the location specified in its FilePath argument. The export file CAD format is deduced from the extension of FilePath.

Available options:

FilePath This argument points to the location where the exported file should be saved. The filename extension specifies the export file format

The command throws following exception

CommandFailedExceptionexport file format is not supportedExport file location doesn't existsFile name contains invalid characters
ApplicationBusyExceptionWhen the editor is busy.

Required Arguments

FilePath    Output file path
    Type    string
Example

Suppose the geometry in the container "Geometry" needs to exported to IGES and STEP formats. This can be achieved by the following example.

    geometry1 = GetDataContainer("Geometry")
    geometry1.Export(FilePath="C:/Models/geometry1.iges")
    geometry1.Export(FilePath=AbsUserPathName("Models/geometry1.step"))


GetGeometryProperties

Return a reference to DataEntity managing property settings of Geometry Container.

Return     Reference to DataEntity managing geometry properties
    Type     DataReference

Refresh

Refresh command refreshes the input data in a geometry component by consuming all changed data from upstream (source) components. This command also updates the modified parameters in the geometry editor.

After succesful execution of this command, the geometry component goes into "update required" state.

Optional Arguments

RepositoryFilesToRefresh    Registered Repository files
    Type    List<DataReference>

RunScript

Executes a script in the assigned geometry editor, which must be running. SpaceClaim will accept Python (.py) and SpaceClaim Script (.scscript) files. DesignModeler will accept JavaScript (.js) or Python (.py) files.

Required Parameters:

ScriptFilePath of the script file to be run.

Required Arguments

ScriptFile    Path of the script file
    Type    string

Optional Arguments

useAsMacro    For internal use only.
    Type    bool
    Default Value    True

SendCommand

The SendCommand sends javascript or python command string to the Geometry Editor for execution. If the editor is not open, it will be launched to execute commands, and then closed. If editor is already running, it will keep running after the command execution.

If the editor is busy and not available for executing the instruction, the SendCommand throws an ApplicationBusyException exception.

Available options:

Command Javascript or Python command string containing scripting commands for the Geometry Editor
Language Language of the command. Allowed values are: "Javascript" and "Python". The default language is "Javascript"

The following command will add a sketch with an elliptical curve in the DesignModeler editor.

Required Arguments

Command    Command string
    Type    string

Optional Arguments

Language    Language of the command. The default value of Language is "Javascript".
    Type    string
    Default Value    Javascript
Example

    system1 = GetSystem(Name="Geom")
    geometry1 = system1.GetContainer(ComponentName="Geometry")
    geometry1.SendCommand( Command = """var ps1 = new Object();
     	ps1.Plane  = agb.GetActivePlane();
    	ps1.Origin = ps1.Plane.GetOrigin();
    	ps1.XAxis  = ps1.Plane.GetXAxis();
    	ps1.YAxis  = ps1.Plane.GetYAxis();
    	ps1.Sk1 = ps1.Plane.NewSketch();
    	ps1.Sk1.Name = "Sketch1";
    	with (ps1.Sk1) { ps1.El7 = Ellipse( 8.0, 10.0, 9.0, 6.0, 5.0, 12.0); }
    	agb.Regen();""")


SetFile

Adds a Geometry file to the Geometry System. The file processed by the geometry editor.

Available options:

FilePath Path of the geometry file
PlugInNamePlugIn Name, in case of PlugIn mode geometry transfer

Required Arguments

FilePath    Path of the Geometry File
    Type    string

Optional Arguments

CreatedFileRef    Created File reference
    Type    Output<DataReference>
PlugInName    PlugIn Name, in case of PlugIn mode Geometry transfer
    Type    string
RepositoryFileReference    Reference for the Geometry file if from repository
    Type    DataReference
Example

    geometry1 = GetDataContainer("Geometry")
    geometry1.SetFile("C:/Models/block.iges")
    geometry2 = GetDataContainer("Geometry 1")
    geometry2.SetFile(FilePath=AbsUserPathName("Models/block.prt.1"), PlugInName="ProEngineer[1]")


Stop

The Stop command shuts down the running session of of the Geometry Editor immediately, without saving its unsaved data.

The editor session can not be stopped if it is busy in importing or exporting CAD files. In such situations, this command throws an ApplicationBusyException exception.


UpdateCAD

The UpdateCAD command updates the geometry component using parameter values from the Geometry Editor. If the parameters are coming from external CAD systems through attach features in the editor, then the attach feature is refreshed to update the parameters. The editor model is re-generated using the updated parameter values.


UpdateICManagerParam

Update IC Manager Param updates any of the exposed ICManager parameters

Required Arguments

QuantityName    Name of the Quantity To Update
    Type     string
QuantityValue    Double value of the Quantity to update
    Type     double

Data Entities

Geometry

Geometry data object

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
GeometryFilePath

The location of file currently assigned to geometry component. DesignModeler process this file when started through Edit command.

Type     string
Read Only    No
GeometryImportAnalysisType

Analysis Type preference. Import 3D objects or 2D objects (objects must be in the x-y plane)

Type     AnalysisType
Read Only    No
GeometryImportCadAssociativity

Associativity preference. Indicates if action should be taken to allow associativity. This option is present because some CAD systems take too long to compute associativity.

Type     bool
Read Only    No
GeometryImportCadAttributes

Import Attributes preference. Allows import of CAD system attributes into the Mechanical application models. Enable this option to import Motion Loads.

Type     bool
Read Only    No
GeometryImportCadAttributesFilter

Import Attributes filter Key. (Displayed only when Attributes is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported as Attributes.

Type     string
Read Only    No
GeometryImportComparePartsOnUpdate

Compare Parts On Update preference. Runs a post update comparison of parts from the original model and the new one. Marking those which have no topological or geometric changes as unmodified. This marking saves the time for remeshing.

Type     ComparePartsOnUpdateMethod
Read Only    No
GeometryImportComparePartsTolerance

Compare Parts Tolerance Preference. Sets one of three tolerance values for comparison when running Compare Parts On Update

Type     ComparePartsTolerance
Read Only    No
GeometryImportCoordinateSystems

Import Coordinate Systems preference. Specifies whether coordinate systems created in the CAD application should be imported into the Mechanical application.

Type     bool
Read Only    No
GeometryImportCoordinateSystemsFilter

Import Coordinate Systems filter Key. (Displayed only when Coordinate Systems is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported asCoordinate Systems.

Type     string
Read Only    No
GeometryImportDecomposeDisjointFaces

Decompose Disjoint Face preference. Use to turn on/off the breaking of disjoint faces into multiple faces.

Type     bool
Read Only    No
GeometryImportFlattenAssembly

Import Flattened Assembly Preference // hidden

Type     bool
Read Only    No
GeometryImportImportUsingInstances

Import Using Instances preference. Processes a CAD model by honoring its part instances to produce faster attach times and smaller database sizes.

Type     bool
Read Only    No
GeometryImportLineBodies

Import Line Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportMaterialProperties

Import Material Properties preference. Allows import of material data defined in the CAD system. Only a subset of material data will be imported. This will include Young's Modulus, Poisson Ratio, Mass Density, Specific Heat, Thermal Conductivity and Thermal Expansion Coefficient. Limited additional data may be imported depending on CAD support.

Type     bool
Read Only    No
GeometryImportMixedResolutionOption

Mixed Import Resolution preference. Allows parts of mixed dimension to be imported as components of assemblies which have parts of different dimension.

Type     MixedImportPref
Read Only    No
GeometryImportNamedSelections

Import Named Selections preference. Creates a named selection based on data generated in the CAD system or in the DesignModeler application.

Type     bool
Read Only    No
GeometryImportNamedSelectionsFilter

Import Named Selections filter Key. (Displayed only when Named Selections is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported as Named Selections.

Type     string
Read Only    No
GeometryImportParameters

Import Parameters preference. Allows user to turn on or off parameter processing.

Type     CADImportParameterType
Read Only    No
GeometryImportParametersFilter

Import Parameter filter Key. (Displayed only when Parameters is selected.) Allows user to specify a key that must appear at the beginning or end of a CAD parameter name to be imported. If the filter is set to an empty string all CAD parameters will be imported.

Type     string
Read Only    No
GeometryImportProcessEnclosures

Enclosure and Symmetry preference. Use to turn on/off the processing of enclosure and symmetry named selections.

Type     bool
Read Only    No
GeometryImportSavePartFile

Reader Mode Saves Updated File preference. When set to Yes, the interface will save the part file of a model at the end of an update process using the same file name in the same directory.

Type     bool
Read Only    No
GeometryImportSmartUpdate

Smart CAD Update preference. Speeds up refresh of models that have unmodified components. If set to Yes and changes are made to other preferences, these will not be respected if the component is smart updated.

Type     bool
Read Only    No
GeometryImportSolidBodies

Import Solid Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportSpaceClaimExplodeUnsharedComponents

GeometryImportSpaceClaimExplodeUnsharedComponents

Type     bool
Read Only    No
GeometryImportSTLAngleAlgorithmCutAngle

Cut Angle parameter for the Angle Algorithm

Type     double
Read Only    No
GeometryImportSTLAngleAlgorithmToleranceAngle

Tolerance Angle parameter for the Angle Algorithm

Type     double
Read Only    No
GeometryImportSTLCurvatureAlgorithmIgnoreSecondaryNodes

Ignore secondary nodes parameter for the Curvature Algorithm

Type     bool
Read Only    No
GeometryImportSTLCurvatureAlgorithmPlanesToleranceAngle

Planes tolerance parameter for the Curvature Algorithm

Type     double
Read Only    No
GeometryImportSTLCurvatureAlgorithmSharpEdgesAngle

Sharp edges angle parameter for the Curvature Algorithm

Type     double
Read Only    No
GeometryImportSTLSDTAlgorithm

Analysis Type preference. Import 3D objects or 2D objects (objects must be in the x-y plane)

Type     STLSDTAlgorithm
Read Only    No
GeometryImportSurfaceBodies

Import Surface Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportWeightclass

Import Weightclass option

Type     ImportWeightclass
Read Only    No
GeometryImportWorkPoints

Import Work Points preference. Specifies whether work points created in the CAD application should be imported into the Mechanical application.

Type     bool
Read Only    No
PlugInName

Current PlugInName - Returns TempPlugin if active DM session is editing. Otherwise return the real plugin name. This is also not persisted.

Type     string
Read Only    No
TeamcenterConnection

The source string obtained from the Teamcenter, pointing to the NX geometry.

Type     string
Read Only    No

Modeler

Modeler data object

Properties

AttachType

2 = Unknown, 1 = 2D, 0 = 3D

Type     int
Read Only    No
Caption

Caption to identify the model

Type     string
Read Only    No
DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
GeometryFilePath

The location of file currently assigned to geometry component. DesignModeler process this file when started through Edit command.

Type     string
Read Only    No
GeometryImportAnalysisType

Analysis Type preference. Import 3D objects or 2D objects (objects must be in the x-y plane)

Type     AnalysisType
Read Only    No
GeometryImportCadAssociativity

Associativity preference. Indicates if action should be taken to allow associativity. This option is present because some CAD systems take too long to compute associativity.

Type     bool
Read Only    No
GeometryImportCadAttributes

Import Attributes preference. Allows import of CAD system attributes into the Mechanical application models. Enable this option to import Motion Loads.

Type     bool
Read Only    No
GeometryImportCadAttributesFilter

Import Attributes filter Key. (Displayed only when Attributes is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported as Attributes.

Type     string
Read Only    No
GeometryImportComparePartsOnUpdate

Compare Parts On Update preference. Runs a post update comparison of parts from the original model and the new one. Marking those which have no topological or geometric changes as unmodified. This marking saves the time for remeshing.

Type     ComparePartsOnUpdateMethod
Read Only    No
GeometryImportComparePartsTolerance

Compare Parts Tolerance Preference. Sets one of three tolerance values for comparison when running Compare Parts On Update

Type     ComparePartsTolerance
Read Only    No
GeometryImportCoordinateSystems

Import Coordinate Systems preference. Specifies whether coordinate systems created in the CAD application should be imported into the Mechanical application.

Type     bool
Read Only    No
GeometryImportCoordinateSystemsFilter

Import Coordinate Systems filter Key. (Displayed only when Coordinate Systems is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported asCoordinate Systems.

Type     string
Read Only    No
GeometryImportDecomposeDisjointFaces

Decompose Disjoint Face preference. Use to turn on/off the breaking of disjoint faces into multiple faces.

Type     bool
Read Only    No
GeometryImportFlattenAssembly

Import Flattened Assembly Preference // hidden

Type     bool
Read Only    No
GeometryImportImportUsingInstances

Import Using Instances preference. Processes a CAD model by honoring its part instances to produce faster attach times and smaller database sizes.

Type     bool
Read Only    No
GeometryImportLineBodies

Import Line Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportMaterialProperties

Import Material Properties preference. Allows import of material data defined in the CAD system. Only a subset of material data will be imported. This will include Young's Modulus, Poisson Ratio, Mass Density, Specific Heat, Thermal Conductivity and Thermal Expansion Coefficient. Limited additional data may be imported depending on CAD support.

Type     bool
Read Only    No
GeometryImportMixedResolutionOption

Mixed Import Resolution preference. Allows parts of mixed dimension to be imported as components of assemblies which have parts of different dimension.

Type     MixedImportPref
Read Only    No
GeometryImportNamedSelections

Import Named Selections preference. Creates a named selection based on data generated in the CAD system or in the DesignModeler application.

Type     bool
Read Only    No
GeometryImportNamedSelectionsFilter

Import Named Selections filter Key. (Displayed only when Named Selections is selected.) This field can have any number of prefixes with each prefix delimited by a semicolon. If the filter is set to an empty string all applicable entities will be imported as Named Selections.

Type     string
Read Only    No
GeometryImportParameters

Import Parameters preference. Allows user to turn on or off parameter processing.

Type     CADImportParameterType
Read Only    No
GeometryImportParametersFilter

Import Parameter filter Key. (Displayed only when Parameters is selected.) Allows user to specify a key that must appear at the beginning or end of a CAD parameter name to be imported. If the filter is set to an empty string all CAD parameters will be imported.

Type     string
Read Only    No
GeometryImportProcessEnclosures

Enclosure and Symmetry preference. Use to turn on/off the processing of enclosure and symmetry named selections.

Type     bool
Read Only    No
GeometryImportSavePartFile

Reader Mode Saves Updated File preference. When set to Yes, the interface will save the part file of a model at the end of an update process using the same file name in the same directory.

Type     bool
Read Only    No
GeometryImportSmartUpdate

Smart CAD Update preference. Speeds up refresh of models that have unmodified components. If set to Yes and changes are made to other preferences, these will not be respected if the component is smart updated.

Type     bool
Read Only    No
GeometryImportSolidBodies

Import Solid Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportSpaceClaimExplodeUnsharedComponents

GeometryImportSpaceClaimExplodeUnsharedComponents

Type     bool
Read Only    No
GeometryImportSTLAngleAlgorithmCutAngle

Cut Angle parameter for the Angle Algorithm

Type     double
Read Only    No
GeometryImportSTLAngleAlgorithmToleranceAngle

Tolerance Angle parameter for the Angle Algorithm

Type     double
Read Only    No
GeometryImportSTLCurvatureAlgorithmIgnoreSecondaryNodes

Ignore secondary nodes parameter for the Curvature Algorithm

Type     bool
Read Only    No
GeometryImportSTLCurvatureAlgorithmPlanesToleranceAngle

Planes tolerance parameter for the Curvature Algorithm

Type     double
Read Only    No
GeometryImportSTLCurvatureAlgorithmSharpEdgesAngle

Sharp edges angle parameter for the Curvature Algorithm

Type     double
Read Only    No
GeometryImportSTLSDTAlgorithm

Analysis Type preference. Import 3D objects or 2D objects (objects must be in the x-y plane)

Type     STLSDTAlgorithm
Read Only    No
GeometryImportSurfaceBodies

Import Surface Bodies preference. (If mixed dimension parts, Mixed Import Resolution preference is used.)

Type     bool
Read Only    No
GeometryImportWeightclass

Import Weightclass option

Type     ImportWeightclass
Read Only    No
GeometryImportWorkPoints

Import Work Points preference. Specifies whether work points created in the CAD application should be imported into the Mechanical application.

Type     bool
Read Only    No
PlugInName

Current PlugInName - Returns TempPlugin if active DM session is editing. Otherwise return the real plugin name. This is also not persisted.

Type     string
Read Only    No
TeamcenterConnection

The source string obtained from the Teamcenter, pointing to the NX geometry.

Type     string
Read Only    No


Release 18.2 - © ANSYS, Inc. All rights reserved.