Oasys.PRIMER.MorphPoint class¶
Properties¶
Constructor¶
- classmethod MorphPoint(model, label, x, y, z)¶
Create a new
MorphPoint
object
- Parameters:
model (Model) –
Model
that morph point will be created inlabel (integer) –
MorphPoint
numberx (float) – X coordinate
y (float) – Y coordinate
z (float) – Z coordinate
- Returns:
MorphPoint object
- Return type:
dict
Example
To create a new morph point in model m with label 100, at coordinates (20, 40, 10)
n = Oasys.PRIMER.MorphPoint(m, 100, 20, 40, 10)
Static methods¶
- classmethod MorphPoint.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the points in the model
- Parameters:
model (Model) –
Model
that all points 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 points in model m:
Oasys.PRIMER.MorphPoint.BlankAll(m)
- classmethod MorphPoint.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged points in the model
- Parameters:
model (Model) –
Model
that all the flagged points will be blanked inflag (Flag) – Flag set on the points 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 points in model m flagged with f:
Oasys.PRIMER.MorphPoint.BlankFlagged(m, f)
- classmethod MorphPoint.First(model)¶
Returns the first point in the model
- Parameters:
model (Model) –
Model
to get first point in- Returns:
MorphPoint object (or None if there are no points in the model)
- Return type:
MorphPoint
Example
To get the first point in model m:
p = Oasys.PRIMER.MorphPoint.First(m)
- classmethod MorphPoint.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free point label in the model. Also see
MorphPoint.LastFreeLabel()
,MorphPoint.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
MorphPoint label
- Return type:
int
Example
To get the first free point label in model m:
label = Oasys.PRIMER.MorphPoint.FirstFreeLabel(m)
- classmethod MorphPoint.FlagAll(model, flag)¶
Flags all of the points in the model with a defined flag
- Parameters:
model (Model) –
Model
that all points will be flagged inflag (Flag) – Flag to set on the points
- Returns:
No return value
- Return type:
None
Example
To flag all of the points with flag f in model m:
Oasys.PRIMER.MorphPoint.FlagAll(m, f)
- classmethod MorphPoint.GetAll(model)¶
Returns a list of MorphPoint objects for all of the points in a model in PRIMER
- Parameters:
model (Model) –
Model
to get points from- Returns:
List of MorphPoint objects
- Return type:
list
Example
To make a list of MorphPoint objects for all of the points in model m
p = Oasys.PRIMER.MorphPoint.GetAll(m)
- classmethod MorphPoint.GetFlagged(model, flag)¶
Returns a list of MorphPoint objects for all of the flagged points in a model in PRIMER
- Parameters:
model (Model) –
Model
to get points fromflag (Flag) – Flag set on the points that you want to retrieve
- Returns:
List of MorphPoint objects
- Return type:
list
Example
To make a list of MorphPoint objects for all of the points in model m flagged with f
p = Oasys.PRIMER.MorphPoint.GetFlagged(m, f)
- classmethod MorphPoint.GetFromID(model, number)¶
Returns the MorphPoint object for a point ID
- Parameters:
model (Model) –
Model
to find the point innumber (integer) – number of the point you want the MorphPoint object for
- Returns:
MorphPoint object (or None if point does not exist)
- Return type:
MorphPoint
Example
To get the MorphPoint object for point 100 in model m
p = Oasys.PRIMER.MorphPoint.GetFromID(m, 100)
- classmethod MorphPoint.Last(model)¶
Returns the last point in the model
- Parameters:
model (Model) –
Model
to get last point in- Returns:
MorphPoint object (or None if there are no points in the model)
- Return type:
MorphPoint
Example
To get the last point in model m:
p = Oasys.PRIMER.MorphPoint.Last(m)
- classmethod MorphPoint.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free point label in the model. Also see
MorphPoint.FirstFreeLabel()
,MorphPoint.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
MorphPoint label
- Return type:
int
Example
To get the last free point label in model m:
label = Oasys.PRIMER.MorphPoint.LastFreeLabel(m)
- classmethod MorphPoint.MoveFlagged(model, flag, dx, dy, dz)¶
This function moves a selection of flagged morph points by a given vector and interpolates the movement of other morph points in the same way as this happens on the interactive morph panel. Note that the interpolation depends on the settings which can be switched on the interactive morph panel or by preferences. To apply the movement to the nodes in the box(es), you will need to call
MorphBox.ApplyMorphing()
at least for all relevant boxes or (if that is easier) for all morph boxes in the model
- Parameters:
model (Model) –
Model
that the flagged morph points are inflag (Flag) – Flag set on the morph points explicitly selected to move
dx (real) – X component of vector to be moved along
dy (real) – Y component of vector to be moved along
dz (real) – Z component of vector to be moved along
- Returns:
No return value
- Return type:
None
Example
To move all morph points in model m flagged with flag by 10 units in global Y direction while interpolating the other morph points as given by button settings or preferences:
Oasys.PRIMER.MorphPoint.MoveFlagged(m, flag, 0.0, 10.0, 0.0)
- classmethod MorphPoint.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) point label in the model. Also see
MorphPoint.FirstFreeLabel()
,MorphPoint.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
MorphPoint label
- Return type:
int
Example
To get the next free point label in model m:
label = Oasys.PRIMER.MorphPoint.NextFreeLabel(m)
- classmethod MorphPoint.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a point
- 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 points from that model can be picked. If the argument is aFlag
then only points that are flagged with limit can be selected. If omitted, or None, any points 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:
MorphPoint object (or None if not picked)
- Return type:
dict
Example
To pick a point from model m giving the prompt ‘Pick point from screen’:
p = Oasys.PRIMER.MorphPoint.Pick('Pick point from screen', m)
- classmethod MorphPoint.RenumberAll(model, start)¶
Renumbers all of the points in the model
- Parameters:
model (Model) –
Model
that all points will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the points in model m, from 1000000:
Oasys.PRIMER.MorphPoint.RenumberAll(m, 1000000)
- classmethod MorphPoint.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged points in the model
- Parameters:
model (Model) –
Model
that all the flagged points will be renumbered inflag (Flag) – Flag set on the points that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the points in model m flagged with f, from 1000000:
Oasys.PRIMER.MorphPoint.RenumberFlagged(m, f, 1000000)
- classmethod MorphPoint.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select points using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting points
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only points from that model can be selected. If the argument is aFlag
then only points that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any points 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 points selected or None if menu cancelled
- Return type:
int
Example
To select points from model m, flagging those selected with flag f, giving the prompt ‘Select points’:
Oasys.PRIMER.MorphPoint.Select(f, 'Select points', m)To select points, flagging those selected with flag f but limiting selection to points flagged with flag l, giving the prompt ‘Select points’:
Oasys.PRIMER.MorphPoint.Select(f, 'Select points', l)
- classmethod MorphPoint.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged points in the model. The points will be sketched until you either call
MorphPoint.Unsketch()
,MorphPoint.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged points will be sketched inflag (Flag) – Flag set on the points that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the points are sketched. If omitted redraw is true. If you want to sketch flagged points 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 points flagged with flag in model m:
Oasys.PRIMER.MorphPoint.SketchFlagged(m, flag)
- classmethod MorphPoint.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of points in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing points should be counted. If false or omitted referenced but undefined points will also be included in the total
- Returns:
number of points
- Return type:
int
Example
To get the total number of points in model m:
total = Oasys.PRIMER.MorphPoint.Total(m)
- classmethod MorphPoint.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the points in the model
- Parameters:
model (Model) –
Model
that all points 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 points in model m:
Oasys.PRIMER.MorphPoint.UnblankAll(m)
- classmethod MorphPoint.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged points in the model
- Parameters:
model (Model) –
Model
that the flagged points will be unblanked inflag (Flag) – Flag set on the points 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 points in model m flagged with f:
Oasys.PRIMER.MorphPoint.UnblankFlagged(m, f)
- classmethod MorphPoint.UnflagAll(model, flag)¶
Unsets a defined flag on all of the points in the model
- Parameters:
model (Model) –
Model
that the defined flag for all points will be unset inflag (Flag) – Flag to unset on the points
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the points in model m:
Oasys.PRIMER.MorphPoint.UnflagAll(m, f)
- classmethod MorphPoint.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all points
- Parameters:
model (Model) –
Model
that all points will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the points 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 points in model m:
Oasys.PRIMER.MorphPoint.UnsketchAll(m)
- classmethod MorphPoint.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged points in the model
- Parameters:
model (Model) –
Model
that all points will be unsketched inflag (Flag) – Flag set on the points that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the points 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 points flagged with flag in model m:
Oasys.PRIMER.MorphPoint.UnsketchAll(m, flag)
Instance methods¶
- MorphPoint.AssociateComment(comment)¶
Associates a comment with a point
- Parameters:
comment (Comment) –
Comment
that will be attached to the point- Returns:
No return value
- Return type:
None
Example
To associate comment c to the point p:
p.AssociateComment(c)
- MorphPoint.Blank()¶
Blanks the point
- Returns:
No return value
- Return type:
None
Example
To blank point p:
p.Blank()
- MorphPoint.Blanked()¶
Checks if the point is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if point p is blanked:
if p.Blanked(): do_something..
- MorphPoint.ClearFlag(flag)¶
Clears a flag on the point
- Parameters:
flag (Flag) – Flag to clear on the point
- Returns:
No return value
- Return type:
None
Example
To clear flag f for point p:
p.ClearFlag(f)
- MorphPoint.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the point. The target include of the copied point 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:
MorphPoint object
- Return type:
MorphPoint
Example
To copy point p into point z:
z = p.Copy()
- MorphPoint.DetachComment(comment)¶
Detaches a comment from a point
- Parameters:
comment (Comment) –
Comment
that will be detached from the point- Returns:
No return value
- Return type:
None
Example
To detach comment c from the point p:
p.DetachComment(c)
- MorphPoint.Flagged(flag)¶
Checks if the point is flagged or not
- Parameters:
flag (Flag) – Flag to test on the point
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if point p has flag f set on it:
if p.Flagged(f): do_something..
- MorphPoint.GetComments()¶
Extracts the comments associated to a point
- 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 point p:
comm_list = p.GetComments()
- MorphPoint.GetParameter(prop)¶
Checks if a MorphPoint 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 theMorphPoint.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – point property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if MorphPoint property p.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if p.GetParameter(p.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if MorphPoint property p.example is a parameter by using the GetParameter method:
if p.ViewParameters().GetParameter(p.example): do_something..
- MorphPoint.Keyword()¶
Returns the keyword for this morph point (*MORPH_POINT). Note that a carriage return is not added. See also
MorphPoint.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for morph point p:
key = p.Keyword()
- MorphPoint.KeywordCards()¶
Returns the keyword cards for the morph point. Note that a carriage return is not added. See also
MorphPoint.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for morph point p:
cards = p.KeywordCards()
- MorphPoint.Next()¶
Returns the next point in the model
- Returns:
MorphPoint object (or None if there are no more points in the model)
- Return type:
MorphPoint
Example
To get the point in model m after point p:
p = p.Next()
- MorphPoint.Previous()¶
Returns the previous point in the model
- Returns:
MorphPoint object (or None if there are no more points in the model)
- Return type:
MorphPoint
Example
To get the point in model m before point p:
p = p.Previous()
- MorphPoint.SetFlag(flag)¶
Sets a flag on the point
- Parameters:
flag (Flag) – Flag to set on the point
- Returns:
No return value
- Return type:
None
Example
To set flag f for point p:
p.SetFlag(f)
- MorphPoint.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the point. The point will be sketched until you either call
MorphPoint.Unsketch()
,MorphPoint.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the point is sketched. If omitted redraw is true. If you want to sketch several points 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 point p:
p.Sketch()
- MorphPoint.Unblank()¶
Unblanks the point
- Returns:
No return value
- Return type:
None
Example
To unblank point p:
p.Unblank()
- MorphPoint.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the point
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the point is unsketched. If omitted redraw is true. If you want to unsketch several points 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 point p:
p.Unsketch()
- MorphPoint.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:
MorphPoint object
- Return type:
dict
Example
To check if MorphPoint property p.example is a parameter by using the
MorphPoint.GetParameter()
method:if p.ViewParameters().GetParameter(p.example): do_something..
- MorphPoint.Xrefs()¶
Returns the cross references for this point
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for point p:
xrefs = p.Xrefs()