Syntax
array set mats [ABAMATERIALS GET LIST]
set matID [ABAMATERIALS GET MATERIAL imat]
Description
Query of the materials list in the analysis model
Query the existence of a specific material
Argument |
Dimension |
Meaning |
GET |
KEYWORD |
Query data |
LIST |
KEYWORD |
Query the list of materials |
MATERIAL |
KEYWORD |
Query material ID or material existence |
imat |
INT |
Number of material |
Return array for [ABAMATERIALS GET LIST]
Array item |
Dimension |
Meaning |
error |
INT |
Error code |
info |
TEXT |
Error information |
first |
OBJID |
Object-ID of the first list element |
last |
OBJID |
Object-ID of the last list element |
count |
INT |
Number of list elements |
Return for [ABAMATERIALS GET MATERIAL imat]
Return |
Dimension |
Meaning |
matID |
OBJID |
Material-ID or 0 |
Scopes
All
Examples
# list of materials
array set mats [ABAMATERIALS GET LIST]
if { $mats(error) != 0 } { ABMERROR "Error: " $mats(error) " Info: " $mats(info) }
ABMINFO "First: " $mats(first) " Last: " $mats(last) " Count: " $mats(count) " Error: " $mats(error) " Info: " $mats(info)
if { $mats(count) < 1 } {
set error "No materials found."
ABMERROR $error
puts $outfile $error
return
}
# material data
set ID $mats(first)
for { set imat 0 } { $imat < $mats(count) } { incr imat } {
if { $imat > 0 } { set ID [OBJNEXT $ID] }
array unset mat
array set mat [ABAMATERIAL $ID GET]
}
The list of materials is queried. The list is run through in a for-loop and the data of the respective material object is queried.
# find a material by its number
set ID [ABAMATERIALS GET MATERIAL 2]
if { $ID == 0 } {
set error "Material '2' not found."
ABMERROR $error
return
}
The ID of the material with the number 2 is queried. In case of an error, a message is written.
|
(C) ALLPLAN GmbH |
Privacy policy |