Working with attributes can sometimes be a bit frustrating because the only access you have to attributes is through the API. You can’t quickly create, edit, or view an attribute without writing a program to do it. Because of this I became a bit frustrated when working on my first program that made extensive use of attributes. For the program to function correctly the attributes it was using all had to be correct and it was difficult to debug problems to determine if the problem was my program or the attributes it was trying to access.
For my own sanity I wrote a little utility that would let me view all of the attributes in a document. That helped a lot but I never felt it was finished because it only allowed me to view existing attributes and I still couldn’t easily create or edit an existing attribute without writing code.
The app is an add-in and to use it just download and install it using the button below. If Inventor is running, you’ll need to restart it to allow Inventor to refresh it’s available add-in list. When installed, the Attribute Helper command is added to the Tools tab, in the Part, Assembly, Drawing, Presentation, and iFeatures ribbons, as shown below.
Running the Attribute Helper command displays the dialog below.
The dialog lists all of the entities that have any attributes associated with them. In the example above there aren’t any attributes in the part so the dialog is empty. You can use the Attribute Helper utility to add an attribute set by selecting and right-clicking any entity that supports attributes, while the Attribute Helper dialog is displayed. In the example below a face was right-clicked to display the context menu where the Add Attribute Set command is located. Clicking this command will display a dialog where you can specify the name of the set, as shown below.
Once the attribute set is added, the dialog is updated to show the entity and associated attribute set, as shown below. Clicking on the entity (“Face” in this case) will highlight the associated entity in the graphics window.
You can edit the name of an attribute set, delete it, or add attributes to it using the utility. If you right-click on the attribute set node in the dialog these are available as options in its context menu.
If you create an attribute, the dialog shown below is displayed where you can specify the name, select the type, and input the value. The value of a Byte Array type of attribute is set using the syntax shown below; comma delimited numbers where the values can be any number from 0 to 255.
You can double-click or right-click on an attribute node in the dialog to edit its name or value, or to delete the attribute or attribute set and all of its associated attributes.