Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Scripted attributes and Rollout Creator

Scripted attributes and Rollout Creator

Anonymous
Not applicable
257 Views
0 Replies
Message 1 of 1

Scripted attributes and Rollout Creator

Anonymous
Not applicable
Hi there,

I'm using rolloutCreator to generate a dynamic rollout, update it when you click on a button, etc.

Everything works fine when I use that rollout in a rolloutFloater, I juste need to set up a few variables in global scope.

Then I can just delete and add again the rollout once it's updated by the rolloutCreator.

The problem comes when I try to do the same in a Scripted Attribute, as the rollouts are defined directly in the attribute and the functions addRollout and removeRollout can only act on the local rollouts.

I'll put a little dumb example of how it works in a rolloutFloater :

global countBtn = 1
(
fn refreshRoll n =
(
r = rolloutCreator "interactiveRF" "interactiveRF"
r.begin()
for i = 1 to n do
(
r.addControl #button (("btn"+(i as string)) as name) ("Button "+(i as string))
)
r.end()
)

rollout staticRF "Static"
(
button btnAdd "Add Button!"

on btnAdd pressed do
(
countBtn += 1
removeRollout interactiveRF rf
refreshRoll countBtn
addRollout interactiveRF rf
)

)

refreshRoll countBtn

rf = newRolloutFloater "RF" 200 200
addRollout staticRF rf
addRollout interactiveRF rf
)


So this works fine but I don't manage to get the same thing in a scripted attribute...

Anyone has an idea ?
0 Likes
258 Views
0 Replies
Replies (0)