Oasys.PRIMER.ContactGuidedCable class¶
Constants¶
Properties¶
- property ContactGuidedCable.cid: integer¶
ContactGuidedCable
number
- property ContactGuidedCable.endtol: float¶
Tolerance, in length units
- property ContactGuidedCable.exists(read only): boolean¶
true if ContactGuidedCable exists, false if referred to but not defined
- property ContactGuidedCable.fric: float¶
Contact friction
- property ContactGuidedCable.heading: string¶
ContactGuidedCable
heading
- property ContactGuidedCable.id: boolean¶
TRUE if _ID option is set, FALSE if not
- property ContactGuidedCable.include: integer¶
The
Include
file number that the ContactGuidedCable is in
- property ContactGuidedCable.model(read only): integer¶
The
Model
number that the contact guided_cable is in
- property ContactGuidedCable.ptype: constant¶
The Contact Part type. Can be
ContactGuidedCable.PART
orContactGuidedCable.SET_PART
- property ContactGuidedCable.soft: integer¶
Flag for soft constraint option. Set to 1 for soft constraint
- property ContactGuidedCable.ssfac: float¶
Stiffness scale factor for penalty stiffness value. The default value is unity. This applies to SOFT set to 0 and 1
Constructor¶
- classmethod ContactGuidedCable(model, ptype, nsid, pid, soft=Oasys.gRPC.defaultArg, ssfac=Oasys.gRPC.defaultArg, fric=Oasys.gRPC.defaultArg, cid=Oasys.gRPC.defaultArg, heading=Oasys.gRPC.defaultArg, endtol=Oasys.gRPC.defaultArg)¶
Create a new
ContactGuidedCable
object
- Parameters:
model (Model) –
Model
that ContactGuidedCable will be created inptype (constant) – Specify the type of ContactGuidedCable (Can be
ContactGuidedCable.PART
orContactGuidedCable.SET_PART
nsid (integer) –
Node Set
ID that guides the 1D elementssoft (integer) – Optional. Flag for soft constraint option. Set to 1 for soft constraint
ssfac (float) – Optional. Stiffness scale factor for penalty stiffness value. The default value is unity. This applies to SOFT set to 0 and 1
fric (float) – Optional. Contact friction
cid (integer) – Optional.
ContactGuidedCable
number (Same as label)heading (string) – Optional.
ContactGuidedCable
heading (Same as title)endtol (float) – Optional. Tolerance, in length units
- Returns:
ContactGuidedCable object
- Return type:
dict
Example
To create a new contact guided_cable in model m, of ptype PART, with nsid 100, pid 10, soft 1 and ssfac 4.5
c_g_c = Oasys.PRIMER.ContactGuidedCable(m, Oasys.PRIMER.ContactGuidedCable.PART, 100, 10, 1, 4.5)
Static methods¶
- classmethod ContactGuidedCable.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all contact guided_cables 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 contact guided_cables in model m:
Oasys.PRIMER.ContactGuidedCable.BlankAll(m)
- classmethod ContactGuidedCable.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all the flagged contact guided_cables will be blanked inflag (Flag) – Flag set on the contact guided_cables 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 contact guided_cables in model m flagged with f:
Oasys.PRIMER.ContactGuidedCable.BlankFlagged(m, f)
- classmethod ContactGuidedCable.First(model)¶
Returns the first contact guided_cable in the model
- Parameters:
model (Model) –
Model
to get first contact guided_cable in- Returns:
ContactGuidedCable object (or None if there are no contact guided_cables in the model)
- Return type:
ContactGuidedCable
Example
To get the first contact guided_cable in model m:
c_g_c = Oasys.PRIMER.ContactGuidedCable.First(m)
- classmethod ContactGuidedCable.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free contact guided_cable label in the model. Also see
ContactGuidedCable.LastFreeLabel()
,ContactGuidedCable.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
model (Model) –
Model
to get first free contact guided_cable label inlayer (Include number) – Optional.
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)- Returns:
ContactGuidedCable label
- Return type:
int
Example
To get the first free contact guided_cable label in model m:
label = Oasys.PRIMER.ContactGuidedCable.FirstFreeLabel(m)
- classmethod ContactGuidedCable.FlagAll(model, flag)¶
Flags all of the contact guided_cables in the model with a defined flag
- Parameters:
model (Model) –
Model
that all contact guided_cables will be flagged inflag (Flag) – Flag to set on the contact guided_cables
- Returns:
No return value
- Return type:
None
Example
To flag all of the contact guided_cables with flag f in model m:
Oasys.PRIMER.ContactGuidedCable.FlagAll(m, f)
- classmethod ContactGuidedCable.GetAll(model)¶
Returns a list of ContactGuidedCable objects for all of the contact guided_cables in a model in PRIMER
- Parameters:
model (Model) –
Model
to get contact guided_cables from- Returns:
List of ContactGuidedCable objects
- Return type:
list
Example
To make a list of ContactGuidedCable objects for all of the contact guided_cables in model m
c_g_c = Oasys.PRIMER.ContactGuidedCable.GetAll(m)
- classmethod ContactGuidedCable.GetFlagged(model, flag)¶
Returns a list of ContactGuidedCable objects for all of the flagged contact guided_cables in a model in PRIMER
- Parameters:
model (Model) –
Model
to get contact guided_cables fromflag (Flag) – Flag set on the contact guided_cables that you want to retrieve
- Returns:
List of ContactGuidedCable objects
- Return type:
list
Example
To make a list of ContactGuidedCable objects for all of the contact guided_cables in model m flagged with f
c_g_c = Oasys.PRIMER.ContactGuidedCable.GetFlagged(m, f)
- classmethod ContactGuidedCable.GetFromID(model, number)¶
Returns the ContactGuidedCable object for a contact guided_cable ID
- Parameters:
model (Model) –
Model
to find the contact guided_cable innumber (integer) – number of the contact guided_cable you want the ContactGuidedCable object for
- Returns:
ContactGuidedCable object (or None if contact guided_cable does not exist)
- Return type:
ContactGuidedCable
Example
To get the ContactGuidedCable object for contact guided_cable 100 in model m
c_g_c = Oasys.PRIMER.ContactGuidedCable.GetFromID(m, 100)
- classmethod ContactGuidedCable.Last(model)¶
Returns the last contact guided_cable in the model
- Parameters:
model (Model) –
Model
to get last contact guided_cable in- Returns:
ContactGuidedCable object (or None if there are no contact guided_cables in the model)
- Return type:
ContactGuidedCable
Example
To get the last contact guided_cable in model m:
c_g_c = Oasys.PRIMER.ContactGuidedCable.Last(m)
- classmethod ContactGuidedCable.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free contact guided_cable label in the model. Also see
ContactGuidedCable.FirstFreeLabel()
,ContactGuidedCable.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
ContactGuidedCable label
- Return type:
int
Example
To get the last free contact guided_cable label in model m:
label = Oasys.PRIMER.ContactGuidedCable.LastFreeLabel(m)
- classmethod ContactGuidedCable.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) contact guided_cable label in the model. Also see
ContactGuidedCable.FirstFreeLabel()
,ContactGuidedCable.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
model (Model) –
Model
to get next free contact guided_cable label inlayer (Include number) – Optional.
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)- Returns:
ContactGuidedCable label
- Return type:
int
Example
To get the next free contact guided_cable label in model m:
label = Oasys.PRIMER.ContactGuidedCable.NextFreeLabel(m)
- classmethod ContactGuidedCable.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a contact guided_cable
- 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 contact guided_cables from that model can be picked. If the argument is aFlag
then only contact guided_cables that are flagged with limit can be selected. If omitted, or None, any contact guided_cables 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:
ContactGuidedCable object (or None if not picked)
- Return type:
dict
Example
To pick a contact guided_cable from model m giving the prompt ‘Pick contact guided_cable from screen’:
c_g_c = Oasys.PRIMER.ContactGuidedCable.Pick('Pick contact guided_cable from screen', m)
- classmethod ContactGuidedCable.RenumberAll(model, start)¶
Renumbers all of the contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all contact guided_cables will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the contact guided_cables in model m, from 1000000:
Oasys.PRIMER.ContactGuidedCable.RenumberAll(m, 1000000)
- classmethod ContactGuidedCable.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all the flagged contact guided_cables will be renumbered inflag (Flag) – Flag set on the contact guided_cables that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the contact guided_cables in model m flagged with f, from 1000000:
Oasys.PRIMER.ContactGuidedCable.RenumberFlagged(m, f, 1000000)
- classmethod ContactGuidedCable.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select contact guided_cables using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting contact guided_cables
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only contact guided_cables from that model can be selected. If the argument is aFlag
then only contact guided_cables that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any contact guided_cables 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 contact guided_cables selected or None if menu cancelled
- Return type:
int
Example
To select contact guided_cables from model m, flagging those selected with flag f, giving the prompt ‘Select contact guided_cables’:
Oasys.PRIMER.ContactGuidedCable.Select(f, 'Select contact guided_cables', m)To select contact guided_cables, flagging those selected with flag f but limiting selection to contact guided_cables flagged with flag l, giving the prompt ‘Select contact guided_cables’:
Oasys.PRIMER.ContactGuidedCable.Select(f, 'Select contact guided_cables', l)
- classmethod ContactGuidedCable.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged contact guided_cables in the model. The contact guided_cables will be sketched until you either call
ContactGuidedCable.Unsketch()
,ContactGuidedCable.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged contact guided_cables will be sketched inflag (Flag) – Flag set on the contact guided_cables that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the contact guided_cables are sketched. If omitted redraw is true. If you want to sketch flagged contact guided_cables 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 contact guided_cables flagged with flag in model m:
Oasys.PRIMER.ContactGuidedCable.SketchFlagged(m, flag)
- classmethod ContactGuidedCable.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of contact guided_cables in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing contact guided_cables should be counted. If false or omitted referenced but undefined contact guided_cables will also be included in the total
- Returns:
number of contact guided_cables
- Return type:
int
Example
To get the total number of contact guided_cables in model m:
total = Oasys.PRIMER.ContactGuidedCable.Total(m)
- classmethod ContactGuidedCable.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all contact guided_cables 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 contact guided_cables in model m:
Oasys.PRIMER.ContactGuidedCable.UnblankAll(m)
- classmethod ContactGuidedCable.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged contact guided_cables in the model
- Parameters:
model (Model) –
Model
that the flagged contact guided_cables will be unblanked inflag (Flag) – Flag set on the contact guided_cables 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 contact guided_cables in model m flagged with f:
Oasys.PRIMER.ContactGuidedCable.UnblankFlagged(m, f)
- classmethod ContactGuidedCable.UnflagAll(model, flag)¶
Unsets a defined flag on all of the contact guided_cables in the model
- Parameters:
model (Model) –
Model
that the defined flag for all contact guided_cables will be unset inflag (Flag) – Flag to unset on the contact guided_cables
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the contact guided_cables in model m:
Oasys.PRIMER.ContactGuidedCable.UnflagAll(m, f)
- classmethod ContactGuidedCable.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all contact guided_cables
- Parameters:
model (Model) –
Model
that all contact guided_cables will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the contact guided_cables 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 contact guided_cables in model m:
Oasys.PRIMER.ContactGuidedCable.UnsketchAll(m)
- classmethod ContactGuidedCable.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged contact guided_cables in the model
- Parameters:
model (Model) –
Model
that all contact guided_cables will be unsketched inflag (Flag) – Flag set on the contact guided_cables that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the contact guided_cables 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 contact guided_cables flagged with flag in model m:
Oasys.PRIMER.ContactGuidedCable.UnsketchAll(m, flag)
Instance methods¶
- ContactGuidedCable.AssociateComment(comment)¶
Associates a comment with a contact guided_cable
- Parameters:
comment (Comment) –
Comment
that will be attached to the contact guided_cable- Returns:
No return value
- Return type:
None
Example
To associate comment c to the contact guided_cable c_g_c:
c_g_c.AssociateComment(c)
- ContactGuidedCable.Blank()¶
Blanks the contact guided_cable
- Returns:
No return value
- Return type:
None
Example
To blank contact guided_cable c_g_c:
c_g_c.Blank()
- ContactGuidedCable.Blanked()¶
Checks if the contact guided_cable is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if contact guided_cable c_g_c is blanked:
if c_g_c.Blanked(): do_something..
- ContactGuidedCable.ClearFlag(flag)¶
Clears a flag on the contact guided_cable
- Parameters:
flag (Flag) – Flag to clear on the contact guided_cable
- Returns:
No return value
- Return type:
None
Example
To clear flag f for contact guided_cable c_g_c:
c_g_c.ClearFlag(f)
- ContactGuidedCable.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the contact guided_cable. The target include of the copied contact guided_cable 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:
ContactGuidedCable object
- Return type:
ContactGuidedCable
Example
To copy contact guided_cable c_g_c into contact guided_cable z:
z = c_g_c.Copy()
- ContactGuidedCable.DetachComment(comment)¶
Detaches a comment from a contact guided_cable
- Parameters:
comment (Comment) –
Comment
that will be detached from the contact guided_cable- Returns:
No return value
- Return type:
None
Example
To detach comment c from the contact guided_cable c_g_c:
c_g_c.DetachComment(c)
- ContactGuidedCable.Flagged(flag)¶
Checks if the contact guided_cable is flagged or not
- Parameters:
flag (Flag) – Flag to test on the contact guided_cable
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if contact guided_cable c_g_c has flag f set on it:
if c_g_c.Flagged(f): do_something..
- ContactGuidedCable.GetComments()¶
Extracts the comments associated to a contact guided_cable
- 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 contact guided_cable c_g_c:
comm_list = c_g_c.GetComments()
- ContactGuidedCable.GetParameter(prop)¶
Checks if a ContactGuidedCable 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 theContactGuidedCable.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – contact guided_cable property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if ContactGuidedCable property c_g_c.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if c_g_c.GetParameter(c_g_c.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if ContactGuidedCable property c_g_c.example is a parameter by using the GetParameter method:
if c_g_c.ViewParameters().GetParameter(c_g_c.example): do_something..
- ContactGuidedCable.Keyword()¶
Returns the keyword for this ContactGuidedCable (*contact_guided_cable). Note that a carriage return is not added. See also
ContactGuidedCable.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for ContactGuidedCable c_g_c:
key = c_g_c.Keyword()
- ContactGuidedCable.KeywordCards()¶
Returns the keyword cards for the ContactGuidedCable. Note that a carriage return is not added. See also
ContactGuidedCable.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for ContactGuidedCable c_g_c:
cards = c_g_c.KeywordCards()
- ContactGuidedCable.Next()¶
Returns the next contact guided_cable in the model
- Returns:
ContactGuidedCable object (or None if there are no more contact guided_cables in the model)
- Return type:
ContactGuidedCable
Example
To get the contact guided_cable in model m after contact guided_cable c_g_c:
c_g_c = c_g_c.Next()
- ContactGuidedCable.Previous()¶
Returns the previous contact guided_cable in the model
- Returns:
ContactGuidedCable object (or None if there are no more contact guided_cables in the model)
- Return type:
ContactGuidedCable
Example
To get the contact guided_cable in model m before contact guided_cable c_g_c:
c_g_c = c_g_c.Previous()
- ContactGuidedCable.SetFlag(flag)¶
Sets a flag on the contact guided_cable
- Parameters:
flag (Flag) – Flag to set on the contact guided_cable
- Returns:
No return value
- Return type:
None
Example
To set flag f for contact guided_cable c_g_c:
c_g_c.SetFlag(f)
- ContactGuidedCable.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the contact guided_cable. The contact guided_cable will be sketched until you either call
ContactGuidedCable.Unsketch()
,ContactGuidedCable.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the contact guided_cable is sketched. If omitted redraw is true. If you want to sketch several contact guided_cables 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 contact guided_cable c_g_c:
c_g_c.Sketch()
- ContactGuidedCable.Unblank()¶
Unblanks the contact guided_cable
- Returns:
No return value
- Return type:
None
Example
To unblank contact guided_cable c_g_c:
c_g_c.Unblank()
- ContactGuidedCable.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the contact guided_cable
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the contact guided_cable is unsketched. If omitted redraw is true. If you want to unsketch several contact guided_cables 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 contact guided_cable c_g_c:
c_g_c.Unsketch()
- ContactGuidedCable.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:
ContactGuidedCable object
- Return type:
dict
Example
To check if ContactGuidedCable property c_g_c.example is a parameter by using the
ContactGuidedCable.GetParameter()
method:if c_g_c.ViewParameters().GetParameter(c_g_c.example): do_something..
- ContactGuidedCable.Xrefs()¶
Returns the cross references for this contact guided_cable
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for contact guided_cable c_g_c:
xrefs = c_g_c.Xrefs()