The Model class gives you access to models in D3PLOT. More...
The D3PLOT JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Type | Description |
| filename (read only) | boolean | The model filename |
| number (read only) | integer | The model number |
| 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 some of the scripting methods. Many of the methods in the API depend on which state the model is in and setting this property alters that state. To set the state used for all the "get" and "put" functions which handle model-related data use this property. To change the state that is displayed for a model in a graphics window use the GraphicsWindow state property |
| states | integer | The total number of states in the model |
| title | string | The model title |
Constructornew Model(filename[string])DescriptionReads a file into the first free model in D3PLOT |
Filename you want to read
ReturnsModel object Return typeModel |
ExampleTo create a model in D3PLOT for the file /data/test/file.ptf var m = new Model("/data/test/file.ptf");
|
Details of functionsClearFlag(flag[Flag])DescriptionClears a flag on all of the items in the model |
Flag (see AllocateFlag) to clear
ReturnsNo return value |
ExampleTo clear flag f on all items in model m: m.ClearFlag(f);
|
Delete()DescriptionDeletes a model in D3PLOT |
No arguments
ReturnsNo return value |
ExampleTo delete model m in D3PLOT m.Delete();
|
First() [static]DescriptionReturns the Model object for the first model in D3PLOT (or null if there are no models) |
No arguments
ReturnsModel object Return typeModel |
ExampleTo get the Model object for the first model: var m = Model.First();
|
GetFromID(model number[integer]) [static]DescriptionReturns the Model object for a model ID (or null if model does not exist) |
number of the model you want the Model object for
ReturnsModel object Return typeModel |
ExampleTo get the Model object for model number 1 var m = Model.GetFromID(1);
|
GraphicsWindows()DescriptionReturns the graphics window(s) that the model exists in |
No arguments
ReturnsArray of GraphicsWindow objects Return typearray |
ExampleTo get the graphics windows model m exists in: var list = m.GraphicsWindows();
|
Highest() [static]DescriptionReturns the highest model number in D3PLOT (or 0 if no models). Also see Total() |
No arguments
ReturnsHighest model number Return typeinteger |
ExampleTo get the highest model number: var highest = Model.Highest();
|
Last() [static]DescriptionReturns the Model object for the last model in D3PLOT (or null if there are no models) |
No arguments
ReturnsModel object Return typeModel |
ExampleTo get the Model object for the last model: var m = Model.Last();
|
Next()DescriptionReturns the next model (or null if there is not one) |
No arguments
ReturnsModel object Return typeModel |
ExampleTo get the model after model m: m = m.Next();
|
Previous()DescriptionReturns the previous model (or null if there is not one) |
No arguments
ReturnsModel object Return typeModel |
ExampleTo get the model before model m: m = m.Previous();
|
Read(filename[string]) [static]DescriptionReads a file into D3PLOT |
Filename you want to read
ReturnsModel object Return typeModel |
ExampleTo create a model in D3PLOT from the file /data/test/file.ptf var m = Model.Read("/data/test/file.ptf");
|
ReadPropertiesFile(filename[string], info (optional)[object])DescriptionReads a properties file for the model |
Filename for the properties file you want to read
Object containing the information to set. Can be any of:
Object has the following properties:
| Name | Type | Description |
| 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) |
ReturnsNo return value |
ExampleTo read the properties file /data/test/my_properties.prp for model m: m.ReadPropertiesFile("/data/test/my_properties.prp");
|
Reread()DescriptionRereads the model |
No arguments
ReturnsNo return value |
ExampleTo reread model m: m.Reread();
|
Rescan()DescriptionRescans the model |
No arguments
ReturnsNo return value |
ExampleTo rescan model m: m.Rescan();
|
Time(state[integer])DescriptionReturns the analysis time for a particular state in the model |
The state you want to get the time for (0 <= state <= states)
ReturnsAnalysis time Return typereal |
ExampleTo get the analysis time for state 10 in model m: var time = m.Time(10);
|
Total() [static]DescriptionReturns the total number of models in use in D3PLOT. Also see Highest() |
No arguments
ReturnsTotal number of models in use Return typeinteger |
ExampleTo get total number of models: var total = Model.Total();
|