The Part class gives you access to parts 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 |
| composite (read only) | logical | If this is a PART_COMPOSITE. Can be true or false. If there is no ztf file for the model this will be false. |
| data (read only) | real|array | Component data for a part passed as an argument to GetMultipleData. Note that data will only exist for the instance of the part passed to GetMultipleData. i.e. it is a local property stored on the specific instance. It is not stored in the D3PLOT database |
| elementType (read only) | constant | The type of elements in the part. e.g. Type.SHELL, Type.SOLID etc |
| include (read only) | integer | The include file number in the model that the part is in |
| index (read only) | integer | The internal index for the part in D3PLOT (starting at 0) |
| label (read only) | integer | The Ansys LS-DYNA label for the part |
| material (read only) | Material | The Material the part has. This is only available if there is a ztf file for the model. If not null will be returned. If this is a PART_COMPOSITE then null will be returned. Part.GetCompositeData should be used to get material data in this case |
| model (read only) | Model | The Model that the part is in |
| nip (read only) | integer | Number of integration points (layers) present for _COMPOSITE parts |
| title (read only) | string | The title for the part (or null if no title) |
| type (read only) | constant | The type for the part (will be Type.PART) |
Detailed DescriptionThe Part class allows you to inspect parts in a model. See the documentation below for more details. |
Details of functionsBlank(window[GraphicsWindow])DescriptionBlanks the part in a graphics window |
GraphicsWindow) to blank the part in
ReturnsNo return value |
ExampleTo blank part p in graphics window g: p.Blank(g);
|
BlankAll(window[GraphicsWindow], model[Model]) [static]DescriptionBlanks all of the parts in the model |
GraphicsWindow) to blank the parts in
Model that all the parts will be blanked in
ReturnsNo return value |
ExampleTo blank all of the parts in model m, in graphics window gw: Part.BlankAll(gw, m);
|
BlankFlagged(window[GraphicsWindow], model[Model], flag[Flag]) [static]DescriptionBlanks all of the parts in the model flagged with a defined flag |
GraphicsWindow) to blank the parts in
Model that the flagged parts will be blanked in
Flag (see AllocateFlag) set on the parts to blank
ReturnsNo return value |
ExampleTo blank all of the parts flagged with flag f in model m, in graphics window gw: Part.BlankFlagged(gw, m, f);
|
Blanked(window[GraphicsWindow])DescriptionChecks if the part is blanked in a graphics window or not |
GraphicsWindow) in which to check if the part is blanked
Returnstrue if blanked, false if not Return typeboolean |
ExampleTo check if part p is blanked in graphics window g: if (p.Blanked(g) ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on a part |
Flag (see AllocateFlag) to clear on the part
ReturnsNo return value |
ExampleTo clear flag f on part p: p.ClearFlag();
|
Elements()DescriptionReturns an array containing the elements in the part |
No arguments
ReturnsArray of element objects Return typearray |
ExampleTo return the elements for part p: var elements = p.Elements();
|
First(model[Model]) [static]DescriptionReturns the first part in the model (or null if there are no parts in the model) |
Model to get first part in
ReturnsPart object Return typePart |
ExampleTo get the first part in model m: var p = Part.First(m);
|
FlagAll(model[Model], flag[Flag]) [static]DescriptionFlags all of the parts in the model with a defined flag |
Model that all the parts will be flagged in
Flag (see AllocateFlag) to set on the parts
ReturnsNo return value |
ExampleTo flag all of the parts with flag f in model m: Part.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the part is flagged or not |
Flag (see AllocateFlag) to test on the part
Returnstrue if flagged, false if not Return typeboolean |
ExampleTo check if part p has flag f set on it: if (p.Flagged(f) ) do_something...
|
GetAll(model[Model], property (optional)[string]) [static]DescriptionReturns an array of Part objects or properties for all of the parts in the model. If the optional property argument is not given then an array of Part objects is returned. If the property argument is given, that property value for each part is returned in the array instead of a Part object |
Model that all the parts are in
Name for property to get for all parts in the model
ReturnsArray of Part objects or properties Return typeArray |
GetCompositeData(ipt[integer])DescriptionReturns the composite data for an integration point in *PART_COMPOSITE. |
The integration point you want the data for. Note that integration points start at 0, not 1.
ReturnsAn array containing the material id and thickness values. Return typeArray |
ExampleTo get the composite data for the 3rd integration point for part p: if (p.composite && p.nip >= 3)
{
var ipt_data = p.GetCompositeData(2);
}
|
GetData(component[constant], options (optional)[object])DescriptionReturns the value for a data component. |
Component constant to get data for
Object containing options for getting data. Can be any of:
Object has the following properties:
| Name | Type | Description |
| extra | integer | The extra data component number if component Component.SOX for solids, Component.BMX for beams or Component.SHX for shells and thick shells |
| ip | integer | Integration point number to get the data at (ip >= 1 or one of the constants Constant.TOP, Constant.MIDDLE or Constant.BOTTOM). If the integration point is not defined it will use the integration point defined on the current GUI "data" panel, which defaults to the middle surface for shells, thick shells, and solids, and Mag All for beams, but may vary if changed by an interactive user. If consistent output from a script is required, independent of any prior interactive activity, an explicit integration point or surface should be defined |
| op | integer | On plane integration point number for shells and thick shells (op >= 1 [default]) |
| referenceFrame | constant | The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL. This is only necessary for directional components (eg X stress) and then only when something other than the default Constant.GLOBAL coordinate system is to be used |
| user | integer | The user-defined component number if component Component.UNOS, Component.UNOV, Component.USSS, Component.USST, Component.UBMS or Component.UBMV |
GetFlagged(model[Model], flag[Flag], property (optional)[string]) [static]DescriptionGets all of the parts in the model flagged with a defined flag. If the optional property argument is not given then an array of Part objects is returned. If the property argument is given, that property value for each part is returned in the array instead of a Part object |
Model that the flagged parts are in
Flag (see AllocateFlag) set on the parts to get
Name for property to get for all flagged parts in the model
ReturnsArray of Part objects or properties Return typeArray |
GetFromID(model[Model], label[integer]) [static]DescriptionReturns the Part object for part in model with label (or null if it does not exist) |
Model to get part in
The Ansys LS-DYNA label for the part in the model
ReturnsPart object Return typePart |
ExampleTo get the part in model m with label 1000: var p = Part.GetFromID(m, 1000);
|
GetFromIndex(model[Model], index[integer]) [static]DescriptionReturns the Part object for part in model with index (or null if it does not exist) |
Model to get part in
The D3PLOT internal index in the model for part, starting at 0.
ReturnsPart object Return typePart |
ExampleTo get the 51st part in model m: var p = Part.GetFromIndex(m, 50);
|
GetMultipleData(component[constant], items[array], options (optional)[object]) [static]DescriptionReturns the value for a data component for multiple parts. For each part a local property called data will be created
containing a number if a scalar component, or an array if a vector or tensor component (or null if the value cannot be calculated).
The data is also returned as an object. |
Component constant to get data for
Array of Part objects to get the data for. All of the parts must be in the same model.
Object containing options for getting data. Can be any of:
Object has the following properties:
| Name | Type | Description |
| extra | integer | The extra data component number if component Component.SOX for solids, Component.BMX for beams or Component.SHX for shells and thick shells |
| ip | integer | Integration point number to get the data at (ip >= 1 or one of the constants Constant.TOP, Constant.MIDDLE or Constant.BOTTOM) |
| op | integer | On plane integration point number for shells and thick shells (op >= 1 [default]) |
| referenceFrame | constant | The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL. This is only necessary for directional components (eg X stress) and then only when something other than the default Constant.GLOBAL coordinate system is to be used |
| user | integer | The user-defined component number if component Component.UNOS, Component.UNOV, Component.USSS, Component.USST, Component.UBMS or Component.UBMV |
Last(model[Model]) [static]DescriptionReturns the last part in the model (or null if there are no parts in the model) |
Model to get last part in
ReturnsPart object Return typePart |
ExampleTo get the last part in model m: var p = Part.Last(m);
|
Next()DescriptionReturns the next part in the model (or null if there is not one) |
No arguments
ReturnsPart object Return typePart |
ExampleTo get the next part after part p: p = p.Next();
|
Pick() [static]DescriptionAllows the user to pick a part from the screen |
No arguments
ReturnsPart object or null if cancelled Return typePart |
ExampleTo pick a part: var p = Part.Pick();
|
Previous()DescriptionReturns the previous part in the model (or null if there is not one) |
No arguments
ReturnsPart object Return typePart |
ExampleTo get the previous part before part p: p = p.Previous();
|
Select(flag[Flag]) [static]DescriptionSelects parts using an object menu |
Flag (see AllocateFlag) to use when selecting parts
ReturnsThe number of parts selected or null if menu cancelled Return typeinteger |
ExampleTo select parts, flagging those selected with flag f: var total = Part.Select(f);
|
SetFlag(flag[Flag])DescriptionSets a flag on a part |
Flag (see AllocateFlag) to set on the part
ReturnsNo return value |
ExampleTo set flag f on part p: p.SetFlag(f);
|
Total(model[Model]) [static]DescriptionReturns the total number of parts in the model |
Model to get total in
ReturnsThe number of parts Return typeinteger |
ExampleTo get the number of parts in model m: var total = Part.Total(m);
|
Unblank(window[GraphicsWindow])DescriptionUnblanks the part in a graphics window |
GraphicsWindow) to unblank the part in
ReturnsNo return value |
ExampleTo unblank part p in graphics window g: p.Unblank(g);
|
UnblankAll(window[GraphicsWindow], model[Model]) [static]DescriptionUnblanks all of the parts in the model |
GraphicsWindow) to unblank the parts in
Model that all the parts will be unblanked in
ReturnsNo return value |
ExampleTo unblank all of the parts in model m, in graphics window gw: Part.UnblankAll(gw, m);
|
UnblankFlagged(window[GraphicsWindow], model[Model], flag[Flag]) [static]DescriptionUnblanks all of the parts in the model flagged with a defined flag |
GraphicsWindow) to unblank the parts in
Model that the flagged parts will be unblanked in
Flag (see AllocateFlag) set on the parts to unblank
ReturnsNo return value |
ExampleTo unblank all of the parts flagged with flag f in model m, in graphics window gw: Part.UnblankFlagged(gw, m, f);
|
UnflagAll(model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the parts in the model |
Model that the defined flag for all parts will be unset in
Flag (see AllocateFlag) to unset on the parts
ReturnsNo return value |
ExampleTo unset flag f on all of the parts in model m: Part.UnflagAll(m, f);
|