我想答案有点晚了,但我会尝试按照Nastza的建议遍历所有实数常量,选择所有具有该实数的元素,如果数字是>0,则将其列在数组中可能快,也可能不快。必须接受测试。
*GET,mymaxvariable,RCON,0,NUM,MAX ! The maximum real constant set number defined
*DO,i,1,mymaxvariable,1
ESEL,NONE
ESEL,S,REAL,,i ! Select elements with current real number
ecount = 0
*GET,ecount,ELEM, 0, COUNT
*IF,ecount,GT,0,then
! Process here, at this point, variable i is one of the real constant present (and activively used) in model
/COM,real: %i%, elm. count: %ecount%
*ENDIF
*ENDDO
在2000个恒定集的(相当小)模型上花费了大约2秒。如果需要将结果写入文本文件,我建议先写入数组,然后一次全部写入文件,否则速度会迅速降低:)