Visibility
Functions and constants relating to Visibility
Functions
- Blank(type_code[integer], item[integer or array of integers or string], window_id (optional)[integer])
- IsBlanked(type_code[integer], item[integer], window_id (optional)[integer])
- IsDeleted(type_code[integer], item[integer], state_id (optional)[integer])
- IsVisible(type_code[integer], item[integer], window_id[integer], state_id (optional)[integer])
- NumDeleted(type_code[integer], state_id (optional)[integer])
- Unblank(type_code[integer], item[integer or array of integers or string], window_id (optional)[integer])
Details of functions
Blank(type_code[integer], item[integer or array of integers or string], window_id (optional)[integer])
[static]
DescriptionBlank an item
|
Arguments
type_code (integer)
The type of item to check (SOLID, PART etc.)
Note: If <item> is "ALL_DEL" (all deleted elements), only element types are acceptable.
item (integer or array of integers or string)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
It can also be an array of items (index/label) or a string indicating various items
("ALL" for all items of the type and "ALL_DEL" for deleted items of the type.)
window_id (optional) (integer)
A window id. If defined then the item is blanked in that window. If not defined
or set 0 to then the item is blanked in all windows.
Example
// Blanks the 1st PART in the current model in all windows
Blank(PART, 1);
// Blanks the 1st PART in the current model in window 2
Blank(PART, 1, 2);
// Blanks the 1st PART in the current model in all windows
Blank(PART, 1, 0);
// Blanks all PARTs in window 2
Blank(PART, "ALL", 2);
// Blanks everything in window 2
Blank(MODEL, "ALL", 2);
// Blanks all SHELLs specified in the array shell_list in window 1
Blank(SHELL, shell_list, 1);
|
IsBlanked(type_code[integer], item[integer], window_id (optional)[integer])
[static]
DescriptionChecks whether an item is currently blanked. If the type is PART
then this function will only return true if all elements of the PART are currently blanked. If the PART is empty this returns false
|
Arguments
type_code (integer)
The type of item to check (SOLID, etc.)
item (integer)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
window_id (optional) (integer)
A window id. If defined then the function will return true if the item is blanked in that window. If not defined
or set to then the function returns true if it is blanked in any window.
Returns
boolean
Return type
Boolean
|
Example
// Return true if the 1st SHELL in the model is blanked in any window
if(IsBlanked(SHELL, 1))
{
....
}
// Return true if the 1st SHELL in the model is blanked in window 2
if(IsBlanked(SHELL, 1, 2))
{
....
}
// Return true if the 1st SHELL in the model is blanked in any window
if(IsBlanked(SHELL, 1, 0))
{
....
}
|
IsDeleted(type_code[integer], item[integer], state_id (optional)[integer])
[static]
Description
Checks whether an item is currently deleted. If the type is PART then this function will only return true if all the
elements of the PART are currently deleted
The deleted status is computed as follows:
- Part-based elements: Ansys LS-DYNA reports the deletion status for part-based elements (but not DISCRETE or 1d SEATBELT elements)
which have failed according to the failure criteria of their deletion model. Reincarnation of dead elements is possible:
*DEFINE_CONSTRUCTION_STAGES will result in an inactive element being marked as deleted, and it will be "undeleted" if that stage
becomes active later on in the analysis.
- Parts themselves: Ansys LS-DYNA does not delete parts as such. A deformable part in which all elements have been deleted is removed
from the calculation, but this removal is not reported in the results database. D3PLOT considers a part to be deleted if it has no
elements, or all of its elements are marked as deleted. Note that a rigid part with no elements is a perfectly legitimate- if unusual -
construct in Ansys LS-DYNA.
- Nodes: Ansys LS-DYNA does not delete nodes, but nodes with no structural mass are removed from the calculation. However this removal
is not reported in the results database. D3PLOT considers a node to be deleted if all the elements to which it is attached are
themselves deleted. Remember that D3PLOT does not "know about" all possible connections to a node, for example it may be an extra
node on a rigid body, in a rigid part set, or constrained in some other obscure way. Therefore the test "deleted if all attached nodes
are deleted" may give false positives and should not be considered definitive.
|
Arguments
type_code (integer)
This function only supports the following type codes.
PART,
NODE,
SOLID,
BEAM,
TSHELL,
SPH,
DES
item (integer)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
state_id (optional) (integer)
A valid state id. If omitted the current state will be used.
Returns
boolean
Return type
Boolean
|
Example
// Returns true if the 1st SHELL in the model has been deleted
if(IsDeleted(SHELL, 1))
{
....
}
|
IsVisible(type_code[integer], item[integer], window_id[integer], state_id (optional)[integer])
[static]
Description
Checks whether an item is currently visible.
An item is considered "visible" if the following conditions are all true:
- Not blanked
- The visibility switch is on for type_code
- Is not empty, if type is PART
- The item has not been deleted in the current state if the type is an element
|
Arguments
type_code (integer)
This function only supports the following type codes.
PART,
NODE,
SOLID,
BEAM,
TSHELL,
SPH,
DES
item (integer)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
window_id (integer)
A valid window id
state_id (optional) (integer)
A valid state id. If omitted the current state will be used.
Returns
boolean
Return type
Boolean
|
Example
// Returns true if the 1st SHELL in the model in the first window is visible
if(IsVisible(SHELL, 1, 1))
{
....
}
|
NumDeleted(type_code[integer], state_id (optional)[integer])
[static]
DescriptionGets the number of deleted elements or segments
|
Arguments
type_code (integer)
The type of item to check.
Only accepts ELEM for #elements or SEGM for #segments.
state_id (optional) (integer)
A state id. If defined then the number of deleted items is calculated for that state. If not defined
or set to 0 then the number of items is calculated for the current state.
Returns
integer
Return type
Number
|
Example
// Number of deleted elements in current state of the current model
var a = NumDeleted(ELEM);
// Number of deleted elements in state 3 of the current model
var b = NumDeleted(ELEM, 3);
// Number of deleted segments in state 5 of the current model
var c = NumDeleted(SEGM, 5);
|
Unblank(type_code[integer], item[integer or array of integers or string], window_id (optional)[integer])
[static]
DescriptionUnblank an item
|
Arguments
type_code (integer)
The type of item to check (SOLID, PART etc.)
Note: If <item> is "ALL_DEL" (all deleted elements), only element types are acceptable.
item (integer or array of integers or string)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
It can also be an array of items (index/label) or a string indicating various items
("ALL" for all items of the type and "ALL_DEL" for deleted items of the type.)
window_id (optional) (integer)
A window id. If defined then the item is unblanked in that window. If not defined
or set to 0 then the item is unblanked in all windows.
Example
// Unblanks the 1st PART in the current model in all windows
Unblank(PART, 1);
// Unblanks the 1st PART in the current model in window 2
Unblank(PART, 1, 2);
// Unblanks the 1st PART in the current model in all windows
Unblank(PART, 1, 0);
// Unblanks all PARTs in window 2
Unblank(PART, "ALL", 2);
// Unblanks everything in window 2
Unblank(MODEL, "ALL", 2);
// Unblanks all SOLIDs specified in the array solid_list in window 1
Unblank(SOLID, solid_list, 1);
|