Oasys.D3PLOT.Model class¶
Properties¶
- property Model.filename: boolean¶
The model filename
- property Model.number: integer¶
The model number
- property Model.state: integer¶
The state in the model used for scripting methods. Note that this is not the state that is displayed for a model in a graphics window. This property is only used for scripting. Many of the methods in the API depend on which state the model is in and setting this property alters that state. To change the state that is displayed for a model in a graphics window use the GraphicsWindow
state
property
- property Model.states: integer¶
The total number of states in the model
- property Model.title: string¶
The model title
Constructor¶
- classmethod Model(filename)¶
Reads a file into the first free model in D3PLOT
- Parameters:
filename (string) – Filename you want to read
- Returns:
Model object
- Return type:
Model
Example
To create a model in D3PLOT for the file /data/test/file.ptf
m = Oasys.D3PLOT.Model("/data/test/file.ptf")
Static methods¶
- classmethod Model.First()¶
Returns the Model object for the first model in D3PLOT (or None if there are no models)
- Returns:
Model object
- Return type:
Model
Example
To get the Model object for the first model:
m = Oasys.D3PLOT.Model.First()
- classmethod Model.GetFromID(model_number)¶
Returns the Model object for a model ID (or None if model does not exist)
- Parameters:
model_number (integer) – number of the model you want the Model object for
- Returns:
Model object
- Return type:
Model
Example
To get the Model object for model number 1
m = Oasys.D3PLOT.Model.GetFromID(1)
- classmethod Model.Highest()¶
Returns the highest model number in D3PLOT (or 0 if no models). Also see
Total()
- Returns:
Highest model number
- Return type:
integer
Example
To get the highest model number:
highest = Oasys.D3PLOT.Model.Highest()
- classmethod Model.Last()¶
Returns the Model object for the last model in D3PLOT (or None if there are no models)
- Returns:
Model object
- Return type:
Model
Example
To get the Model object for the last model:
m = Oasys.D3PLOT.Model.Last()
- classmethod Model.Read(filename)¶
Reads a file into D3PLOT
- Parameters:
filename (string) – Filename you want to read
- Returns:
Model object
- Return type:
Model
Example
To create a model in D3PLOT from the file /data/test/file.ptf
m = Oasys.D3PLOT.Model.Read("/data/test/file.ptf")
Instance methods¶
- Model.ClearFlag(flag)¶
Clears a flag on all of the items in the model
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to clear- Returns:
No return value
- Return type:
None
Example
To clear flag f on all items in model m:
m.ClearFlag(f)
- Model.Delete()¶
Deletes a model in D3PLOT
Do not use the Model object after calling this method
- Returns:
No return value
- Return type:
None
Example
To delete model m in D3PLOT
m.Delete()
- Model.GraphicsWindows()¶
Returns the graphics window(s) that the model exists in
- Returns:
Array of
GraphicsWindow
objects- Return type:
array
Example
To get the graphics windows model m exists in:
list = m.GraphicsWindows()
- Model.Next()¶
Returns the next model (or None if there is not one)
- Returns:
Model object
- Return type:
Model
Example
To get the model after model m:
m = m.Next()
- Model.Previous()¶
Returns the previous model (or None if there is not one)
- Returns:
Model object
- Return type:
Model
Example
To get the model before model m:
m = m.Previous()
- Model.ReadPropertiesFile(filename, info=Oasys.gRPC.defaultArg)¶
Reads a properties file for the model
- Parameters:
filename (string) – Filename for the properties file you want to read
info (dict) –
Optional. Dictionary containing the information to set. Can be any of:
- ignoreElements:
(boolean) Ignore any element properties in the properties file and only process part based entries (default is false)
- preBlank:
(boolean) Blank everything in the model before reading the properties file (default is false)
- Returns:
No return value
- Return type:
None
Example
To read the properties file /data/test/my_properties.prp for model m:
m.ReadPropertiesFile("/data/test/my_properties.prp")
- Model.Reread()¶
Rereads the model
- Returns:
No return value
- Return type:
None
Example
To reread model m:
m.Reread()
- Model.Rescan()¶
Rescans the model
- Returns:
No return value
- Return type:
None
Example
To rescan model m:
m.Rescan()