Message 1 of 3

Not applicable
09-09-2020
01:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I tried to use an AddIn to show me all Joints and added to the Inputs a ButtonRowCommandInput with a Show/Hide button. Then I used the OnInputChangedHandler to toggle the visibility of the Joints and the Joints-folder to true or false, depending on wich button I pressed.
I put the code to set the isLightBulbOn and isVisible in a function, which gets called and executed as desired.
def set_visibility(boolVal):
'''
sets the Visibility of all Joints to the committed boolValue
'''
#
#print(boolVal) #testing for debug
#
app = adsk.core.Application.get()
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
des_Join = root.joints
root.isJointsFolderLightBulbOn = boolVal
###
allJoints = root.allJoints
for joint in allJoints:
joint.isLightBulbOn = boolVal
joint.isVisible = boolVal
The result is that the lightbulb-icons of all Joints and the Joints-folder as programmed switch on or off, but switch back again, so effectively nothing changed.
Can anybody tell me where my fault is?
Solved! Go to Solution.