Comonent Attributes Not being saved
-
Hi all.
I've just run into a bit of a problem with component attributes. What I'm trying to do is to be able to create a component, then assign some attributes to it via a simple editor I created and then save the component to a specific subfolder of the Sketchup/Components folder for use in later models.
When I assign the attributes as follows:
e.definition.set_attribute('dict', 'test', 'test')
they are available within the component in the initial model, but when I load up the component into a new model from the component browser, the attributes are no longer available. If I save the attributes to the Sketchup.Active_Model as such:
Sketchup.active_model.set_attribute('dict', 'test', 'test')
then they are available when I load up the component from the component browser.
I want to be able to assign attributes to specific components and then save them to the component browser, so saving to the Active_Model isn't really suitable. I might be missing something here, but I've been trying to figure this out for a while now.
Any help would be most welcome,
Malcolm Murray -
After assigning the attributes to the definition, did you save out the definition (rather, an instance of it) to an external model?
Advertisement