a week ago - last edited a week ago by Laszlo Nagy
Hi all
For a label linked to a segmented beam I want to chose a segment in the label settings so the label can give the settings from that segment.
Works perfect except for one part; i can't define the value range for how many segments there are in the beam.
Parameters:
I_segment (integer)
In the Master script;
I_maxSegments = 0
For i = 1 to 7 ! 7 is just a random number to prevent crashes
IF HASKEY(BEAM_SEGMENT_INFO.segments[i].crossSection.startWidth) then
I_maxSegments = I_maxSegments+1
ENDIF
next i
PRINT I_maxSegments ! this works perfect
VALUES "I_segment" RANGE[1, I_maxSegments]
Solved! Go to Solution.
Monday - last edited Tuesday by Laszlo Nagy
Hi,
BEAM_SEGMENT_INFO is not available in parameter script context, but is in UI context.
parameter script:
for i = 1 to 100 ! a reasonably large number of segments
put i
next i
values "n" get(nsp) ! range [1, ) doesn't work with ui_infield
UI script:
dim pic[], val[], choice[]
for i = 1 to vardim1(BEAM_SEGMENT_INFO.segments)
pic[i] = 0
choice[i] = str(i, 1, 0)
val[i] = i
next i
ui_infield{4} "n", 0, 0, 100, 20,
8, "", 0, 0,
0, 0, 0, 0,
pic, choice, val
The 2d script has to handle that the number of segments can decrease below the selected value.
Btw. if you need to label only one of the segments, before label placement you can switch between labeling the whole beam or the segment only by pressing tab when the mouse is on the beam but not on the axis.
Monday - last edited Tuesday by Laszlo Nagy
Hi,
BEAM_SEGMENT_INFO is not available in parameter script context, but is in UI context.
parameter script:
for i = 1 to 100 ! a reasonably large number of segments
put i
next i
values "n" get(nsp) ! range [1, ) doesn't work with ui_infield
UI script:
dim pic[], val[], choice[]
for i = 1 to vardim1(BEAM_SEGMENT_INFO.segments)
pic[i] = 0
choice[i] = str(i, 1, 0)
val[i] = i
next i
ui_infield{4} "n", 0, 0, 100, 20,
8, "", 0, 0,
0, 0, 0, 0,
pic, choice, val
The 2d script has to handle that the number of segments can decrease below the selected value.
Btw. if you need to label only one of the segments, before label placement you can switch between labeling the whole beam or the segment only by pressing tab when the mouse is on the beam but not on the axis.
Wednesday
Thanks, Péter!
This works perfect.
The reason I can't link the label to the segment is that the label provides other information, such as properties that are either unavailable or not filled in for the segment.