How do I change/reset occurence properties like 'selectable' or 'light bulb' after copying a component?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to make another occurence of the same component. When the occurence has parameters 'isSelectable' or 'isLightBulbOn' set to false in the browser by a user, and I copy this component using 'addExistingCoponent' method, the new occurence has them set identical. I want them to be set to true for the new occurence, like default values, so I set these parameters to true.
The thing is that when I make a copy as a subcomponent of a component other than the root component, then these parameters don't change.
I think it might be a bug in the API, or maybe I do something wrong. Please help.
newOcc = design.activeComponent.occurrences.addExistingComponent(component, adsk.core.Matrix3D.create())
newOcc.isLightBulbOn = True
newOcc.isSelectable = True
As you can see, I created 'anotherComponent' under 'rootComponent' and set it as unselectable (isSelectable = False) and not visible (isLightBulbOn = False). Then I copied it into 'component' setting parameters 'isSelectable' and 'isLightBulbOn' to true - it doesn't change. Then I copied it again to the 'rootComponent' doing the same thing - it works.