The CrossSection class gives you access to database cross section cards 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 | Description |
| CrossSection.PLANE | PLANE is *DATABASE_CROSS_SECTION_PLANE. |
| CrossSection.SET | SET is *DATABASE_CROSS_SECTION_SET. |
| Name | Type | Description |
| bsid | integer | Beam set number. |
| colour | Colour | The colour of the cross section |
| csid | integer | Database cross section number (identical to label). |
| dsid | integer | Discrete set number. |
| exists (read only) | logical | true if cross section exists, false if referred to but not defined. |
| heading | string | Database cross section heading. |
| hsid | integer | Solid set number. |
| id | integer | Rigid part or accelerometer or coordinate system number. |
| idset | logical | true if _ID option is set, false if not |
| include | integer | The Include file number that the cross section is in. |
| itype | integer | Flag for local system type. |
| label | integer | Database cross section number. |
| lenl | real | Length of L edge. |
| lenm | real | Length of M edge. |
| model (read only) | integer | The Model number that the cross section is in. |
| nsid | integer | Node set number. |
| option | constant | The Database CrossSection option. Can be: |
| psid | integer | Part set number. |
| radius | real | Radius. |
| ssid | integer | Shell set number. |
| tsid | integer | Thick shell set number. |
| xch | real/integer | Head X coord of N normal vector. If <radius> is negative <xch> is a node ID which, combined with <xct>, defines the normal vector of the cut plane. |
| xct | real/integer | Tail X coord of N normal vector. If <radius> is negative <xct> is a node ID whose coordinates define the centre of the circular cut plane. |
| xhev | real | Head X coord of L edge vector. |
| ych | real | Head Y coord of N normal vector. |
| yct | real | Tail Y coord of N normal vector. |
| yhev | real | Head Y coord of L edge vector. |
| zch | real | Head Z coord of N normal vector. |
| zct | real | Tail Z coord of N normal vector. |
| zhev | real | Head Z coord of L edge vector. |
Detailed DescriptionThe CrossSection class allows you to create, modify, edit and manipulate database cross section cards. See the documentation below for more details. |
Constructornew CrossSection(Model[Model], option[constant], nsid[integer], hsid[integer], bsid[integer], ssid[integer], tsid[integer], dsid[integer], id (optional)[integer], itype (optional)[integer], csid (optional)[integer], heading (optional)[string]) [deprecated]This function is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionCreate a new CrossSection object for *DATABASE_CROSS_SECTION_SET. |
Model that database cross section will be created in
Database cross section type. Must be CrossSection.SET
Node set number.
Solid set number.
Beam set number.
Shell set number.
Thick shell set number.
Discrete set number.
Rigid part or accelerometer or coordinate system number.
Flag for local system type.
Database cross_section number.
Database cross_section title.
ReturnsCrossSection object Return typeCrossSection |
new CrossSection(Model[Model], option[constant], psid[integer], xct[real], yct[real], zct[real], xch[real], ych[real], zch[real], xhev[real], yhev[real], zhev[real], lenl (optional)[real], lenm (optional)[real], id (optional)[integer], itype (optional)[integer], csid (optional)[integer], heading (optional)[string], autosize (optional)[boolean], autosize_pct (optional)[real]) [deprecated]This function is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionCreate a new CrossSection object for *DATABASE_CROSS_SECTION_PLANE. |
Model that database cross section will be created in
Database cross section type. Must be CrossSection.PLANE
Part set number.
X coordinate of tail of normal vector.
Y coordinate of tail of normal vector.
Z coordinate of tail of normal vector.
X coordinate of head of normal vector.
Y coordinate of head of normal vector.
Z coordinate of head of normal vector.
X coordinate of head of edge vector.
Y coordinate of head of edge vector.
Z coordinate of head of edge vector.
Length in l direction.
Length in m direction.
Rigid part or accelerometer or coordinate system number.
Flag for local system type.
Database cross_section number.
Database cross_section title.
true if the Database cross_section is to be autosized.
Additional post-autosize scaling percentage.
ReturnsCrossSection object Return typeCrossSection |
new CrossSection(Model[Model], option[constant], settings[object])DescriptionCreate a new CrossSection object. |
Model that database cross section will be created in
Database cross section type. Must be CrossSection.SET or CrossSection.PLANE
Options specifying various properties used to create the keyword. If optional values are not specified then their default values will be used.
Object has the following properties:
| Name | Type | Description |
| autosize (optional) (PLANE only) | boolean | true if the Database cross_section is to be autosized. |
| autosize_pct (optional) (PLANE only) | real | Additional post-autosize scaling percentage. (default: same as value specified by the preference primer*cross_section_auto_size_percent) |
| bsid (SET only) | integer | Beam set number. |
| csid (optional) | integer | Database cross_section number. |
| dsid (SET only) | integer | Discrete set number. |
| heading (optional) | string | Database cross_section title. |
| hsid (SET only) | integer | Solid set number. |
| id (optional) | integer | Rigid part or accelerometer or coordinate system number. |
| itype (optional) | integer | Flag for local system type. |
| lenl (optional) (PLANE only) | real | Length in l direction. |
| lenm (optional) (PLANE only) | real | Length in m direction. |
| nsid (SET only) | integer | Node set number. |
| psid (PLANE only) | integer | Part set number. |
| ssid (SET only) | integer | Shell set number. |
| tsid (SET only) | integer | Thick shell set number. |
| vis_only (optional) (PLANE only) | real | true if autosizing should ignore non-visible elements, false otherwise. (default: true) |
| xch (PLANE only) | real | X coordinate of head of normal vector. |
| xct (PLANE only) | real | X coordinate of tail of normal vector. |
| xhev (PLANE only) | real | X coordinate of head of edge vector. |
| ych (PLANE only) | real | Y coordinate of head of normal vector. |
| yct (PLANE only) | real | Y coordinate of tail of normal vector. |
| yhev (PLANE only) | real | Y coordinate of head of edge vector. |
| zch (PLANE only) | real | Z coordinate of head of normal vector. |
| zct (PLANE only) | real | Z coordinate of tail of normal vector. |
| zhev (PLANE only) | real | Z coordinate of head of edge vector. |
ReturnsCrossSection object Return typeCrossSection |
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a cross section. |
Comment that will be attached to the cross section
ReturnsNo return value |
ExampleTo associate comment c to the cross section c: c.AssociateComment(c);
|
Autosize(options (optional)[object])DescriptionAutosizes a _PLANE cross section such that it cuts through all elements in model/psid along that plane. |
Object containing additional options
Object has the following properties:
| Name | Type | Description |
| percentage (optional) | real | Additional percentage that the autosized cross section will be scaled by. (default: same as value specified by the preference primer*cross_section_auto_size_percent) |
| vis_only (optional) | boolean | If true, autosizing will ignore non-visible cut elements, false otherwise. (default: true) |
ReturnsNo return value |
Blank()DescriptionBlanks the cross section |
No arguments
ReturnsNo return value |
ExampleTo blank cross section c: c.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the cross sections in the model. |
Model that all cross sections 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 cross sections in model m: CrossSection.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged cross sections in the model. |
Model that all the flagged cross sections will be blanked in
Flag set on the cross sections 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 cross sections in model m flagged with f: CrossSection.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the cross section is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if cross section c is blanked: if (c.Blanked() ) do_something...
|
Browse(modal (optional)[boolean])DescriptionStarts an edit panel in Browse mode. |
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.
Returnsno return value |
ExampleTo Browse cross section c: c.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the cross section. |
Flag to clear on the cross section
ReturnsNo return value |
ExampleTo clear flag f for cross section c: c.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the cross section. The target include of the copied cross section 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().
ReturnsCrossSection object Return typeCrossSection |
ExampleTo copy cross section c into cross section z: var z = c.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a cross section |
Model that the cross section will be created in.
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.
ReturnsCrossSection object (or null if not made). Return typeCrossSection |
ExampleTo start creating a cross section in model m: var c = CrossSection.Create(m);
|
CreateAlongFeatureLine(Model[Model], nid1[integer], options[object]) [static]DescriptionCreates a set of cross sections along a feature line and returns them as an array of CrossSection objects. Use Options.edge_angle to control the break angle for the feature line search within this function. |
Model that the cross_section will be created in
ID of feature line starting node. The first cross section will be created at this Node's location.
Additional arguments for controlling how the cross sections are created.
Object has the following properties:
| Name | Type | Description |
| autosize (optional) | boolean | true if cross sections are to be autosized. lenl and lenm will be ignored if set. |
| autosize_pct (optional) | real | If autosize is true, cross sections will be scaled by this additional percentage after being autosized. (default: same as value specified by the preference primer*cross_section_auto_size_percent) |
| direction (optional) | integer | Direction along feature line to create cross sections. +1 for positive direction (default), -1 for negative direction. Ignored for two node method (nid2 set). |
| lenl | real | Side length of plane along L vector - non-circular cross sections only. |
| lenm | real | Side length of plane along M vector - non-circular cross sections only. |
| nid2 (optional) | integer | ID of feature line ending node, can be the same as nid1. If provided, cross sections will be created between the nodes nid1 and nid2 along the shortest feature line path. |
| num | integer | Number of cross sections to be created. Required for single node method. For two node method either num or pitch must be specified. For two node method, the last cross section will be created at the location of node nid2 (provided nid1 != nid2). |
| pitch | real | Separation between adjacent cross sections. Required for single node method. For two node method either num or pitch must be specified. |
| psid (optional) | integer | ID of part set. |
| radius (optional) | real | Radius of circular cross section. |
| vis_only (optional) | boolean | If true, and autosize is true, autosizing will ignore non-visible cut elements, false otherwise (default: true). |
ReturnsArray of CrossSection objects (or null if not made). Depending on the geometry of the model and the node provided for nid1, the array may contain less CrossSection objects than requested for the single node method. Return typeArray |
DetachComment(Comment[Comment])DescriptionDetaches a comment from a cross section. |
Comment that will be detached from the cross section
ReturnsNo return value |
ExampleTo detach comment c from the cross section c: c.DetachComment(c);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel. |
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.
Returnsno return value |
ExampleTo Edit cross section c: c.Edit();
|
ElemCut(Shell label[integer])DescriptionReturns coordinates of the intersections between a shell and a database cross section. Note, ElemCut on the Shell class may be quicker |
The label of the shell.
ExampleTo get the cut line coordinates between database cross section x and shell 300: var data = x.ElemCut(300)
|
Error(message[string], details (optional)[string])DescriptionAdds an error for cross section. 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 cross section c: c.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for cross section. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing cross section c: var colour = c.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first cross section in the model. |
Model to get first cross section in
ReturnsCrossSection object (or null if there are no cross sections in the model). Return typeCrossSection |
ExampleTo get the first cross section in model m: var c = CrossSection.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free cross section label in the model. Also see CrossSection.LastFreeLabel(), CrossSection.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free cross section 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).
ReturnsCrossSection label. Return typeNumber |
ExampleTo get the first free cross section label in model m: var label = CrossSection.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the cross sections in the model with a defined flag. |
Model that all cross sections will be flagged in
Flag to set on the cross sections
ReturnsNo return value |
ExampleTo flag all of the cross sections with flag f in model m: CrossSection.FlagAll(m, f);
|
FlagCut(Flag[Flag])DescriptionFlags every element (solid,shell,tshell,beam) cut by the cross section. Note this function does not check that the element is in the cross section definition (part set) |
Flag bit.
ReturnsBoolean. Return typeBoolean |
ExampleTo find elements cut by database cross section x: x.FlagCut(flag)
|
Flagged(flag[Flag])DescriptionChecks if the cross section is flagged or not. |
Flag to test on the cross section
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if cross section c has flag f set on it: if (c.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each cross section in the model. |
Model that all cross sections are in
Function to call for each cross section
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 CrossSection objects or properties for all of the cross sections in a model in PRIMER. If the optional property argument is not given then an array of CrossSection objects is returned. If the property argument is given, that property value for each cross section is returned in the array instead of a CrossSection object |
Model to get cross sections from
Name for property to get for all cross sections in the model
ReturnsArray of CrossSection objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a cross section. |
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 cross section c: var comm_array = c.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of CrossSection objects for all of the flagged cross sections in a model in PRIMER If the optional property argument is not given then an array of CrossSection objects is returned. If the property argument is given, then that property value for each cross section is returned in the array instead of a CrossSection object |
Model to get cross sections from
Flag set on the cross sections that you want to retrieve
Name for property to get for all flagged cross sections in the model
ReturnsArray of CrossSection objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the CrossSection object for a cross section ID. |
Model to find the cross section in
number of the cross section you want the CrossSection object for
ReturnsCrossSection object (or null if cross section does not exist). Return typeCrossSection |
ExampleTo get the CrossSection object for cross section 100 in model m var c = CrossSection.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a CrossSection 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 CrossSection.ViewParameters() method and 'method chaining' (see the examples below). |
cross section property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this cross_section (*DATABASE_CROSS_SECTION). Note that a carriage return is not added. See also CrossSection.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for cross_section c: var key = c.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the cross_section. Note that a carriage return is not added. See also CrossSection.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for cross_section c: var cards = c.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last cross section in the model. |
Model to get last cross section in
ReturnsCrossSection object (or null if there are no cross sections in the model). Return typeCrossSection |
ExampleTo get the last cross section in model m: var c = CrossSection.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free cross section label in the model. Also see CrossSection.FirstFreeLabel(), CrossSection.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free cross section 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.
ReturnsCrossSection label. Return typeNumber |
ExampleTo get the last free cross section label in model m: var label = CrossSection.LastFreeLabel(m);
|
Next()DescriptionReturns the next cross section in the model. |
No arguments
ReturnsCrossSection object (or null if there are no more cross sections in the model). Return typeCrossSection |
ExampleTo get the cross section in model m after cross section c: var c = c.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) cross section label in the model. Also see CrossSection.FirstFreeLabel(), CrossSection.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free cross section 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).
ReturnsCrossSection label. Return typeNumber |
ExampleTo get the next free cross section label in model m: var label = CrossSection.NextFreeLabel(m);
|
PartCut(Part label[integer], Flag (optional)[Flag])DescriptionReturns true if cross section is cutting the part, false otherwise. If option flag is active, will flag every element of the part cut by the cross section. Note this function does not check that the part is in the cross section definition (part set) |
The label of the part.
Optional Flag to flag the element which are cut by the cross section.
ReturnsBoolean. Return typeBoolean |
ExampleTo know if a database cross section x cuts part 300: x.PartCut(300)
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a cross section. |
Text to display as a prompt to the user
If the argument is a Model then only cross sections from that model can be picked. If the argument is a Flag then only cross sections that are flagged with limit can be selected. If omitted, or null, any cross sections 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.
ReturnsCrossSection object (or null if not picked) Return typeCrossSection |
ExampleTo pick a cross section from model m giving the prompt 'Pick cross section from screen': var c = CrossSection.Pick('Pick cross section from screen', m);
|
Previous()DescriptionReturns the previous cross section in the model. |
No arguments
ReturnsCrossSection object (or null if there are no more cross sections in the model). Return typeCrossSection |
ExampleTo get the cross section in model m before cross section c: var c = c.Previous();
|
Properties()DescriptionReturns an object which describe various cross section properties |
No arguments
Returns |
Object with the following properties:
| Name | Type | Description |
| area | real | Area of material sliced by the cut section |
| first_yield_axial | real | First yield axial force |
| first_yield_mxx | real | First yield bending moment (Mxx) |
| first_yield_myy | real | First yield bending moment (Myy) |
| fully_plastic_mxx | real | Fully plastic bending moment (Mxx) |
| fully_plastic_myy | real | Fully plastic bending moment (Myy) |
| fully_plastic_xf | real | X component of equal force axis |
| fully_plastic_xf_g | real | X component of equal force axis calculated in global coordinates |
| fully_plastic_yf | real | Fully plastic axial force |
| fully_plastic_yf_g | real | Y component of equal force axis calculated in global coordinates |
| fully_plastic_zf_g | real | Z component of equal force axis calculated in global coordinates |
| iuu | real | Iuu principal second moments (UU - major) |
| ivv | real | Ivv principal second moments (VV - minor) |
| ixx | real | Ixx component of second moment of area |
| ixy | real | Ixy component of second moment of area |
| iyy | real | Iyy component of second moment of area |
| origin_x | real | X component of section origin |
| origin_y | real | Y component of section origin |
| origin_z | real | Z component of section origin |
| theta | real | Angle between Ixx and Iuu |
| x_comp_axis_x | real | X component of X-axis vector |
| x_comp_axis_y | real | X component of Y-axis vector |
| x_comp_axis_z | real | X component of Z-axis vector |
| xc | real | X component of centroid calculated from the first moment of area |
| xc_global | real | X component of centre of gravity calculated in global coordinates |
| xe | real | X component of equal area axis |
| xe_global | real | X component of equal area axis calculated in global coordinates |
| y_comp_axis_x | real | Y component of x-axis vector |
| y_comp_axis_y | real | Y component of Y-axis vector |
| y_comp_axis_z | real | Y component of Z-axis vector |
| yc | real | Y component of centroid calculated from the first moment of area |
| yc_global | real | Y component of centre of gravity calculated in global coordinates |
| ye | real | Y component of equal area axis |
| ye_global | real | Y component of equal area axis calculated in global coordinates |
| z_comp_axis_x | real | Z component of X-axis vector |
| z_comp_axis_y | real | Z component of Y-axis vector |
| z_comp_axis_z | real | Z component of Z-axis vector |
| zc_global | real | Z component of centre of gravity calculated in global coordinates |
| ze_global | real | Z component of equal area axis calculated in global coordinates |
| zxx | real | Plastic moduli Zxx |
| zyy | real | Plastic moduli Zyy |
object
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the cross sections in the model. |
Model that all cross sections will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the cross sections in model m, from 1000000: CrossSection.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged cross sections in the model. |
Model that all the flagged cross sections will be renumbered in
Flag set on the cross sections that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the cross sections in model m flagged with f, from 1000000: CrossSection.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select cross sections using standard PRIMER object menus. |
Flag to use when selecting cross sections
Text to display as a prompt to the user
If the argument is a Model then only cross sections from that model can be selected. If the argument is a Flag then only cross sections that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any cross sections 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 cross sections selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the cross section. |
Flag to set on the cross section
ReturnsNo return value |
ExampleTo set flag f for cross section c: c.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the cross section. The cross section will be sketched until you either call CrossSection.Unsketch(), CrossSection.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the cross section is sketched. If omitted redraw is true. If you want to sketch several cross sections and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch cross section c: c.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged cross sections in the model. The cross sections will be sketched until you either call CrossSection.Unsketch(), CrossSection.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged cross sections will be sketched in
Flag set on the cross sections that you want to sketch
If model should be redrawn or not after the cross sections are sketched. If omitted redraw is true. If you want to sketch flagged cross sections several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all cross sections flagged with flag in model m: CrossSection.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of cross sections in the model. |
Model to get total for
true if only existing cross sections should be counted. If false or omitted referenced but undefined cross sections will also be included in the total.
Returnsnumber of cross sections Return typeNumber |
ExampleTo get the total number of cross sections in model m: var total = CrossSection.Total(m);
|
Unblank()DescriptionUnblanks the cross section |
No arguments
ReturnsNo return value |
ExampleTo unblank cross section c: c.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the cross sections in the model. |
Model that all cross sections 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 cross sections in model m: CrossSection.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged cross sections in the model. |
Model that the flagged cross sections will be unblanked in
Flag set on the cross sections 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 cross sections in model m flagged with f: CrossSection.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the cross sections in the model. |
Model that the defined flag for all cross sections will be unset in
Flag to unset on the cross sections
ReturnsNo return value |
ExampleTo unset the flag f on all the cross sections in model m: CrossSection.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the cross section. |
If model should be redrawn or not after the cross section is unsketched. If omitted redraw is true. If you want to unsketch several cross sections and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch cross section c: c.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all cross sections. |
Model that all cross sections will be unblanked in
If model should be redrawn or not after the cross sections 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 cross sections in model m: CrossSection.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged cross sections in the model. |
Model that all cross sections will be unsketched in
Flag set on the cross sections that you want to unsketch
If model should be redrawn or not after the cross sections 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 cross sections flagged with flag in model m: CrossSection.UnsketchAll(m, flag);
|
No arguments
ReturnsCrossSection object. Return typeCrossSection |
ExampleTo check if CrossSection property c.example is a parameter by using the CrossSection.GetParameter() method: if (c.ViewParameters().GetParameter(c.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for cross section. 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 cross section c: c.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this cross section. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for cross section c: var xrefs = c.Xrefs();
|
toString()DescriptionCreates a string containing the cross_section data in keyword format. Note that this contains the keyword header and the keyword cards. See also CrossSection.Keyword() and CrossSection.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for cross_section c in keyword format var s = c.toString();
|