Oasys.PRIMER.ExtraNodes class

Constants

ExtraNodes.NODE

CNST is *CONSTRAINED_EXTRA_NODES_NODE

ExtraNodes.SET

CNST is *CONSTRAINED_EXTRA_NODES_SET

Properties

property ExtraNodes.colour: Colour

The colour of the extra nodes

property ExtraNodes.exists(read only): boolean

true if constrained extra nodes exists, false if referred to but not defined

property ExtraNodes.id: integer

Node ID or node set ID (not internal label)

property ExtraNodes.iflag: boolean

Flag for adding node mass inertia to PART_INERTIA

property ExtraNodes.include: integer

The Include file number that the constrained extra nodes is in

property ExtraNodes.label(read only): integer

The label the constrained extra nodes has in PRIMER

property ExtraNodes.model(read only): integer

The Model number that the constrained extra node is in

property ExtraNodes.option: constant

The Constrained Extra Nodes option. Can be ExtraNodes.NODE or ExtraNodes.SET

property ExtraNodes.pid: integer

Part ID of rigid body

Constructor

classmethod ExtraNodes(model, option, pid, id, iflag)

Create a new ExtraNodes object

Parameters:
  • model (Model) – Model that constrained extra nodes will be created in

  • option (constant) – Specify the type of constrained extra nodes. Can be ExtraNodes.NODE or ExtraNodes.SET)

  • pid (integer) – Part ID of rigid body

  • id (integer) – Node node ID or node set ID

  • iflag (boolean) – Flag for adding node mass inertia to PART_INERTIA

Returns:

ExtraNodes object

Return type:

dict

Example

To create a new constrained extra nodes in model m, of type SET, with part 9, node set 18 and iflag 0

e = Oasys.PRIMER.ExtraNodes(m, Oasys.PRIMER.ExtraNodes.SET, 9, 18, 0)

Static methods

classmethod ExtraNodes.BlankAll(model, redraw=Oasys.gRPC.defaultArg)

Blanks all of the constrained extra nodes in the model

Parameters:
  • model (Model) – Model that all constrained extra nodes will be blanked in

  • 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 constrained extra nodes in model m:

Oasys.PRIMER.ExtraNodes.BlankAll(m)
classmethod ExtraNodes.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Blanks all of the flagged constrained extra nodes in the model

Parameters:
  • model (Model) – Model that all the flagged constrained extra nodes will be blanked in

  • flag (Flag) – Flag set on the constrained extra nodes 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 constrained extra nodes in model m flagged with f:

Oasys.PRIMER.ExtraNodes.BlankFlagged(m, f)
classmethod ExtraNodes.Create(model, modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel to create a constrained extra nodes card

Parameters:
  • model (Model) – Model that the constrained extra nodes card will be created in

  • 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:

ExtraNodes object (or None if not made)

Return type:

dict

Example

To start creating a constrained extra nodes card in model m:

e = Oasys.PRIMER.ExtraNodes.Create(m)
classmethod ExtraNodes.First(model)

Returns the first constrained extra node in the model

Parameters:

model (Model) – Model to get first constrained extra node in

Returns:

ExtraNodes object (or None if there are no constrained extra nodes in the model)

Return type:

ExtraNodes

Example

To get the first constrained extra node in model m:

en = Oasys.PRIMER.ExtraNodes.First(m)
classmethod ExtraNodes.FlagAll(model, flag)

Flags all of the constrained extra nodes in the model with a defined flag

Parameters:
  • model (Model) – Model that all constrained extra nodes will be flagged in

  • flag (Flag) – Flag to set on the constrained extra nodes

Returns:

No return value

Return type:

None

Example

To flag all of the constrained extra nodes with flag f in model m:

Oasys.PRIMER.ExtraNodes.FlagAll(m, f)
classmethod ExtraNodes.GetAll(model)

Returns a list of ExtraNodes objects for all of the constrained extra nodes in a model in PRIMER

Parameters:

model (Model) – Model to get constrained extra nodes from

Returns:

List of ExtraNodes objects

Return type:

list

Example

To make a list of ExtraNodes objects for all of the constrained extra nodes in model m

en = Oasys.PRIMER.ExtraNodes.GetAll(m)
classmethod ExtraNodes.GetFlagged(model, flag)

Returns a list of ExtraNodes objects for all of the flagged constrained extra nodes in a model in PRIMER

Parameters:
  • model (Model) – Model to get constrained extra nodes from

  • flag (Flag) – Flag set on the constrained extra nodes that you want to retrieve

Returns:

List of ExtraNodes objects

Return type:

list

Example

To make a list of ExtraNodes objects for all of the constrained extra nodes in model m flagged with f

en = Oasys.PRIMER.ExtraNodes.GetFlagged(m, f)
classmethod ExtraNodes.GetFromID(model, number)

Returns the ExtraNodes object for a constrained extra node ID

Parameters:
  • model (Model) – Model to find the constrained extra node in

  • number (integer) – number of the constrained extra node you want the ExtraNodes object for

Returns:

ExtraNodes object (or None if constrained extra node does not exist)

Return type:

ExtraNodes

Example

To get the ExtraNodes object for constrained extra node 100 in model m

en = Oasys.PRIMER.ExtraNodes.GetFromID(m, 100)
classmethod ExtraNodes.Last(model)

Returns the last constrained extra node in the model

Parameters:

model (Model) – Model to get last constrained extra node in

Returns:

ExtraNodes object (or None if there are no constrained extra nodes in the model)

Return type:

ExtraNodes

Example

To get the last constrained extra node in model m:

en = Oasys.PRIMER.ExtraNodes.Last(m)
classmethod ExtraNodes.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)

