The MorphPoint class gives you access to morph points 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 | Type | Description |
| exists (read only) | logical | true if point exists, false if referred to but not defined. |
| include | integer | The Include file number that the point is in. |
| label | integer | MorphPoint number. |
| model (read only) | integer | The Model number that the point is in. |
| x | real | X coordinate |
| y | real | Y coordinate |
| z | real | Z coordinate |
Detailed DescriptionThe MorphPoint class allows you to create, modify and manipulate morph points. See the documentation below for more details. |
Constructornew MorphPoint(Model[Model], label[integer], x[real], y[real], z[real])DescriptionCreate a new MorphPoint object. |
Model that morph point will be created in
MorphPoint number
X coordinate
Y coordinate
Z coordinate
ReturnsMorphPoint object Return typeMorphPoint |
ExampleTo create a new morph point in model m with label 100, at coordinates (20, 40, 10) var n = new MorphPoint(m, 100, 20, 40, 10);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a point. |
Comment that will be attached to the point
ReturnsNo return value |
ExampleTo associate comment c to the point p: p.AssociateComment(c);
|
Blank()DescriptionBlanks the point |
No arguments
ReturnsNo return value |
ExampleTo blank point p: p.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the points in the model. |
Model that all points 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 points in model m: MorphPoint.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged points in the model. |
Model that all the flagged points will be blanked in
Flag set on the points 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 points in model m flagged with f: MorphPoint.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the point is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if point p is blanked: if (p.Blanked() ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on the point. |
Flag to clear on the point
ReturnsNo return value |
ExampleTo clear flag f for point p: p.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the point. The target include of the copied point 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().
ReturnsMorphPoint object Return typeMorphPoint |
ExampleTo copy point p into point z: var z = p.Copy();
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a point. |
Comment that will be detached from the point
ReturnsNo return value |
ExampleTo detach comment c from the point p: p.DetachComment(c);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for point. 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 point p: p.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first point in the model. |
Model to get first point in
ReturnsMorphPoint object (or null if there are no points in the model). Return typeMorphPoint |
ExampleTo get the first point in model m: var p = MorphPoint.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free point label in the model. Also see MorphPoint.LastFreeLabel(), MorphPoint.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free point label in
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).
ReturnsMorphPoint label. Return typeNumber |
ExampleTo get the first free point label in model m: var label = MorphPoint.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the points in the model with a defined flag. |
Model that all points will be flagged in
Flag to set on the points
ReturnsNo return value |
ExampleTo flag all of the points with flag f in model m: MorphPoint.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the point is flagged or not. |
Flag to test on the point
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if point p has flag f set on it: if (p.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each point in the model. |
Model that all points are in
Function to call for each point
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 MorphPoint objects or properties for all of the points in a model in PRIMER. If the optional property argument is not given then an array of MorphPoint objects is returned. If the property argument is given, that property value for each point is returned in the array instead of a MorphPoint object |
Model to get points from
Name for property to get for all points in the model
ReturnsArray of MorphPoint objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a point. |
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 point p: var comm_array = p.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of MorphPoint objects for all of the flagged points in a model in PRIMER If the optional property argument is not given then an array of MorphPoint objects is returned. If the property argument is given, then that property value for each point is returned in the array instead of a MorphPoint object |
Model to get points from
Flag set on the points that you want to retrieve
Name for property to get for all flagged points in the model
ReturnsArray of MorphPoint objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the MorphPoint object for a point ID. |
Model to find the point in
number of the point you want the MorphPoint object for
ReturnsMorphPoint object (or null if point does not exist). Return typeMorphPoint |
ExampleTo get the MorphPoint object for point 100 in model m var p = MorphPoint.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks 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 the MorphPoint.ViewParameters() method and 'method chaining' (see the examples below). |
point property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this morph point (*MORPH_POINT). Note that a carriage return is not added. See also MorphPoint.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for morph point p: var key = p.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the morph point. Note that a carriage return is not added. See also MorphPoint.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for morph point p: var cards = p.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last point in the model. |
Model to get last point in
ReturnsMorphPoint object (or null if there are no points in the model). Return typeMorphPoint |
ExampleTo get the last point in model m: var p = MorphPoint.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free point label in the model. Also see MorphPoint.FirstFreeLabel(), MorphPoint.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free point label in
Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.
ReturnsMorphPoint label. Return typeNumber |
ExampleTo get the last free point label in model m: var label = MorphPoint.LastFreeLabel(m);
|
MoveFlagged(Model[Model], flag[Flag], dx[real], dy[real], dz[real]) [static]DescriptionThis 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. |
Model that the flagged morph points are in
Flag set on the morph points explicitly selected to move
X component of vector to be moved along
Y component of vector to be moved along
Z component of vector to be moved along
ReturnsNo return value |
Next()DescriptionReturns the next point in the model. |
No arguments
ReturnsMorphPoint object (or null if there are no more points in the model). Return typeMorphPoint |
ExampleTo get the point in model m after point p: var p = p.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) point label in the model. Also see MorphPoint.FirstFreeLabel(), MorphPoint.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free point label in
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).
ReturnsMorphPoint label. Return typeNumber |
ExampleTo get the next free point label in model m: var label = MorphPoint.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a point. |
Text to display as a prompt to the user
If the argument is a Model then only points from that model can be picked. If the argument is a Flag then only points that are flagged with limit can be selected. If omitted, or null, any points 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.
ReturnsMorphPoint object (or null if not picked) Return typeMorphPoint |
ExampleTo pick a point from model m giving the prompt 'Pick point from screen': var p = MorphPoint.Pick('Pick point from screen', m);
|
Previous()DescriptionReturns the previous point in the model. |
No arguments
ReturnsMorphPoint object (or null if there are no more points in the model). Return typeMorphPoint |
ExampleTo get the point in model m before point p: var p = p.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the points in the model. |
Model that all points will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the points in model m, from 1000000: MorphPoint.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged points in the model. |
Model that all the flagged points will be renumbered in
Flag set on the points that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the points in model m flagged with f, from 1000000: MorphPoint.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select points using standard PRIMER object menus. |
Flag to use when selecting points
Text to display as a prompt to the user
If the argument is a Model then only points from that model can be selected. If the argument is a Flag then only points that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any points 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 points selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the point. |
Flag to set on the point
ReturnsNo return value |
ExampleTo set flag f for point p: p.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the point. The point will be sketched until you either call MorphPoint.Unsketch(), MorphPoint.UnsketchAll(), Model.UnsketchAll(), or delete the model |
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().
ReturnsNo return value |
ExampleTo sketch point p: p.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches 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 |
Model that all the flagged points will be sketched in
Flag set on the points that you want to sketch
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().
ReturnsNo return value |
ExampleTo sketch all points flagged with flag in model m: MorphPoint.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of points in the model. |
Model to get total for
true if only existing points should be counted. If false or omitted referenced but undefined points will also be included in the total.
Returnsnumber of points Return typeNumber |
ExampleTo get the total number of points in model m: var total = MorphPoint.Total(m);
|
Unblank()DescriptionUnblanks the point |
No arguments
ReturnsNo return value |
ExampleTo unblank point p: p.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the points in the model. |
Model that all points 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 points in model m: MorphPoint.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged points in the model. |
Model that the flagged points will be unblanked in
Flag set on the points 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 points in model m flagged with f: MorphPoint.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the points in the model. |
Model that the defined flag for all points will be unset in
Flag to unset on the points
ReturnsNo return value |
ExampleTo unset the flag f on all the points in model m: MorphPoint.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the point. |
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().
ReturnsNo return value |
ExampleTo unsketch point p: p.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all points. |
Model that all points will be unblanked in
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().
ReturnsNo return value |
ExampleTo unsketch all points in model m: MorphPoint.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged points in the model. |
Model that all points will be unsketched in
Flag set on the points that you want to unsketch
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().
ReturnsNo return value |
ExampleTo unsketch all points flagged with flag in model m: MorphPoint.UnsketchAll(m, flag);
|
No arguments
ReturnsMorphPoint object. Return typeMorphPoint |
ExampleTo check if MorphPoint property p.example is a parameter by using the MorphPoint.GetParameter() method: if (p.ViewParameters().GetParameter(p.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for point. 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 point p: p.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this point. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for point p: var xrefs = p.Xrefs();
|
toString()DescriptionCreates a string containing the morph point data in keyword format. Note that this contains the keyword header and the keyword cards. See also MorphPoint.Keyword() and MorphPoint.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for morph point p in keyword format var s = p.toString();
|