Material Designer

Material Designer
This container holds data for an instance of Material Designer.

Methods

ClearGeneratedData

ClearGeneratedData command clears the generated data of a Material Designer cell.

After successful execution of this command, the Material Designer component goes into "update required" state.


Edit

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

If a scdoc file is assigned to Material Designer component, the file is loaded in the Material Designer.

Available options:

Interactive This optional boolean type argument indicates whether Material Designer 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
StartupArguments    Additional arguments to send to Material Designer. These are to be supplied as comand line options when we launch Material Designer.
    Type    string

Exit

Exit command shuts down the running session of Material Designer. Before shuting down, Material Designer saves its database.

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


GetMaterialDesignerProperties

Return a reference to DataEntity managing property settings of Material Designer Container.

Return     Reference to DataEntity managing Material Designer properties
    Type     DataReference

RefreshMD

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

After successful execution of this command, the Material Designer component goes into "update required" state.


RunScript

Executes a script in the assigned Material Designer, which must be running. It will accept Python (.py), SpaceClaim Script (.scscript) and SpaceClaim Journal (.scjournal) files.

Required Parameters:

ScriptFilePath of the script file to be run.

Required Arguments

ScriptFile    Path of the script file
    Type    string

SendCommand

The SendCommand sends Python or SpaceClaim Journal command string to Material Designer for execution. If Material Designer is not open, it will be launched to execute commands, and then closed. If it is already running, it will keep running after the command execution.

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

Available options:

Command Language
Python or SpaceClaim journal command string containing scripting commands for Material Designer Language of the command. Allowed values are: "Python" and "SCJournal". The default language is "Python"

The following command will create a block body in the Material Designer editor.

Required Arguments

Command    Command string
    Type    string

Optional Arguments

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

    system1 = GetSystem(Name="MD")
    materialDesigner1 = system1.GetContainer(ComponentName="MD")
    materialDesigner1.SendCommand( Command = """result = BlockBody.Create(Point.Create(UM(-10), UM(-10), UM(0)), Point.Create(UM(10), UM(10), UM(20)), ExtrudeType.Add)""")


Stop

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

Material Designer can not be stopped if it is busy. In such situations, this command throws an ApplicationBusyException exception.


Data Entities

MaterialDesigner

Material Designer 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 the Material Designer component. Material Designer processes this file when started through Edit command.

Type     string
Read Only    No
PlugInName

Current PlugInName - Returns plugin name. This is not persisted.

Type     string
Read Only    No