Allows the user to pick a constrained extra node

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 constrained extra nodes from that model can be picked. If the argument is a Flag then only constrained extra nodes that are flagged with limit can be selected. If omitted, or None, any constrained extra nodes from any model can be selected. from any model

  • modal (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:

ExtraNodes object (or None if not picked)

Return type:

dict

Example

To pick a constrained extra node from model m giving the prompt ‘Pick constrained extra node from screen’:

en = Oasys.PRIMER.ExtraNodes.Pick('Pick constrained extra node from screen', m)
classmethod ExtraNodes.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select constrained extra nodes using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting constrained extra nodes

  • prompt (string) – Text to display as a prompt to the user

  • limit (Model or Flag) – Optional. If the argument is a Model then only constrained extra nodes from that model can be selected. If the argument is a Flag then only constrained extra nodes that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any constrained extra nodes can be selected. from any model

  • modal (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 constrained extra nodes selected or None if menu cancelled

Return type:

int

Example

To select constrained extra nodes from model m, flagging those selected with flag f, giving the prompt ‘Select constrained extra nodes’:

Oasys.PRIMER.ExtraNodes.Select(f, 'Select constrained extra nodes', m)

To select constrained extra nodes, flagging those selected with flag f but limiting selection to constrained extra nodes flagged with flag l, giving the prompt ‘Select constrained extra nodes’:

Oasys.PRIMER.ExtraNodes.Select(f, 'Select constrained extra nodes', l)
classmethod ExtraNodes.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Sketches all of the flagged constrained extra nodes in the model. The constrained extra nodes will be sketched until you either call ExtraNodes.Unsketch(), ExtraNodes.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

Parameters:
  • model (Model) – Model that all the flagged constrained extra nodes will be sketched in

  • flag (Flag) – Flag set on the constrained extra nodes that you want to sketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the constrained extra nodes are sketched. If omitted redraw is true. If you want to sketch flagged constrained extra nodes 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 constrained extra nodes flagged with flag in model m:

Oasys.PRIMER.ExtraNodes.SketchFlagged(m, flag)
classmethod ExtraNodes.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of constrained extra nodes in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. true if only existing constrained extra nodes should be counted. If false or omitted referenced but undefined constrained extra nodes will also be included in the total

Returns:

number of constrained extra nodes

Return type:

int

Example

To get the total number of constrained extra nodes in model m:

total = Oasys.PRIMER.ExtraNodes.Total(m)
classmethod ExtraNodes.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the constrained extra nodes in the model

Parameters:
  • model (Model) – Model that all constrained extra nodes will be unblanked in

  • 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 constrained extra nodes in model m:

Oasys.PRIMER.ExtraNodes.UnblankAll(m)
classmethod ExtraNodes.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the flagged constrained extra nodes in the model

Parameters:
  • model (Model) – Model that the flagged constrained extra nodes will be unblanked in

  • flag (Flag) – Flag set on the constrained extra nodes 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 constrained extra nodes in model m flagged with f:

Oasys.PRIMER.ExtraNodes.UnblankFlagged(m, f)
classmethod ExtraNodes.UnflagAll(model, flag)

Unsets a defined flag on all of the constrained extra nodes in the model

Parameters:
  • model (Model) – Model that the defined flag for all constrained extra nodes will be unset in

  • flag (Flag) – Flag to unset on the constrained extra nodes

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the constrained extra nodes in model m:

Oasys.PRIMER.ExtraNodes.UnflagAll(m, f)
classmethod ExtraNodes.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)

Unsketches all constrained extra nodes

Parameters:
  • model (Model) – Model that all constrained extra nodes will be unblanked in

  • redraw (boolean) – Optional. If model should be redrawn or not after the constrained extra nodes 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 constrained extra nodes in model m:

Oasys.PRIMER.ExtraNodes.UnsketchAll(m)
classmethod ExtraNodes.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unsketches all flagged constrained extra nodes in the model

Parameters:
  • model (Model) – Model that all constrained extra nodes will be unsketched in

  • flag (Flag) – Flag set on the constrained extra nodes that you want to unsketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the constrained extra nodes 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 constrained extra nodes flagged with flag in model m:

Oasys.PRIMER.ExtraNodes.UnsketchAll(m, flag)

Instance methods

ExtraNodes.AssociateComment(comment)

Associates a comment with a constrained extra node

Parameters:

comment (Comment) – Comment that will be attached to the constrained extra node

Returns:

No return value

Return type:

None

Example

To associate comment c to the constrained extra node en:

en.AssociateComment(c)
ExtraNodes.Blank()

Blanks the constrained extra node

Returns:

No return value

Return type:

None

Example

To blank constrained extra node en:

en.Blank()
ExtraNodes.Blanked()

Checks if the constrained extra node is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if constrained extra node en is blanked:

if en.Blanked():
    do_something..
ExtraNodes.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 constrained extra node en:

en.Browse()
ExtraNodes.ClearFlag(flag)

Clears a flag on the constrained extra node

Parameters:

flag (Flag) – Flag to clear on the constrained extra node

Returns:

No return value

Return type:

None

Example

To clear flag f for constrained extra node en:

en.ClearFlag(f)
ExtraNodes.Copy(range=Oasys.gRPC.defaultArg)

Copies the constrained extra node. The target include of the copied constrained extra node 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:

ExtraNodes object

Return type:

ExtraNodes

Example

To copy constrained extra node en into constrained extra node z:

z = en.Copy()
ExtraNodes.DetachComment(comment)

Detaches a comment from a constrained extra node

Parameters:

comment (Comment) – Comment that will be detached from the constrained extra node

Returns:

No return value

Return type:

None

Example

To detach comment c from the constrained extra node en:

en.DetachComment(c)
ExtraNodes.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 constrained extra node en:

en.Edit()
ExtraNodes.ExtractColour()

Extracts the actual colour used for constrained extra node.
By default in PRIMER many entities such as elements get their colour automatically from the part that they are in. PRIMER cycles through 13 default colours based on the label of the entity. In this case the constrained extra node colour property will return the value Colour.PART instead of the actual colour. This method will return the actual colour which is used for drawing the constrained extra node

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing constrained extra node en:

colour = en.ExtractColour()
ExtraNodes.Flagged(flag)

Checks if the constrained extra node is flagged or not

Parameters:

flag (Flag) – Flag to test on the constrained extra node

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if constrained extra node en has flag f set on it:

if en.Flagged(f):
    do_something..
ExtraNodes.GetComments()

Extracts the comments associated to a constrained extra node

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 constrained extra node en:

comm_list = en.GetComments()
ExtraNodes.GetParameter(prop)

Checks if a ExtraNodes 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 ExtraNodes.ViewParameters() method and ‘method chaining’ (see the examples below)

Parameters:

prop (string) – constrained extra node property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if ExtraNodes property en.example is a parameter:

Oasys.PRIMER.Options.property_parameter_names = True
if en.GetParameter(en.example):
    do_something...
Oasys.PRIMER.Options.property_parameter_names = False

To check if ExtraNodes property en.example is a parameter by using the GetParameter method:

if en.ViewParameters().GetParameter(en.example):
    do_something..
ExtraNodes.Keyword()

Returns the keyword for this constrained extra nodes (*CONSTRAINED_EXTRA_NODES). Note that a carriage return is not added. See also ExtraNodes.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for constrained extra nodes e:

key = e.Keyword()
ExtraNodes.KeywordCards()

Returns the keyword cards for the constrained extra nodes. Note that a carriage return is not added. See also ExtraNodes.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for constrained extra nodes e:

cards = e.KeywordCards()
ExtraNodes.Next()

Returns the next constrained extra node in the model

Returns:

ExtraNodes object (or None if there are no more constrained extra nodes in the model)

Return type:

ExtraNodes

Example

To get the constrained extra node in model m after constrained extra node en:

en = en.Next()
ExtraNodes.Previous()

Returns the previous constrained extra node in the model

Returns:

ExtraNodes object (or None if there are no more constrained extra nodes in the model)

Return type:

ExtraNodes

Example

To get the constrained extra node in model m before constrained extra node en:

en = en.Previous()
ExtraNodes.SetFlag(flag)

Sets a flag on the constrained extra node

Parameters:

flag (Flag) – Flag to set on the constrained extra node

Returns:

No return value

Return type:

None

Example

To set flag f for constrained extra node en:

en.SetFlag(f)
ExtraNodes.Sketch(redraw=Oasys.gRPC.defaultArg)

Sketches the constrained extra node. The constrained extra node will be sketched until you either call ExtraNodes.Unsketch(), ExtraNodes.UnsketchAll(), Model.UnsketchAll(), or delete the model

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the constrained extra node is sketched. If omitted redraw is true. If you want to sketch several constrained extra nodes 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 constrained extra node en:

en.Sketch()
ExtraNodes.Unblank()

Unblanks the constrained extra node

Returns:

No return value

Return type:

None

Example

To unblank constrained extra node en:

en.Unblank()
ExtraNodes.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the constrained extra node

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the constrained extra node is unsketched. If omitted redraw is true. If you want to unsketch several constrained extra nodes 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 constrained extra node en:

en.Unsketch()
ExtraNodes.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:

ExtraNodes object

Return type:

dict

Example

To check if ExtraNodes property en.example is a parameter by using the ExtraNodes.GetParameter() method:

if en.ViewParameters().GetParameter(en.example):
    do_something..
ExtraNodes.Xrefs()

Returns the cross references for this constrained extra node

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for constrained extra node en:

xrefs = en.Xrefs()