Oasys.PRIMER.StagedConstructionPart class¶
Constants¶
Properties¶
- property StagedConstructionPart.exists(read only): boolean¶
true if Define staged construction parts exists, false if referred to but not defined
- property StagedConstructionPart.include: integer¶
The
Include
file number that the Define staged construction parts is in
- property StagedConstructionPart.label(read only): integer¶
The label the Define staged construction parts has in PRIMER
- property StagedConstructionPart.model(read only): integer¶
The
Model
number that the Define staged construction part is in
- property StagedConstructionPart.option: constant¶
The Define staged construction parts option. Can be
StagedConstructionPart.PART
orStagedConstructionPart.SET
- property StagedConstructionPart.stga: integer¶
Construction stage
at which part is added
- property StagedConstructionPart.stgr: integer¶
Construction stage
at which part is removed
Constructor¶
- classmethod StagedConstructionPart(model, option, id, stga, stgr)¶
Create a new
StagedConstructionPart
object
- Parameters:
model (Model) –
Model
that Define staged construction parts will be created inoption (constant) – Specify the type of Define staged construction parts. Can be
StagedConstructionPart.PART
orStagedConstructionPart.SET
)id (integer) –
Part
ID or part set IDstga (integer) –
Construction stage
at which part is addedstgr (integer) –
Construction stage
at which part is removed- Returns:
StagedConstructionPart object
- Return type:
dict
Example
To create a new Define staged construction part in model m, of type SET, with part set 9, stga 18 and stgr 12
scp = Oasys.PRIMER.StagedConstructionPart(m, Oasys.PRIMER.StagedConstructionPart.SET, 9, 18, 12)
Static methods¶
- classmethod StagedConstructionPart.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that all Define staged construction parts will be blanked inredraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To blank all of the Define staged construction parts in model m:
Oasys.PRIMER.StagedConstructionPart.BlankAll(m)
- classmethod StagedConstructionPart.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that all the flagged Define staged construction parts will be blanked inflag (Flag) – Flag set on the Define staged construction parts that you want to blank
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To blank all of the Define staged construction parts in model m flagged with f:
Oasys.PRIMER.StagedConstructionPart.BlankFlagged(m, f)
- classmethod StagedConstructionPart.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a Define staged construction parts card
- Parameters:
model (Model) –
Model
that the Define staged construction parts card will be created inmodal (boolean) – Optional. 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
- Returns:
StagedConstructionPart object (or None if not made)
- Return type:
dict
Example
To start creating a Define staged construction parts card in model m:
scp = Oasys.PRIMER.StagedConstructionPart.Create(m)
- classmethod StagedConstructionPart.First(model)¶
Returns the first Define staged construction part in the model
- Parameters:
model (Model) –
Model
to get first Define staged construction part in- Returns:
StagedConstructionPart object (or None if there are no Define staged construction parts in the model)
- Return type:
StagedConstructionPart
Example
To get the first Define staged construction part in model m:
scp = Oasys.PRIMER.StagedConstructionPart.First(m)
- classmethod StagedConstructionPart.FlagAll(model, flag)¶
Flags all of the Define staged construction parts in the model with a defined flag
- Parameters:
model (Model) –
Model
that all Define staged construction parts will be flagged inflag (Flag) – Flag to set on the Define staged construction parts
- Returns:
No return value
- Return type:
None
Example
To flag all of the Define staged construction parts with flag f in model m:
Oasys.PRIMER.StagedConstructionPart.FlagAll(m, f)
- classmethod StagedConstructionPart.GetAll(model)¶
Returns a list of StagedConstructionPart objects for all of the Define staged construction parts in a model in PRIMER
- Parameters:
model (Model) –
Model
to get Define staged construction parts from- Returns:
List of StagedConstructionPart objects
- Return type:
list
Example
To make a list of StagedConstructionPart objects for all of the Define staged construction parts in model m
scp = Oasys.PRIMER.StagedConstructionPart.GetAll(m)
- classmethod StagedConstructionPart.GetFlagged(model, flag)¶
Returns a list of StagedConstructionPart objects for all of the flagged Define staged construction parts in a model in PRIMER
- Parameters:
model (Model) –
Model
to get Define staged construction parts fromflag (Flag) – Flag set on the Define staged construction parts that you want to retrieve
- Returns:
List of StagedConstructionPart objects
- Return type:
list
Example
To make a list of StagedConstructionPart objects for all of the Define staged construction parts in model m flagged with f
scp = Oasys.PRIMER.StagedConstructionPart.GetFlagged(m, f)
- classmethod StagedConstructionPart.GetFromID(model, number)¶
Returns the StagedConstructionPart object for a Define staged construction part ID
- Parameters:
model (Model) –
Model
to find the Define staged construction part innumber (integer) – number of the Define staged construction part you want the StagedConstructionPart object for
- Returns:
StagedConstructionPart object (or None if Define staged construction part does not exist)
- Return type:
StagedConstructionPart
Example
To get the StagedConstructionPart object for Define staged construction part 100 in model m
scp = Oasys.PRIMER.StagedConstructionPart.GetFromID(m, 100)
- classmethod StagedConstructionPart.Last(model)¶
Returns the last Define staged construction part in the model
- Parameters:
model (Model) –
Model
to get last Define staged construction part in- Returns:
StagedConstructionPart object (or None if there are no Define staged construction parts in the model)
- Return type:
StagedConstructionPart
Example
To get the last Define staged construction part in model m:
scp = Oasys.PRIMER.StagedConstructionPart.Last(m)
- classmethod StagedConstructionPart.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a Define staged construction part
- Parameters:
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only Define staged construction parts from that model can be picked. If the argument is aFlag
then only Define staged construction parts that are flagged with limit can be selected. If omitted, or None, any Define staged construction parts from any model can be selected. from any modelmodal (boolean) – Optional. 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
button_text (string) – Optional. By default the window with the prompt will have a button labelled ‘Cancel’ which if pressed will cancel the pick and return None. If you want to change the text on the button use this argument. If omitted ‘Cancel’ will be used
- Returns:
StagedConstructionPart object (or None if not picked)
- Return type:
dict
Example
To pick a Define staged construction part from model m giving the prompt ‘Pick Define staged construction part from screen’:
scp = Oasys.PRIMER.StagedConstructionPart.Pick('Pick Define staged construction part from screen', m)
- classmethod StagedConstructionPart.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select Define staged construction parts using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting Define staged construction parts
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only Define staged construction parts from that model can be selected. If the argument is aFlag
then only Define staged construction parts that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any Define staged construction parts can be selected. from any modelmodal (boolean) – Optional. 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
- Returns:
Number of Define staged construction parts selected or None if menu cancelled
- Return type:
int
Example
To select Define staged construction parts from model m, flagging those selected with flag f, giving the prompt ‘Select Define staged construction parts’:
Oasys.PRIMER.StagedConstructionPart.Select(f, 'Select Define staged construction parts', m)To select Define staged construction parts, flagging those selected with flag f but limiting selection to Define staged construction parts flagged with flag l, giving the prompt ‘Select Define staged construction parts’:
Oasys.PRIMER.StagedConstructionPart.Select(f, 'Select Define staged construction parts', l)
- classmethod StagedConstructionPart.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches 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
- Parameters:
model (Model) –
Model
that all the flagged Define staged construction parts will be sketched inflag (Flag) – Flag set on the Define staged construction parts that you want to sketch
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To sketch all Define staged construction parts flagged with flag in model m:
Oasys.PRIMER.StagedConstructionPart.SketchFlagged(m, flag)
- classmethod StagedConstructionPart.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of Define staged construction parts in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. 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
- Returns:
number of Define staged construction parts
- Return type:
int
Example
To get the total number of Define staged construction parts in model m:
total = Oasys.PRIMER.StagedConstructionPart.Total(m)
- classmethod StagedConstructionPart.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that all Define staged construction parts will be unblanked inredraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the Define staged construction parts in model m:
Oasys.PRIMER.StagedConstructionPart.UnblankAll(m)
- classmethod StagedConstructionPart.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that the flagged Define staged construction parts will be unblanked inflag (Flag) – Flag set on the Define staged construction parts that you want to unblank
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the Define staged construction parts in model m flagged with f:
Oasys.PRIMER.StagedConstructionPart.UnblankFlagged(m, f)
- classmethod StagedConstructionPart.UnflagAll(model, flag)¶
Unsets a defined flag on all of the Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that the defined flag for all Define staged construction parts will be unset inflag (Flag) – Flag to unset on the Define staged construction parts
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the Define staged construction parts in model m:
Oasys.PRIMER.StagedConstructionPart.UnflagAll(m, f)
- classmethod StagedConstructionPart.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all Define staged construction parts
- Parameters:
model (Model) –
Model
that all Define staged construction parts will be unblanked inredraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unsketch all Define staged construction parts in model m:
Oasys.PRIMER.StagedConstructionPart.UnsketchAll(m)
- classmethod StagedConstructionPart.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged Define staged construction parts in the model
- Parameters:
model (Model) –
Model
that all Define staged construction parts will be unsketched inflag (Flag) – Flag set on the Define staged construction parts that you want to unsketch
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unsketch all Define staged construction parts flagged with flag in model m:
Oasys.PRIMER.StagedConstructionPart.UnsketchAll(m, flag)
Instance methods¶
- StagedConstructionPart.AssociateComment(comment)¶
Associates a comment with a Define staged construction part
- Parameters:
comment (Comment) –
Comment
that will be attached to the Define staged construction part- Returns:
No return value
- Return type:
None
Example
To associate comment c to the Define staged construction part scp:
scp.AssociateComment(c)
- StagedConstructionPart.Blank()¶
Blanks the Define staged construction part
- Returns:
No return value
- Return type:
None
Example
To blank Define staged construction part scp:
scp.Blank()
- StagedConstructionPart.Blanked()¶
Checks if the Define staged construction part is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if Define staged construction part scp is blanked:
if scp.Blanked(): do_something..
- StagedConstructionPart.Browse(modal=Oasys.gRPC.defaultArg)¶
Starts an edit panel in Browse mode
- Parameters:
modal (boolean) – Optional. 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
- Returns:
no return value
- Return type:
None
Example
To Browse Define staged construction part scp:
scp.Browse()
- StagedConstructionPart.ClearFlag(flag)¶
Clears a flag on the Define staged construction part
- Parameters:
flag (Flag) – Flag to clear on the Define staged construction part
- Returns:
No return value
- Return type:
None
Example
To clear flag f for Define staged construction part scp:
scp.ClearFlag(f)
- StagedConstructionPart.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the Define staged construction part. The target include of the copied Define staged construction part can be set using
Options.copy_target_include
- Parameters:
range (boolean) – Optional. 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()
- Returns:
StagedConstructionPart object
- Return type:
StagedConstructionPart
Example
To copy Define staged construction part scp into Define staged construction part z:
z = scp.Copy()
- StagedConstructionPart.DetachComment(comment)¶
Detaches a comment from a Define staged construction part
- Parameters:
comment (Comment) –
Comment
that will be detached from the Define staged construction part- Returns:
No return value
- Return type:
None
Example
To detach comment c from the Define staged construction part scp:
scp.DetachComment(c)
- StagedConstructionPart.Edit(modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel
- Parameters:
modal (boolean) – Optional. 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
- Returns:
no return value
- Return type:
None
Example
To Edit Define staged construction part scp:
scp.Edit()
- StagedConstructionPart.Flagged(flag)¶
Checks if the Define staged construction part is flagged or not
- Parameters:
flag (Flag) – Flag to test on the Define staged construction part
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if Define staged construction part scp has flag f set on it:
if scp.Flagged(f): do_something..
- StagedConstructionPart.GetComments()¶
Extracts the comments associated to a Define staged construction part
- Returns:
List of Comment objects (or None if there are no comments associated to the node)
- Return type:
list
Example
To get the list of comments associated to the Define staged construction part scp:
comm_list = scp.GetComments()
- StagedConstructionPart.GetParameter(prop)¶
Checks 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 theStagedConstructionPart.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – Define staged construction part property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if StagedConstructionPart property scp.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if scp.GetParameter(scp.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if StagedConstructionPart property scp.example is a parameter by using the GetParameter method:
if scp.ViewParameters().GetParameter(scp.example): do_something..
- StagedConstructionPart.Keyword()¶
Returns the keyword for this Define staged construction parts (*Define_staged_construction_part). Note that a carriage return is not added. See also
StagedConstructionPart.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for Define staged construction parts scp:
key = scp.Keyword()
- StagedConstructionPart.KeywordCards()¶
Returns the keyword cards for the Define staged construction parts. Note that a carriage return is not added. See also
StagedConstructionPart.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for Define staged construction parts scp:
cards = scp.KeywordCards()
- StagedConstructionPart.Next()¶
Returns the next Define staged construction part in the model
- Returns:
StagedConstructionPart object (or None if there are no more Define staged construction parts in the model)
- Return type:
StagedConstructionPart
Example
To get the Define staged construction part in model m after Define staged construction part scp:
scp = scp.Next()
- StagedConstructionPart.Previous()¶
Returns the previous Define staged construction part in the model
- Returns:
StagedConstructionPart object (or None if there are no more Define staged construction parts in the model)
- Return type:
StagedConstructionPart
Example
To get the Define staged construction part in model m before Define staged construction part scp:
scp = scp.Previous()
- StagedConstructionPart.SetFlag(flag)¶
Sets a flag on the Define staged construction part
- Parameters:
flag (Flag) – Flag to set on the Define staged construction part
- Returns:
No return value
- Return type:
None
Example
To set flag f for Define staged construction part scp:
scp.SetFlag(f)
- StagedConstructionPart.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches 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
- Parameters:
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To sketch Define staged construction part scp:
scp.Sketch()
- StagedConstructionPart.Unblank()¶
Unblanks the Define staged construction part
- Returns:
No return value
- Return type:
None
Example
To unblank Define staged construction part scp:
scp.Unblank()
- StagedConstructionPart.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the Define staged construction part
- Parameters:
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unsketch Define staged construction part scp:
scp.Unsketch()
- StagedConstructionPart.ViewParameters()¶
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. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with ‘method chaining’ (see the example below) to make sure a property argument is correct
- Returns:
StagedConstructionPart object
- Return type:
dict
Example
To check if StagedConstructionPart property scp.example is a parameter by using the
StagedConstructionPart.GetParameter()
method:if scp.ViewParameters().GetParameter(scp.example): do_something..
- StagedConstructionPart.Xrefs()¶
Returns the cross references for this Define staged construction part
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for Define staged construction part scp:
xrefs = scp.Xrefs()