Get change event of attributes

Get change event of attributes

jan.wagnerRB67Z
Contributor Contributor
322 Views
3 Replies
Message 1 of 4

Get change event of attributes

jan.wagnerRB67Z
Contributor
Contributor

Hello everyone,

I am currently working on an Inventor add-in which uses AttributeSets and attributes to store information for drawing automation.

Is it possible to detect a change to attributeSets or attributes using the inventor api.

With the help of @JelteDeJong I found the DocumentEvents.OnChange Event which has the ReasonsForChange as CommandTypesEnum. Does one of these Enums detect changes on Attributes?

I appreciate you help. Thank you!

0 Likes
Accepted solutions (3)
323 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @jan.wagnerRB67Z.  Yes, that same general event (document change) can be monitored for when attributes get changed within that document.  The ReasonsForChange is usually just " kNonShapeEditCmdType", then the DisplayName = "Edit Attributes", and InternalName = "Attribute Change".  But keep in find that several things may cause that more specific event to be triggered.  Like adding or editing an internal iLogic rule, internal iLogic form, and stuff like that.  It can also be difficult to determine exactly which Object, AttributeSet, or Attribute was being changed/edited while just monitoring that event.  You may be able to monitor multiple events at the same time and cross reference data between them to get more information.  When internal iLogic rules or internal iLogic forms are created/edited, that effects document level attributes, but not all attributes are at the document level.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

jan.wagnerRB67Z
Contributor
Contributor
Accepted solution

Hey @WCrihfield 

thank you for your detailed response. I just want to have a trigger to update a GUI which shows information about the Dimensions. I want to limit the anmount of refreshes to just the attributes, or if possible to only attributesets with my Prefix as name.

I will do some testing on my side using the helpful information you provided and maybe share my results for the next person with a similar usecase.

0 Likes
Message 4 of 4

JelteDeJong
Mentor
Mentor
Accepted solution

I just realized why you need to detect changes in the attributes. Your tool is the only tool that creates and updates those attributes. So you know when they change and you can react to it.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com