Syntax
array set rescol [ABRDESIGN colname GET]
set iexist [ABRDESIGN colname EXIST]
array set ret [ABRDESIGN colname INS longname coltype ucode usymb descr]
array set ret [ABRDESIGN colname DEL]
Description
Query the data for a specific result
Checking the existence of a specific result
Adding a new result
Deleting an existing result
Argument |
unit |
Meaning |
colname |
TEXT |
Column name; the name should be short and must comply with the SQL rules for column names. |
GET |
KEYWORD |
Query data |
EXIST |
KEYWORD |
Check for existence |
INS |
KEYWORD |
Adding a new result |
DEL |
KEYWORD |
Deleting an existing result |
longname |
TEXT |
Long name of the result (arg2 = INS) |
coltype |
ENUM |
SQL data type (“?”, “INT”, “REAL”, “TEXT”, “BLOB”), (arg2 = INS) |
ucode |
ENUM |
Units code (see PROJECT/UNIT command); there are also the dimensions "1/TEMP", "FORCE/L", "FORCE/L/L", "AREINF/L", "LSTRUCT**3". (arg2 = INS) |
usymb |
TEXT |
Unit symbol; only to be specified if ucode = "NONE". In this case, you can select the symbol yourself. (arg2 = INS) |
descr |
TEXT |
Descriptive text (arg2 = INS) |
Return field for [ABRDESIGN ... GET]
Field argument |
unit |
Meaning |
colname |
TEXT |
Column name |
longname |
TEXT |
Long name of the result |
coltype |
ENUM |
SQL data type (“?”, “INT”, “REAL”, “TEXT”, “BLOB”) |
ucode |
ENUM |
Units code (see PROJECT/UNIT command); there are also the dimensions "1/TEMP", "FORCE/L", "FORCE/L/L", "AREINF/L", "LSTRUCT**3". |
usymb |
TEXT |
Unit symbol |
column |
INT |
Column number of result |
validx |
INT |
0-based index of the result in the return field of the values (see ABRDESIGNROW ... GETPACKED) |
info |
TEXT |
Descriptive text or error information |
error |
INT |
Error status |
Return for [ABRDESIGN ... EXIST]
Return |
unit |
Meaning |
iexist |
INT |
0 - Result not present, 1 - result exists |
Return field for [ABRDESIGN ... INS ... ]
Field argument |
unit |
Meaning |
error |
INT |
Error status |
info |
TEXT |
Error information |
Return field for [ABRDESIGN ... DEL]
Field argument |
unit |
Meaning |
error |
INT |
Error status |
info |
TEXT |
Error information |
Scopes
All
Examples
set format1 " %-24s %-24s %-4s %-12s %-12s"
# get content of all columns 0,1,...,count-1
set rescols [ABRDESIGN GET RESULTS]
set count [llength $rescols]
puts $outfile ""
puts $outfile " Column Name Long Name Type Unit Symbol"
puts $outfile " --------------------------------------------------------------------------"
foreach colname $rescols {
array unset column
array set column [ABRDESIGN $colname GET]
puts $outfile [format $format1 $colname $column(longname) $column(coltype) $column(ucode) $column(usymb)]
}
It is assumed that an outfile text file is opened for writing to. The result data is formatted and written to the text file.
The outputs depend on the project and can be as follows, for example:
Column Name Long Name Type Unit Symbol
--------------------------------------------------------------------------
A1 ASuser REAL AREINF [cm²]
A3 ASmax REAL AREINF [cm²]
A4 Aswuser REAL AREINF/L [cm²/m]
A6 Aswmax REAL AREINF/L [cm²/m]
Va Va REAL LSTRUCT**3 [m³]
BLY Len-Y REAL LSTRUCT [m]
BLZ Len-Z REAL LSTRUCT [m]
XResult My pressure REAL FORCE/L/L [kN/m²]
Outputs to the above script.
set myresult "XResult"
if { [ABRDESIGN $myresult EXIST] == 0 } {
array set retval [ABRDESIGN $myresult INS "My pressure" REAL FORCE/L/L "" "Added by my own."]
if { $retval(error) != 0 } {
ABMERROR "Error: Insertion fails on $myresult."
}
}
The result "XResult" is added if it did not exist beforehand. A message is shown if there is an error.
set myresult "XResult"
array set retval [ABRDESIGN $myresult DEL]
if { $retval(error) != 0 } { ABMERROR "Error: Deletion fails on $myresult." }
The "XResult" result is deleted. A message is shown if there is an error.
array set column [ABRDESIGN "A3" GET]
set idxA3 $column(validx)
array set row [ABRDESIGNROW $rowID GETPACKED]
# get current values
set A3 [lindex $row(values) $idxA3]
The "A3" result is prompted. Once the index has been determined and the result line $rowID is available, the value for "A3" is assigned to the variable A3 here.
|
(C) ALLPLAN GmbH |
Privacy policy |