Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Knowing when a parameter is deleted

dylanTEV9W
Advocate

Knowing when a parameter is deleted

dylanTEV9W
Advocate
Advocate

Hello all, 

 

I'm trying to write a bit of code that will notify me whenever a parameter is deleted. However it seems like there isn't an event that completely covers this case. Modeling events does include an on delete event but this will only allow me to know a parameter is being deleted when it is a user parameter or consumed by a part / assembly feature. This doesn't seem to apply to such things as sketch dimensions or constraints. Is there a specific event or method that I can use to notify me whenever a parameter is deleted? Or a way to inspect any object returned to see if it contains one or more parameters as members? 

0 Likes
Reply
423 Views
5 Replies
Replies (5)

clutsa
Collaborator
Collaborator

I'm not sure I understand but in a drawing it appears that each drawing view has it's own sketches and each sketch has it's own naming scheme (they each start at d0). How (or why) you would monitor this escapes me. The model tree looks like Sheet>DrawingViews>Item(a)>Sketches>Item(b)>DimensionConstraints>Item(c)>Parameter and then parameter of course has Name, Value, Units, Etc.

DimensionConstaints has a "Count" variable so you could potentially keep some array of data and loop thru and compare the counts after any "Drawing View Change" event. :barfface:

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes

dylanTEV9W
Advocate
Advocate

So to try to clarify, I want to know as soon as any parameter object is deleted regardless of what object it may be attached to. It doesn't seem like there is an explicit event for this (meaning like you suggested I would have to implement my own) however I'm holding out hope that there may be something I've missed.

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

@dylanTEV9W,

 

Unfortunately, Inventor API does not support any event to record deletion of parameter at present. Please log this wish list at idea station using below link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

dylanTEV9W
Advocate
Advocate

Okay I will log this as a wish as you suggested. I had a feeling that was the case but given the size of the api I figured I may have overlooked something. If anyone else has any workarounds for this in the meantime I would still love to hear about them. And if I come up with my own I will post it here as well.

 

Thanks, 

 

Dylan

0 Likes

dylanTEV9W
Advocate
Advocate

Here is the link to the wish. If you think this would be a good edition to the Inventor API please consider giving it your vote! https://forums.autodesk.com/t5/inventor-ideas/add-on-delete-parameter-event-to-api/idi-p/8879566

0 Likes