The StagedConstructionPart class gives you access to Define staged construction 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 | Description |
| StagedConstructionPart.PART | DEFN is *DEFINE_STAGED_CONSTRUCTION_PART. |
| StagedConstructionPart.SET | DEFN is *DEFINE_STAGED_CONSTRUCTION_PART_SET. |
| Name | Type | Description |
| exists (read only) | logical | true if Define staged construction part exists, false if referred to but not defined. |
| id | integer | Part ID or part set ID (not internal label) |
| include | integer | The Include file number that the Define staged construction part is in. |
| label (read only) | integer | The label the Define staged construction parts has in PRIMER |
| model (read only) | integer | The Model number that the Define staged construction part is in. |
| option | constant | The Define staged construction parts option. Can be StagedConstructionPart.PART or StagedConstructionPart.SET. |
| stga | integer | Construction stage at which part is added. |
| stgr | integer | Construction stage at which part is removed. |
Detailed DescriptionThe StagedConstructionPart class allows you to create, modify, edit and manipulate Define staged construction parts cards. See the documentation below for more details. |
Constructornew StagedConstructionPart(Model[Model], option[constant], id[integer], stga[integer], stgr[integer])DescriptionCreate a new StagedConstructionPart object. |
Model that Define staged construction parts will be created in
Specify the type of Define staged construction parts. Can be StagedConstructionPart.PART or StagedConstructionPart.SET)
Part ID or part set ID
Construction stage at which part is added.
Construction stage at which part is removed.
ReturnsStagedConstructionPart object Return typeStagedConstructionPart |
ExampleTo create a new Define staged construction part in model m, of type SET, with part set 9, stga 18 and stgr 12 var scp = new StagedConstructionPart(m, StagedConstructionPart.SET, 9, 18, 12);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a Define staged construction part. |
Comment that will be attached to the Define staged construction part
ReturnsNo return value |
ExampleTo associate comment c to the Define staged construction part scp: scp.AssociateComment(c);
|
Blank()DescriptionBlanks the Define staged construction part |
No arguments
ReturnsNo return value |
ExampleTo blank Define staged construction part scp: scp.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the Define staged construction parts in the model. |
Model that all Define staged construction 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 Define staged construction parts in model m: StagedConstructionPart.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged Define staged construction parts in the model. |
Model that all the flagged Define staged construction parts will be blanked in
Flag set on the Define staged construction 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 Define staged construction parts in model m flagged with f: StagedConstructionPart.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the Define staged construction part is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if Define staged construction part scp is blanked: if (scp.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 Define staged construction part scp: scp.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the Define staged construction part. |
Flag to clear on the Define staged construction part
ReturnsNo return value |
ExampleTo clear flag f for Define staged construction part scp: scp.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the Define staged construction part. The target include of the copied Define staged construction 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().
ReturnsStagedConstructionPart object Return typeStagedConstructionPart |
ExampleTo copy Define staged construction part scp into Define staged construction part z: var z = scp.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a Define staged construction part |
Model that the Define staged construction 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.
ReturnsStagedConstructionPart object (or null if not made). Return typeStagedConstructionPart |
ExampleTo start creating a Define staged construction part in model m: var scp = StagedConstructionPart.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a Define staged construction part. |
Comment that will be detached from the Define staged construction part
ReturnsNo return value |
ExampleTo detach comment c from the Define staged construction part scp: scp.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 Define staged construction part scp: scp.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for Define staged construction 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 Define staged construction part scp: scp.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first Define staged construction part in the model. |
Model to get first Define staged construction part in
ReturnsStagedConstructionPart object (or null if there are no Define staged construction parts in the model). Return typeStagedConstructionPart |
ExampleTo get the first Define staged construction part in model m: var scp = StagedConstructionPart.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the Define staged construction parts in the model with a defined flag. |
Model that all Define staged construction parts will be flagged in
Flag to set on the Define staged construction parts
ReturnsNo return value |
ExampleTo flag all of the Define staged construction parts with flag f in model m: StagedConstructionPart.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the Define staged construction part is flagged or not. |
Flag to test on the Define staged construction part
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if Define staged construction part scp has flag f set on it: if (scp.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each Define staged construction part in the model. |
Model that all Define staged construction parts are in
Function to call for each Define staged construction 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 StagedConstructionPart objects or properties for all of the Define staged construction parts in a model in PRIMER. If the optional property argument is not given then an array of StagedConstructionPart objects is returned. If the property argument is given, that property value for each Define staged construction part is returned in the array instead of a StagedConstructionPart object |
Model to get Define staged construction parts from
Name for property to get for all Define staged construction parts in the model
ReturnsArray of StagedConstructionPart objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a Define staged construction 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 Define staged construction part scp: var comm_array = scp.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of StagedConstructionPart objects for all of the flagged Define staged construction parts in a model in PRIMER If the optional property argument is not given then an array of StagedConstructionPart objects is returned. If the property argument is given, then that property value for each Define staged construction part is returned in the array instead of a StagedConstructionPart object |
Model to get Define staged construction parts from
Flag set on the Define staged construction parts that you want to retrieve
Name for property to get for all flagged Define staged construction parts in the model
ReturnsArray of StagedConstructionPart objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the StagedConstructionPart object for a Define staged construction part ID. |
Model to find the Define staged construction part in
number of the Define staged construction part you want the StagedConstructionPart object for
ReturnsStagedConstructionPart object (or null if Define staged construction part does not exist). Return typeStagedConstructionPart |
ExampleTo get the StagedConstructionPart object for Define staged construction part 100 in model m var scp = StagedConstructionPart.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a StagedConstructionPart 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 StagedConstructionPart.ViewParameters() method and 'method chaining' (see the examples below). |
Define staged construction part property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this Define staged construction parts (*Define_staged_construction_part). Note that a carriage return is not added. See also StagedConstructionPart.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for Define staged construction parts scp: var key = scp.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the Define staged construction parts. Note that a carriage return is not added. See also StagedConstructionPart.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for Define staged construction parts scp: var cards = scp.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last Define staged construction part in the model. |
Model to get last Define staged construction part in
ReturnsStagedConstructionPart object (or null if there are no Define staged construction parts in the model). Return typeStagedConstructionPart |
ExampleTo get the last Define staged construction part in model m: var scp = StagedConstructionPart.Last(m);
|
Next()DescriptionReturns the next Define staged construction part in the model. |
No arguments
ReturnsStagedConstructionPart object (or null if there are no more Define staged construction parts in the model). Return typeStagedConstructionPart |
ExampleTo get the Define staged construction part in model m after Define staged construction part scp: var scp = scp.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a Define staged construction part. |
Text to display as a prompt to the user
If the argument is a Model then only Define staged construction parts from that model can be picked. If the argument is a Flag then only Define staged construction parts that are flagged with limit can be selected. If omitted, or null, any Define staged construction 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.
ReturnsStagedConstructionPart object (or null if not picked) Return typeStagedConstructionPart |
Previous()DescriptionReturns the previous Define staged construction part in the model. |
No arguments
ReturnsStagedConstructionPart object (or null if there are no more Define staged construction parts in the model). Return typeStagedConstructionPart |
ExampleTo get the Define staged construction part in model m before Define staged construction part scp: var scp = scp.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select Define staged construction parts using standard PRIMER object menus. |
Flag to use when selecting Define staged construction parts
Text to display as a prompt to the user
If the argument is a Model then only Define staged construction parts from that model can be selected. If the argument is a Flag then only Define staged construction parts that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any Define staged construction 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 Define staged construction parts selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the Define staged construction part. |
Flag to set on the Define staged construction part
ReturnsNo return value |
ExampleTo set flag f for Define staged construction part scp: scp.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the Define staged construction part. The Define staged construction part will be sketched until you either call StagedConstructionPart.Unsketch(), StagedConstructionPart.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the Define staged construction part is sketched. If omitted redraw is true. If you want to sketch several Define staged construction parts and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch Define staged construction part scp: scp.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged Define staged construction parts in the model. The Define staged construction parts will be sketched until you either call StagedConstructionPart.Unsketch(), StagedConstructionPart.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged Define staged construction parts will be sketched in
Flag set on the Define staged construction parts that you want to sketch
If model should be redrawn or not after the Define staged construction parts are sketched. If omitted redraw is true. If you want to sketch flagged Define staged construction 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 Define staged construction parts flagged with flag in model m: StagedConstructionPart.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of Define staged construction parts in the model. |
Model to get total for
true if only existing Define staged construction parts should be counted. If false or omitted referenced but undefined Define staged construction parts will also be included in the total.
Returnsnumber of Define staged construction parts Return typeNumber |
ExampleTo get the total number of Define staged construction parts in model m: var total = StagedConstructionPart.Total(m);
|
Unblank()DescriptionUnblanks the Define staged construction part |
No arguments
ReturnsNo return value |
ExampleTo unblank Define staged construction part scp: scp.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the Define staged construction parts in the model. |
Model that all Define staged construction 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 Define staged construction parts in model m: StagedConstructionPart.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged Define staged construction parts in the model. |
Model that the flagged Define staged construction parts will be unblanked in
Flag set on the Define staged construction 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 Define staged construction parts in model m flagged with f: StagedConstructionPart.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the Define staged construction parts in the model. |
Model that the defined flag for all Define staged construction parts will be unset in
Flag to unset on the Define staged construction parts
ReturnsNo return value |
ExampleTo unset the flag f on all the Define staged construction parts in model m: StagedConstructionPart.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the Define staged construction part. |
If model should be redrawn or not after the Define staged construction part is unsketched. If omitted redraw is true. If you want to unsketch several Define staged construction parts and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch Define staged construction part scp: scp.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all Define staged construction parts. |
Model that all Define staged construction parts will be unblanked in
If model should be redrawn or not after the Define staged construction 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 Define staged construction parts in model m: StagedConstructionPart.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged Define staged construction parts in the model. |
Model that all Define staged construction parts will be unsketched in
Flag set on the Define staged construction parts that you want to unsketch
If model should be redrawn or not after the Define staged construction 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 Define staged construction parts flagged with flag in model m: StagedConstructionPart.UnsketchAll(m, flag);
|
No arguments
ReturnsStagedConstructionPart object. Return typeStagedConstructionPart |
ExampleTo check if StagedConstructionPart property scp.example is a parameter by using the StagedConstructionPart.GetParameter() method: if (scp.ViewParameters().GetParameter(scp.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for Define staged construction 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 Define staged construction part scp: scp.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this Define staged construction part. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for Define staged construction part scp: var xrefs = scp.Xrefs();
|
toString()DescriptionCreates a string containing the Define staged construction parts data in keyword format. Note that this contains the keyword header and the keyword cards. See also StagedConstructionPart.Keyword() and StagedConstructionPart.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for Define staged construction parts scp in keyword format var s = scp.toString();
|