- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello I am trying to create a table to which the user will be able to write information to the components whether they are purchased or not. If they are the user fills in the supplier. The TablecommandInput works beautifully I am stuck on getting the information entered into the components. I use attributes that I assign using component.attributes.
This is how I create attributes:
design=adsk.fusion.Design.cast(app.activeProduct)
root=design.rootComponent
set_occ=root.allOccurrences.itemByName(comp_nm)
m_prop=set_occ.attributes.add('iProp'.format(comp_nm),'iVlastnost'.format(comp_nm),'-')
m_prop.value='+' #Change in value
This is how I try read attributes:
design=adsk.fusion.Design.cast(app.activeProduct)
root=design.rootComponent
set_occu=root.allOccurrences.itemByName(set_cpnm)
set_occu.attributes.itemByName('iProp'.format(set_cpnm),'iVlastnost'.format(set_cpnm)).value=#The user input from table
#comp_nm and set_cpnm are string (component name)
I know the attribute is created because I am able to change its value. However, if I try to write the information that the user has filled in I am unable to fill it into a created attribute. Because there are none there. The error im getting is ('NoneType' object has no attribute 'value) because I am not able to find the attribute group or the attribute that was created
Could someone please advise me how to properly create attributes so that they can be read later at any time? Or some other possible way?
Solved! Go to Solution.