Functions and constants relating to CutSection
| Name | Description |
| NORMAL | This constant 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. Positive or negative action Normal. Use Constant.NORMAL instead [deprecated] |
| OMIT | This constant 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. Positive or negative action Omit. Use Constant.OMIT instead [deprecated] |
| OUTLINE | This constant 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. Positive or negative action Outline (wire drawing). Use Constant.OUTLINE instead [deprecated] |
| TRANSPARENT | This constant 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. Positive or negative action Transparent. Use Constant.TRANSPARENT instead [deprecated] |
| Name | Description |
| INTERSECTION | This constant 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. Intersection mode for multiple cut directions. Use Constant.INTERSECTION instead [deprecated] |
| UNION | This constant 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. Union mode for multiple cut directions. Use Constant.UNION instead [deprecated] |
| Name | Description |
| CONST_X | This constant 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. Constant X definition method. Use Constant.CONST_X instead [deprecated] |
| CONST_Y | This constant 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. Constant Y definition method. Use Constant.CONST_Y instead [deprecated] |
| CONST_Z | This constant 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. Constant Z definition method. Use Constant.CONST_Z instead [deprecated] |
| LS_DYNA | This constant 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. Ansys LS-DYNA definition method. Use Constant.LS_DYNA instead [deprecated] |
| N3 | This constant 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. 3 nodes definition method. Use Constant.N3 instead [deprecated] |
| OR_AND_V | This constant 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. Origin and vectors definition method. Use Constant.OR_AND_V instead [deprecated] |
| Name | Description |
| BASIC | This constant 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. Basic (eulerian) space. Use Constant.BASIC instead [deprecated] |
| DEFORMED | This constant 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. Deformed (lagrangian) space. Use Constant.DEFORMED instead [deprecated] |
| SPACE | This constant is deprecated in version 20.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. Space system call argument [deprecated] |
Details of functionsGetCutCoords(options[object]) [static]DescriptionReturns the coordinates where the cut-section cuts through element <type/item>. |
Object has the following properties:
| Name | Type | Description |
| direction_id (optional) | integer | Index starting at 1 of the plane direction for multiple non-parallel planes. This should be at most the number of non-parallel planes (at most 3 if the maximum number of planes is defined). If omitted, the data for the first plane direction will be used. |
| item | integer | If +ve, the internal item number starting at 1. If -ve, the external label of the item. |
| model_id (optional) | integer | A valid model id that exists in <window_id>. |
| state_id (optional) | integer | State number to be used instead of the current state |
| type_code | integer | A valid type code (SHELL etc.)) |
| window_id (optional) | integer | A valid window id. |
Returns |
Object with the following properties:
| Name | Type | Description |
| n | integer | Number of places the cut-section cuts the item |
| x | array of reals | X coordinates where item is cut |
| y | array of reals | Y coordinates where item is cut |
| z | array of reals | Z coordinates where item is cut |
object
A valid type code (SHELL etc.))
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
State number to be used instead of the current state
Returns |
Object with the following properties:
| Name | Type | Description |
| n | integer | Number of places the cut-section cuts the item |
| x | array of reals | X coordinates where item is cut |
| y | array of reals | Y coordinates where item is cut |
| z | array of reals | Z coordinates where item is cut |
object
GetCutForces(options[object]) [static]Description
Returns the forces, moments, centroid and area of the cut section in <window_id>. The coordinate system of these results depends upon the cut section's space system as follows:
WARNING #1: Cut-sections in D3PLOT are a "per window" attribute, cutting all models in a window at the current "frame". If the optional <state_id> argument is not supplied the forces and moments returned will be at the state of the current "frame" of the window, and while this will normally be the same as the current "state" this is not necessarily the case, since the user may have interpolated results by time Likewise if the optional <model_id> argument is not supplied then the model used will be the first in the window (as reported by function GetWindowModels()), which may not be the same as the "current model" of the JavaScript interface. Therefore to avoid ambiguity when extracting cut-section forces and moments it is recommended that:
This "single model in a window" approach is strongly recommended in this context since visual feedback will then match computed values. WARNING #2: By default computed forces do NOT include blanked elements. Since cut section display is primarily intended to be used interactively the default behaviour is to omit blanked elements from the forceand moment calculation, since in this way the reported values match what is visible on the screen. This behaviour is not ideal for batch processing since the user can, by manipulating blanking, change the results which are computed. Therefore the optional argument <include_blanked> may be used to override this behaviour and to force blanked elements to be considered. If omitted, or set to zero, then the default behaviour of omitting blanked elements will continue. WARNING #3: Cutting a model exactly at mesh lines can result in ill-conditioned force and moment calculation. It is tempting to define cut planes at nodes since this is easy to do, however this can give rise to ill-conditioning in a rectilinear mesh since the cut may lie exactly on the border between two adjacent elements and therefore won't "know" which one's results to use. Since Ansys LS-DYNA elements are constant stress there can be a step change in data values at element borders, and moving the cut plane by a tiny amount can result in a correspondingly large change in cut force and moment values. It is strongly recommended that cut section definitions used for force and moment extraction should be located away from mesh lines so that they cut elements near their centres, thus avoiding any ambiguity about which elements to use. WARNING #4: Any element types or parts excluded from the cut section are still included in the force and moment calculation. |
Object has the following properties:
| Name | Type | Description |
| direction_id (optional) | integer | Index starting at 1 of the plane direction for multiple non-parallel planes. This should be at most the number of non-parallel planes (at most 3 if the maximum number of planes is defined). If omitted, the data for the first plane direction will be used. |
| include_blanked (optional) | integer | 0 to omit blanked elements (default), 1 to include them |
| model_id (optional) | integer | Model id that exists in <window_id>. If omitted the first model in the window will be used. |
| part_id (optional) | integer | 0 all part ids considered (default), otherwise only forces in the specified part are computed. If +ve this is the internal part index, if -ve this is the external part label. |
| state_id (optional) | integer | State number to be used. If omitted the state of the window's current frame will be used. |
| window_id (optional) | integer | A valid window id. If omitted, cut section data for window 1 will be used. |
Returns |
Object with the following properties:
| Name | Type | Description |
| area | real | Cut section area |
| centroid | array of reals | Cut section centroid, [Cx, Cy, Cz] |
| force | array of reals | 3 Forces, [Fx, Fy, Fz] |
| moment | array of reals | 3 Moments, [Mxx, Myy, Mzz] |
object
A valid window id
0 to omit blanked elements (default), 1 to include them
0 all part ids considered (default), otherwise only forces in the specified part are computed. If +ve this is the internal part index, if -ve this is the external part label.
State number to be used. If omitted the state of the window's current frame will be used.
Model id that exists in <window_id>. If omitted the first model in the window will be used.
Returns |
Object with the following properties:
| Name | Type | Description |
| area | real | Cut section area |
| centroid | array of reals | Cut section centroid, [Cx, Cy, Cz] |
| force | array of reals | 3 Forces, [Fx, Fy, Fz] |
| moment | array of reals | 3 Moments, [Mxx, Myy, Mzz] |
object
GetCutSection(options[object]) [static]DescriptionRetrieves all attributes of the cut section in <window_id>. |
Retrieves all attributes of the cut section in <window_id>.
Object has the following properties:
| Name | Type | Description |
| direction_id (optional) | integer | Index starting at 1 of the plane direction for multiple non-parallel planes. This should be at most the number of non-parallel planes (at most 3 if the maximum number of planes is defined). If omitted, the data for the first plane direction will be used. |
| model_id (optional) | integer | A valid model id that exists in <window_id>. If omitted the state of the window's current frame will be used. This only matters if the section uses the method CONST_X, CONST_Y or CONST_Z defined by a node or N3 and it has been set to follow nodes with FOLLOW_N. In which case the section origin and/or vectors may change as the node(s) move. |
| state_id (optional) | integer | State number to be used. If omitted the state of the window's current frame will be used. This only matters if the section uses the method CONST_X, CONST_Y or CONST_Z defined by a node or N3 and it has been set to follow nodes with FOLLOW_N. In which case the section origin and/or vectors may change as the node(s) move. |
| window_id (optional) | integer | A valid window id. If omitted, cut section data for window 1 will be returned. |
Returns |
Object with the following properties:
| Name | Type | Description |
| combination | integer | How positive and negative actions for multiple directions are combined. Can be UNION or INTERSECTION. Note that this only has an effect with at least 2 cut plane directions. |
| definition | integer | One of OR_AND_V, CONST_X, CONST_Y, CONST_Z, N3, LS_DYNA or zero if no section has been defined yet |
| follow_n | integer | ON if the section follows any defining node(s) as appropriate, OFF if it does not. This value is only meaningful for definition == CONST_X/Y/Z where a node in nodes[0] was supplied, and N3 |
| multi_custom_cut | logical | whether or not custom spacing for multiple parallel cuts is on |
| multi_cut | logical | whether or not multiple parallel cuts are on |
| negative_action | integer | Negative action for the cut direction. Can be OMIT, OUTLINE, NORMAL or TRANSPARENT. |
| nneg | integer | number of negative parallel planes when multi_cut is true and multi_custom_cut is false, undefined otherwise |
| nodes | array of integers |
For definition = CONST_X/Y/Z: nodes[0] = index of node if supplied For definition = N3: nodes[0 to 2] = indices of three N3 nodes This array will always be present and have three entries, with unused entries being set to zero. |
| npos | integer | number of positive parallel planes when multi_cut is true and multi_custom_cut is false, undefined otherwise |
| origin | array of reals | Origin coordinates |
| positive_action | integer | Positive action for the cut direction. Can be OMIT, OUTLINE, NORMAL or TRANSPARENT. |
| space | integer | Either BASIC or DEFORMED |
| spacing | real or array of reals |
when multi_custom_cut is false and multi_cut is true: spacing value when multi_custom_cut is true and multi_cut is true: array of offsets from the local cut origin when multi_cut is false: 0.0 |
| status | integer | Either OFF or ON |
| thick_cut | logical | whether or not thick cut is on |
| thickness | real | thickness for thick cuts when thick_cut is true, 0.0 otherwise |
| visible | integer | ON if the cut direction is active, OFF otherwise. |
| x_axis | array of reals | Local X axis vector (normalised) |
| y_axis | array of reals | Local Y axis vector (normalised) |
| z_axis | array of reals | Local Z axis vector (normalised) |
object
A valid window id
State number to be used. If omitted the state of the window's current frame will be used. This only matters if the section uses the method CONST_X, CONST_Y or CONST_Z defined by a node or N3 and it has been set to follow nodes with FOLLOW_N. In which case the section origin and/or vectors may change as the node(s) move.
A valid model id that exists in <window_id>. If omitted the state of the window's current frame will be used. This only matters if the section uses the method CONST_X, CONST_Y or CONST_Z defined by a node or N3 and it has been set to follow nodes with FOLLOW_N. In which case the section origin and/or vectors may change as the node(s) move.
Returns |
Object with the following properties:
| Name | Type | Description |
| definition | integer | One of OR_AND_V, CONST_X, CONST_Y, CONST_Z, N3, LS_DYNA or zero if no section has been defined yet |
| follow_n | integer | ON if the section follows any defining node(s) as appropriate, OFF if it does not. This value is only meaningful for definition == CONST_X/Y/Z where a node in nodes[0] was supplied, and N3 |
| multi_custom_cut | logical | whether or not custom spacing for multiple parallel cuts is on |
| multi_cut | logical | whether or not multiple parallel cuts are on |
| nneg | integer | number of negative parallel planes when multi_cut is true and multi_custom_cut is false, undefined otherwise |
| nodes | array of integers |
For definition = CONST_X/Y/Z: nodes[0] = index of node if supplied For definition = N3: nodes[0 to 2] = indices of three N3 nodes This array will always be present and have three entries, with unused entries being set to zero. |
| npos | integer | number of positive parallel planes when multi_cut is true and multi_custom_cut is false, undefined otherwise |
| origin | array of reals | Origin coordinates |
| space | integer | Either BASIC or DEFORMED |
| spacing | real or array of reals |
when multi_custom_cut is false and multi_cut is true: spacing value when multi_custom_cut is true and multi_cut is true: array of offsets from the local cut origin when multi_cut is false: undefined |
| status | integer | The status of the cutting switch. Either OFF or ON |
| thick_cut | logical | whether or not thick cut is on |
| thickness | real | thickness for thick cuts when thick_cut is true, undefined otherwise |
| x_axis | array of reals | Local X axis vector (normalised) |
| y_axis | array of reals | Local Y axis vector (normalised) |
| z_axis | array of reals | Local Z axis vector (normalised) |
object
Object has the following properties:
| Name | Type | Description |
| direction_id (optional) | integer | Index starting at 1 of the plane direction to be removed. This should be at most the number of non-parallel planes (at most 3 if the maximum number of planes is defined). If omitted, the last plane direction will be removed. |
| window_id | integer | A valid window ID |
Returns
Return type |
Example
// Assuming that there are 3 non-parallel cut planes in window 1, remove the second direction:
RemoveCutDirection({ window_id:1, direction_id:2 });
|
SetCutSection(options[object]) [static]Description
Sets properties of the cut section in <window_id> Each D3PLOT window can have cut planes in up to three directions, which are by default not active. Their location, orientation and type can be defined here, and it can be turned on or off. Forces and moments from the cut sections can be obtained from function GetCutForces(). Cut section definitions are a "per window" attribute that apply to all models in the window. Thefore if the window has multiple models, and nodes are used to define the section (CONST_X, CONST_Y, CONST_Z with a node or N3), the origin and/or vectors of the section may vary for each model in the window. In addition if the coordinates of these nodes are "followed" (see the <follow_n> property on the options), then the section locations may change from state to state. |
The cut section properties which should be changed.
All coordinates and vectors must be defined in model space, and will always form an orthogonal right handed coordinate system in which local Z is normal to the cut plane.
Vector length is irrelevant (but should be well-conditioned), and the Y axis is obtained automatically from the vector cross product Z_AXIS x X_AXIS. If the Z and X axes as supplied are not at right angles the X will be updated to make it orthogonal to Y and Z.
<nodes[0]> or <origin> will define the cut section origin coordinate. The array <nodes> for N3 or origin/x_axis/xy_plane will define the cut section orientation.
Care must be taken when defining nodes for windows that contain multiple models. Since a node index (+ve) may resolve to a different node in each model it is usually best to use external labels (-ve) in this context to avoid ambiguity. (The speed of the external => internal lookup will not matter as this function is unlikely to be called many times.)
FOLLOW_N(odes) will only have an effect if the cut section is defined by node(s), i.e. CONST_X, CONST_Y or CONST_Z with nodes[0] or N3.
Object has the following properties:
| Name | Type | Description |
| attribute (optional) | integer | This property is deprecated in version 20.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. Can be one of STATUS, SPACE, OR_AND_V, CONST_X, CONST_Y, CONST_Z, N3, LS_DYNA, FOLLOW_N. From D3PLOT 20.0 onwards this property can be omitted in the SPACE, OR_AND_V and FOLLOW_N cases, whereas in the other cases the <definition> property should be used with the same value. [deprecated] |
| combination (optional) | integer | How positive and negative actions for multiple directions are combined. Can be UNION or INTERSECTION. Note that this only has an effect with at least 2 cut plane directions. |
| definition (optional) | integer | Definition method for the cut plane direction. Can be one of OR_AND_V, CONST_X, CONST_Y, CONST_Z, N3, LS_DYNA. This can be omitted when only properties independent from the plane position are changed, for example <follow_n> or <status>. |
| direction_id (optional) | integer | Index starting at 1 of the plane direction for multiple non-parallel planes. Can be 1, 2 or 3. It can be either an existing direction index to update or a free index to add a new plane direction. If <direction> is omitted, the data for the first plane direction will be set by this function. |
| follow_n (optional) | integer | OFF or ON (default OFF). Determines whether or not a DEFORMED space section will track the motion of the node(s) used to define it. This is only meaningful for sections defined by: |
| negative_action (optional) | integer | Negative action for the cut direction. Can be OMIT, OUTLINE, NORMAL or TRANSPARENT. |
| nneg (optional) | integer | number of negative parallel planes for uniform spacing (required when <spacing> is a single positive number for uniform spacing) |
| nodes (optional) | array of integers | Array of +ve indices or -ve labels of the nodes. For CONST_X, CONST_Y or CONST_Z this should have length 1 and contain the node whose X, Y or Z coordinate defines the plane position. For N3 it should have length 3 containing the three nodes where the plane passes through. (required for <definition> CONST_X, CONST_Y or CONST_Z when origin is not defined or for <definition> N3) |
| normal_head (optional) | array of reals | Normal head coordinate (required for <definition> LS_DYNA) |
| npos (optional) | integer | number of positive parallel planes for uniform spacing (required when <spacing> is a single positive number for uniform spacing) |
| origin (optional) | array of reals | Coordinate array defining the origin of the plane. (for <definition> CONST_X, CONST_Y or CONST_Z when nodes is not defined or for <definition> OR_AND_V or LS_DYNA) |
| positive_action (optional) | integer | Positive action for the cut direction. Can be OMIT, OUTLINE, NORMAL or TRANSPARENT. |
| space (optional) | integer | BASIC or DEFORMED (default). Determines whether the section is Lagrangian (BASIC) or Eulerian (DEFORMED). In the BASIC case the section is tied to the undeformed geometry and will move and distort as the model deforms, in the DEFORMED case the section is fixed in model space and the structure passes through it. For compatibility with LS_DYNA the way forces are calculated also varies with section space - see the documentation on GetCutForces(). |
| spacing (optional) | real or array of reals | Spacing for multiple parallel cuts. If this is a single positive number, multiple parallel cuts with uniform spacing will be turned on, where <npos> and <nneg> will be required to define the number of planes in the positive and negative directions. If this is an array of real numbers, multiple parallel cuts with custom spacing will be turned on, where this array is the list of offsets from the local cut origin. If spacing is 0.0, multiple parallel cuts will be turned off. If spacing is undefined, then multiple parallel cuts will keep their existing spacing. |
| status (optional) | integer | OFF or ON (default OFF). Determines whether or not the cutting switch is on in the current window. The cutting switch does not need to be on in order to compute cut forces and moments. |
| thickness (optional) | real | Thickness for thick cuts. If positive, thick cuts will be turned on. If 0.0, thick cuts will be turned off. If thickness is undefined, then thick cuts and thickness will remain on or off as before. |
| visible (optional) | integer | OFF or ON (default ON). Determines whether or not the cut direction at <direction_id> is active. For it to be visible, in addition to this <visible> property also the cutting switch needs to be turned on with <status>. |
| window_id (optional) | integer | A valid window id or ALL for all active windows. If omitted, the cut section will be set for ALL windows. |
| x_axis (optional) | array of reals | X axis vector (required for <definition> OR_AND_V) |
| x_axis_head (optional) | array of reals | X axis head coordinate (required for <definition> LS_DYNA) |
| xy_plane (optional) | array of reals | XY plane vector (required for <definition> OR_AND_V) |
Returnsboolean Return typeBoolean |
SetCutSection(window_id[integer], attribute[integer], value[integer | array of reals | array of integers]) [static] [deprecated]This function is deprecated in version 19.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. Description
Sets properties of the cut section in <window_id> Each D3PLOT window can have cut planes in up to three directions, which are by default not active. Their location, orientation and type can be defined here, and it can be turned on or off. Forces and moments from the cut sections can be obtained from function GetCutForces(). Cut section definitions are a "per window" attribute that apply to all models in the window. Thefore if the window has multiple models, and nodes are used to define the section (CONST_X, CONST_Y, CONST_Z with a node or N3), the origin and/or vectors of the section may vary for each model in the window. In addition if the coordinates of these nodes are "followed" (see the <follow_n> property on the options), then the section locations may change from state to state. |
A valid window id or ALL for all active windows
Can be one of STATUS, SPACE, OR_AND_V, CONST_X, CONST_Y, CONST_Z, N3, LS_DYNA, FOLLOW_N.
The value of the specified <attribute>
The section can be defined by any of the following:
All coordinates and vectors must be defined in model space, and will always form an orthogonal right handed coordinate system in which local Z is normal to the cut plane.
Vector length is irrelevant (but should be well-conditioned), and the Y axis is obtained automatically from the vector cross product Z_AXIS x X_AXIS. If the Z and X axes as supplied are not at right angles the X will be updated to make it orthogonal to Y and Z.
<nodes[0]> or <origin> will define the cut section origin coordinate. The array <nodes> for N3 or origin/x_axis/xy_plane will define the cut section orientation.
Care must be taken when defining nodes for windows that contain multiple models. Since a node index (+ve) may resolve to a different node in each model it is usually best to use external labels (-ve) in this context to avoid ambiguity. (The speed of the external => internal lookup will not matter as this function is unlikely to be called many times.)
FOLLOW_N(odes) will only have an effect if the cut section is defined by node(s), i.e. CONST_X, CONST_Y or CONST_Z with nodes[0] or N3.
Returnsboolean Return typeBoolean |