The Part class gives you access to part cards in PRIMER. More...
The PRIMER 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 |
| adpopt | integer | Adaptivity flag |
| ansid | integer | Attachment node set ID |
| attachment_nodes | logical | If _ATTACHMENT_NODES option is set. Can be true or false |
| averaged | logical | If _AVERAGED option is set. Can be true or false |
| cadname | string | CAD name stored for Part (or null if doesn't exist). This property is only used by PRIMER. |
| cid | integer | Coordinate system number |
| cmsn | integer | CAL3D/MADYMO number |
| colour | Colour | The colour of the part |
| composite | logical | If _COMPOSITE option is set. Can be true or false |
| composite_long | logical | If _COMPOSITE_LONG option is set. Can be true or false |
| contact | logical | If _CONTACT option is set. Can be true or false |
| dc | real | Exponential decay coefficient |
| element_type (read only) | string | The type of elements the Part contains. e.g. "SHELL", "SOLID" or null if empty/no section. |
| elform | integer | Element formulation |
| eosid | integer or string | Equation of state number or character label |
| exists (read only) | logical | true if part exists, false if referred to but not defined. |
| fd | real | Dynamic coefficient of friction |
| fs | real | Static coefficient of friction |
| grav | integer | Gravity loading |
| heading | string | Part heading |
| hgid | integer or string | Hourglass number or character label |
| hmname | string | Hypermesh comment read from keyword file for Part (or null if doesn't exist). |
| iga_shell | logical | If _COMPOSITE_IGA_SHELL option is set. Can be true or false |
| include | integer | The Include file number that the part is in. |
| inertia | logical | If _INERTIA option is set. Can be true or false |
| ircs | integer | Flag for inertia tensor reference coordinate system |
| irl | integer | Lamina integration rule |
| ixx | real | Ixx component of inertia tensor |
| ixy | real | Ixy component of inertia tensor |
| ixz | real | Ixz component of inertia tensor |
| iyy | real | Iyy component of inertia tensor |
| iyz | real | Iyz component of inertia tensor |
| izz | real | Izz component of inertia tensor |
| label | integer or string | Part number or character label. Also see the pid property which is an alternative name for this. |
| marea | real | Non structural mass per unit area |
| mdep | integer | MADYMO ellipse/plane number |
| mid | integer or string | Material number or character label |
| model (read only) | integer | The Model number that the part is in. |
| movopt | integer | Flag to deactivate moving for merged rigid bodies |
| nip | integer | Number of integration points (layers) present for _COMPOSITE parts |
| nloc | integer | Location of reference surface |
| nodeid | integer | Node ID for centre of rigid body |
| optt | real | Contact thickness |
| pid | integer or string | Part number or character label. Also see the label property which is an alternative name for this. |
| prbf | integer | Print flag for RBDOUT and MATSUM files |
| logical | If _PRINT option is set. Can be true or false | |
| reposition | logical | If _REPOSITION option is set. Can be true or false |
| rigid (read only) | logical | true if part is rigid, false if deformable. |
| secid | integer or string | Section number or character label |
| sft | real | Thickness scale factor |
| shrf | real | Shear correction factor |
| ssf | real | Scale factor on default surfA penalty stiffness |
| thshel | integer | Thermal shell formulation |
| tm | real | total mass |
| tmid | integer or string | Thermal material number or character label |
| transparency | integer | The transparency of the part (0-100) 0% is opaque, 100% is transparent. |
| tshear | integer | Flag for transverse shear strain distribution |
| tshell | logical | If _COMPOSITE_TSHELL option is set. Can be true or false |
| vc | real | Coefficient for viscous friction |
| vrx | real | x rotational velocity |
| vry | real | y rotational velocity |
| vrz | real | z rotational velocity |
| vtx | real | x translational velocity |
| vty | real | y translational velocity |
| vtz | real | z translational velocity |
| xc | real | x coordinate of centre of mass |
| xl | real | x coordinate of local x axis |
| xlip | real | x coordinate of vector in local xy plane |
| yc | real | y coordinate of centre of mass |
| yl | real | y coordinate of local x axis |
| ylip | real | y coordinate of vector in local xy plane |
| zc | real | z coordinate of centre of mass |
| zl | real | z coordinate of local x axis |
| zlip | real | z coordinate of vector in local xy plane |
Detailed DescriptionThe Part class allows you to create, modify, edit and manipulate part cards. See the documentation below for more details. |
Constructornew Part(Model[Model], pid[integer or string], secid[integer or string], mid[integer or string], heading (optional)[string])DescriptionCreate a new Part object. |
Model that part will be created in
Part number or character label
Section number or character label
Material number or character label
Title for the part
ReturnsPart object Return typePart |
ExampleTo create a new part called 'Example' in model m with label 100, section 1, material 10: var p = new Part(m, 100, 1, 10, 'Example');
|
Details of functionsAllTableProperties(Model[Model]) [static]DescriptionReturns all of the properties available in the part table for the parts. The table values are returned in an array of objects (an object for each part). The object property names are the same as the table headers but spaces are replaced with underscore characters and characters other than 0-9, a-z and A-Z are removed to ensure that the property name is valid in JavaScript. If a table value is undefined the property value will be the JavaScript undefined value. If the table value is a valid number it will be a number, otherwise the value will returned as a string. |
Model that the flagged parts are in
ReturnsArray of objects Return typeArray |
AssociateComment(Comment[Comment])DescriptionAssociates a comment with a part. |
Comment that will be attached to the part
ReturnsNo return value |
ExampleTo associate comment c to the part p: p.AssociateComment(c);
|
Blank()DescriptionBlanks the part |
No arguments
ReturnsNo return value |
ExampleTo blank part p: p.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the parts in the model. |
Model that all parts will be blanked in
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo blank all of the parts in model m: Part.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged parts in the model. |
Model that all the flagged parts will be blanked in
Flag set on the parts that you want to blank
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo blank all of the parts in model m flagged with f: Part.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the part is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if part p is blanked: if (p.Blanked() ) do_something...
|
Browse(modal (optional)[boolean])DescriptionStarts an edit panel in Browse mode. |
If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.
Returnsno return value |
ExampleTo Browse part p: p.Browse();
|
CentreOfGravity(options (optional)[object])DescriptionReturns the centre of gravity for a part. |
Options specifying how the mass calculation should be done.
Object has the following properties:
| Name | Type | Description |
| constrainedparts (optional) | boolean | Mass of rigid lead part includes mass of its constrained parts. On by default. |
| lumpedmass (optional) | boolean | Lumped mass is included for deformable parts. Off by default. |
| nrbmass (optional) | boolean | NRB mass is included for deformable parts. Off by default. (tranfermass:true required for this option) |
| plot (optional) | boolean | Plot CofG. |
| skipconstrained (optional) | boolean | Constrained rigid part is assigned zero mass (if constrainedparts = true). On by default. |
| timestepmass (optional) | boolean | Timestep added mass is included for deformable parts. Off by default. |
| transfermass (optional) | boolean | Mass of deformable nodes attached to rigid part/nrb is transferred. On by default. |
ReturnsAn array containing the x, y and z coordinates for the CofG. Return typeArray |
If set, centre of gravity calculation for deformable parts includes lumped mass, mass of nodal rigid bodies and timestep added mass.
ReturnsAn array containing the x, y and z coordinates for the CofG. Return typeArray |
ExampleTo get the centre of gravity for part p: var cofg = p.CentreOfGravity();
var x = cofg[0];
var y = cofg[1];
var z = cofg[2];
|
ClearFlag(flag[Flag])DescriptionClears a flag on the part. |
Flag to clear on the part
ReturnsNo return value |
ExampleTo clear flag f for part p: p.ClearFlag(f);
|
ClosestNode(x[real], y[real], z[real])DescriptionFinds the Node on the part closest to a coordinate. |
X coordinate of point
Y coordinate of point
Z coordinate of point
ReturnsID of Node or null if part has no nodes Return typeNumber |
ExampleTo find the node on part p closest to point (1, 2, 3): var n = p.ClosestNode(1, 2, 3);
|
Copy(range (optional)[boolean])DescriptionCopies the part. The target include of the copied part can be set using Options.copy_target_include. |
If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer().
ReturnsPart object Return typePart |
ExampleTo copy part p into part z: var z = p.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a part |
Model that the part will be created in.
If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.
ReturnsPart object (or null if not made). Return typePart |
ExampleTo start creating a part in model m: var p = Part.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a part. |
Comment that will be detached from the part
ReturnsNo return value |
ExampleTo detach comment c from the part p: p.DetachComment(c);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel. |
If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.
Returnsno return value |
ExampleTo Edit part p: p.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for part. For more details on checking see the Check class. |
The error message to give
An optional detailed error message
ReturnsNo return value |
ExampleTo add an error message "My custom error" for part p: p.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for part. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing part p: var colour = p.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first part in the model. |
Model to get first part in
ReturnsPart object (or null if there are no parts in the model). Return typePart |
ExampleTo get the first part in model m: var p = Part.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free part label in the model. Also see Part.LastFreeLabel(), Part.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free part label in
Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels).
ReturnsPart label. Return typeNumber |
ExampleTo get the first free part label in model m: var label = Part.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the parts in the model with a defined flag. |
Model that all parts will be flagged in
Flag to set on the parts
ReturnsNo return value |
ExampleTo flag all of the parts with flag f in model m: Part.FlagAll(m, f);
|
FlagVisible(Model[Model], flag[Flag]) [static]DescriptionFlags all the unblanked parts in the model. |
Model for which all unblanked parts will be flagged in
Flag to set on the unblanked parts
ReturnsNo return value |
ExampleTo flag all unblanked parts in model m with flag f: Part.FlagVisible(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the part is flagged or not. |
Flag 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...
|
FlaggedTableProperties(Model[Model], flag[Flag]) [static]DescriptionReturns all of the properties available in the part table for the flagged parts. The table values are returned in an array of objects (an object for each part). The object property names are the same as the table headers but spaces are replaced with underscore characters and characters other than 0-9, a-z and A-Z are removed to ensure that the property name is valid in JavaScript. If a table value is undefined the property value will be the JavaScript undefined value. If the table value is a valid number it will be a number, otherwise the value will returned as a string. |
Model that the flagged parts are in
Flag set on the parts that you want properties for
ReturnsArray of objects Return typeArray |
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each part in the model. |
Model that all parts are in
Function to call for each part
An optional extra object/array/string etc that will appended to arguments when calling the function
ReturnsNo return value |
GetAll(Model[Model], property (optional)[string]) [static]DescriptionReturns an array of Part objects or properties for all of the parts in a model in PRIMER. 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 to get parts from
Name for property to get for all parts in the model
ReturnsArray of Part objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a part. |
No arguments
ReturnsArray of Comment objects (or null if there are no comments associated to the node). Return typeArray |
ExampleTo get the array of comments associated to the part p: var comm_array = p.GetComments();
|
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.
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);
}
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of Part objects for all of the flagged parts in a model in PRIMER If the optional property argument is not given then an array of Part objects is returned. If the property argument is given, then that property value for each part is returned in the array instead of a Part object |
Model to get parts from
Flag set on the parts that you want to retrieve
Name for property to get for all flagged parts in the model
ReturnsArray of Part objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the Part object for a part ID. |
Model to find the part in
number of the part you want the Part object for
ReturnsPart object (or null if part does not exist). Return typePart |
ExampleTo get the Part object for part 100 in model m var p = Part.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a Part property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the Part.ViewParameters() method and 'method chaining' (see the examples below). |
part property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this part (*PART, *PART_SCALAR or *PART_SCALAR_VALUE). Note that a carriage return is not added. See also Part.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for part p: var key = p.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the part. Note that a carriage return is not added. See also Part.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for part p: var cards = p.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last part in the model. |
Model to get last part in
ReturnsPart object (or null if there are no parts in the model). Return typePart |
ExampleTo get the last part in model m: var p = Part.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free part label in the model. Also see Part.FirstFreeLabel(), Part.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free part label in
Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.
ReturnsPart label. Return typeNumber |
ExampleTo get the last free part label in model m: var label = Part.LastFreeLabel(m);
|
Mass()DescriptionReturns the mass properties for a part. |
No arguments
Returns |
Object with the following properties:
| Name | Type | Description |
| Assign_Mass | real | Assign mass |
| Component_Mass | real | Component mass |
| Dyna_Added_Mass | real | Dyna added mass |
| Dyna_Part_Mass | real | Dyna part mass |
| Lumped_Mass | real | Lumped mass |
| NRB_Mass | real | NRB mass |
| NS_Mass | real | Non-structural mass |
| Struct_Mass | real | Structural mass |
| Transferrd_Mass | real | Transferred mass when deformable meshed to rigid |
object
ExampleTo get the structural mass for part p: var mprops = p.Mass();
var struct_mass = mprops.Struct_Mass;
|
MaxMin()DescriptionReturns the max and min bounds of a part |
No arguments
ExampleTo get the bounds for part p: var bounds = p.MaxMin();
if (bounds) {
xMin = bounds[0];
xMax = bounds[1];
yMin = bounds[2];
yMax = bounds[3];
zMin = bounds[4];
zMax = bounds[5];
}
|
MeasurePartToPart(part1[Part], part2[Part]) [static]DescriptionThis static method measures the distance between two part objects contained in the same model or in two different models |
Part to measure from
Part to measure to
Returns |
Object with the following properties:
| Name | Type | Description |
| distance | real | Distance between the two parts |
| vector | Array of reals | Components of distance vector |
object
Next()DescriptionReturns the next part in the model. |
No arguments
ReturnsPart object (or null if there are no more parts in the model). Return typePart |
ExampleTo get the part in model m after part p: var p = p.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) part label in the model. Also see Part.FirstFreeLabel(), Part.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free part label in
Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels).
ReturnsPart label. Return typeNumber |
ExampleTo get the next free part label in model m: var label = Part.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a part. |
Text to display as a prompt to the user
If the argument is a Model then only parts from that model can be picked. If the argument is a Flag then only parts that are flagged with limit can be selected. If omitted, or null, any parts from any model can be selected. from any model.
If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal.
By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.
ReturnsPart object (or null if not picked) Return typePart |
ExampleTo pick a part from model m giving the prompt 'Pick part from screen': var p = Part.Pick('Pick part from screen', m);
|
Previous()DescriptionReturns the previous part in the model. |
No arguments
ReturnsPart object (or null if there are no more parts in the model). Return typePart |
ExampleTo get the part in model m before part p: var p = p.Previous();
|
RemoveCompositeData(ipt[integer])DescriptionRemoves the composite data for an integration point in *PART_COMPOSITE. |
The integration point you want to remove. Note that integration points start at 0, not 1.
ReturnsNo return value. |
ExampleTo remove the composite data for the 3rd integration point for part p: p.RemoveCompositeData(2);
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the parts in the model. |
Model that all parts will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the parts in model m, from 1000000: Part.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged parts in the model. |
Model that all the flagged parts will be renumbered in
Flag set on the parts that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the parts in model m flagged with f, from 1000000: Part.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select parts using standard PRIMER object menus. |
Flag to use when selecting parts
Text to display as a prompt to the user
If the argument is a Model then only parts from that model can be selected. If the argument is a Flag then only parts that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any parts can be selected. from any model.
If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal.
ReturnsNumber of parts selected or null if menu cancelled Return typeNumber |
The integration point you want to set the data for. Note that integration points start at 0, not 1.
Material ID for the integration point.
Thickness of the integration point.
Material angle of the integration point.
Thermal material ID for the integration point.
Ply ID for the integration point. This should be used if the _COMPOSITE_LONG option is set for the part.
Transverse shear stress scale factor.
ReturnsNo return value. |
ExampleTo set the composite data for the 3rd integration point to mat 1, thickness 0.5 and angle 45, for part p: p.SetCompositeData(2, 1, 0.5, 45);
|
SetFlag(flag[Flag])DescriptionSets a flag on the part. |
Flag to set on the part
ReturnsNo return value |
ExampleTo set flag f for part p: p.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the part. The part will be sketched until you either call Part.Unsketch(), Part.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the part is sketched. If omitted redraw is true. If you want to sketch several parts and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch part p: p.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged parts in the model. The parts will be sketched until you either call Part.Unsketch(), Part.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged parts will be sketched in
Flag set on the parts that you want to sketch
If model should be redrawn or not after the parts are sketched. If omitted redraw is true. If you want to sketch flagged parts several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all parts flagged with flag in model m: Part.SketchFlagged(m, flag);
|
No arguments
Returnsobject. Return typeObject |
ExampleTo get all of the properties for part p: var properties = p.TableProperties();
for (var x in properties)
{
Message(x+"="+properties[x]);
}
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of parts in the model. |
Model to get total for
true if only existing parts should be counted. If false or omitted referenced but undefined parts will also be included in the total.
Returnsnumber of parts Return typeNumber |
ExampleTo get the total number of parts in model m: var total = Part.Total(m);
|
Unblank()DescriptionUnblanks the part |
No arguments
ReturnsNo return value |
ExampleTo unblank part p: p.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the parts in the model. |
Model that all parts will be unblanked in
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo unblank all of the parts in model m: Part.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged parts in the model. |
Model that the flagged parts will be unblanked in
Flag set on the parts that you want to unblank
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo unblank all of the parts in model m flagged with f: Part.UnblankFlagged(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 to unset on the parts
ReturnsNo return value |
ExampleTo unset the flag f on all the parts in model m: Part.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the part. |
If model should be redrawn or not after the part is unsketched. If omitted redraw is true. If you want to unsketch several parts and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch part p: p.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all parts. |
Model that all parts will be unblanked in
If model should be redrawn or not after the parts are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch all parts in model m: Part.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged parts in the model. |
Model that all parts will be unsketched in
Flag set on the parts that you want to unsketch
If model should be redrawn or not after the parts are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch all parts flagged with flag in model m: Part.UnsketchAll(m, flag);
|
No arguments
ReturnsPart object. Return typePart |
ExampleTo check if Part property p.example is a parameter by using the Part.GetParameter() method: if (p.ViewParameters().GetParameter(p.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for part. For more details on checking see the Check class. |
The warning message to give
An optional detailed warning message
ReturnsNo return value |
ExampleTo add a warning message "My custom warning" for part p: p.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this part. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for part p: var xrefs = p.Xrefs();
|
toString()DescriptionCreates a string containing the part data in keyword format. Note that this contains the keyword header and the keyword cards. See also Part.Keyword() and Part.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for part p in keyword format var str = p.toString();
|