Many of you are familiar with the Attribute Helper add-in. I wrote that many years ago to help with some programs I was writing that used attributes. Autodesk is now including it as one of the programs delivered with the Developer Tools installer in the SDK that’s installed when you install Inventor. I’ve been working on some programs recently that heavily use attributes and encountered a couple of bugs and wished for a couple of features. I went ahead and upgraded the program and to differentiate it from the other one still being delivered have changed the name to “Nifty Attributes”.
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 Nifty Attributes command is added to the Tools tab, in the Part, Assembly, Drawing, Presentation, and iFeatures ribbons, as shown below.
Running the Nifty Attributes command displays the dialog below.
The dialog lists all 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 Nifty Attributes utility to add an attribute set to any entity that supports attributes. Do this while the Nifty Attributes dialog is displayed, select and then right-click the entity you want to add the attribute set to get the context menu shown in the picture on the left below. You can do this in the graphics window or the browser. In the example below, a face was selected and then right-clicked to display the context menu and access the Add Attribute Set command. Running the Add Attribute Set command will display the dialog shown on the right below where you can specify the name of the set.
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 context menu on the attribute set node, as shown below.
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.
For string types of attributes, the add-in will look to see if the value is an XML or JSON formatted string and if it is an additional “Format Text” button is displayed, as shown below. Clicking this will reformat the XML or JSON string to be easier to read. If you click OK, it will be saved this way or you can click “Undo Format” to revert to the original unformatted string or click Cancel to dismiss the dialog without saving any changes.
The buttons along the bottom of the Nifty Attributes dialog will expand or collapse all of the nodes in the tree. The help button will display a PDF file with the same content as this page. The last icon will open a web browser to a PayPal donation page. Nifty Attributes is a completely free program to use. However, if you find it useful and it saves you a lot of time and headache I would appreciate a little donation to partially cover the work that goes into it.
The program is compatible with Inventor 2017 and later.