Part Geometry Change event trigger not available as default

Part Geometry Change event trigger not available as default

Rory_M
Advocate Advocate
1,350 Views
10 Replies
Message 1 of 11

Part Geometry Change event trigger not available as default

Rory_M
Advocate
Advocate

After all these years of using Inventor I'm finally getting round to using iLogic to make life easier. So far so good.

 

I've got a fairly simple routine that runs and I want it to be refreshed every time a part has any change that would affect its mass, this includes material change, parameter change and also more importantly, geometry change (e.g. add a chamfer or drill a hole).

 

In the Event Triggers dialog, there are default tabs for parts/assemblies etc. and also a tab for "This Document".

 

The "This Document" tab has an event called "Part Geometry Change" which does exactly what I want. Unfortunately, isn't available in the "Parts" tab. Is there a reason for this?

 

I could add the rule to the Part Geometry Change event in my ipt template so that all future parts I create run the rule, but I'd like to add it as a default so that it runs even on old parts when they're opened.

 

Am I missing something obvious? It seems strange that "This Document" (when in a part file) would have different options to "Parts".

Any ideas appreciated.

0 Likes
1,351 Views
10 Replies
Replies (10)
Message 2 of 11

Sergio.D.Suárez
Mentor
Mentor

Hello, do you have the rule embedded in a part, assembly or drawing file?
The event exists in the part document because it has geometry, the assembly has no geometry, contains components and these have geometry.
The drawing does not have geometry either, that's why this event does not appear.
If you have a part file you must place this document and add the event there.


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 11

Rory_M
Advocate
Advocate

The rule is external, but I want it to run in all part files.

I know that parts, assemblies and drawings have different options, I'm looking to run this in part files only via the "Parts" tab in the Event Triggers dialog box.

 

The problem is that the specific trigger that I want to use is missing from the "Parts" tab, and only appears in the "This Document" tab. This means that I can't set it as a rule for all parts.

 

See attached image, hopefully it will clarify.

ilogic.png

0 Likes
Message 4 of 11

chandra.shekar.g
Autodesk Support
Autodesk Support

@Rory_M,

 

In external rule, follow below iLogic code syntax.

 

Sub Main()
	If ThisApplication.ActiveDocument.DocumentTYpe = DocumentTypeEnum.kPartDocumentObject Then
		'Your iLogic code to execute only in part document
	Else
		Exit Sub 
	End If 
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 11

Rory_M
Advocate
Advocate

Hi Chandra, thanks for the reply, it's much appreciated - Unfortunately I think you've misunderstood my question.

 

Your code snippet ensures that an iLogic rule runs in part files only. I know how to do this, I've already got this functionality in my external rule.

 

My question is regarding an event trigger that is available under the "This Document" tab when a part is opened, but is missing from the "Parts" tab.

 

Why is there a difference in the triggers available between the "This Document" tab (when a part is opened) and the "Parts" tab? I'd expect them to be identical.

 

What I want to do is to run my external rule when the "Part Geometry Change" event is triggered.

I want this event trigger to exist in every part file I open or create.

 

I can add the event trigger to the "This Document" tab in my template. This fixes the problem with new files but doesn't help with old files that I open.

 

Any ideas?

 

 

0 Likes
Message 6 of 11

MjDeck
Autodesk
Autodesk

We could provide this event for all parts in a future release. Could you enter this as an idea on Inventor Ideas?

This iLogic event is a wrapper around the PartEvents object in the API. That object is attached to a PartComponentDefinition object, which is accessible from a PartDocument object. So internally, we have to add code to attach an event handler to every part document object in the session.


Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 11

Rory_M
Advocate
Advocate

Thanks @MjDeck for the reply, hopefully we'll see improvements in the future.

 

In the meantime I've added it to Ideastation as requested, feel free to upvote:

https://forums.autodesk.com/t5/inventor-ideas/ilogic-event-triggers-make-them-consistent/idi-p/86996...

 

Message 8 of 11

JanekPop
Enthusiast
Enthusiast

Hi Rory_M,

Did you ever get a solution to this problem?  I am going through the exact same thing.

 

Regards, Janek

Message 9 of 11

A.Acheson
Mentor
Mentor

This has not changed as far as I am aware. A work around would be to either place the rule as an internal rule and perhaps in the template or  use an internal rule to trigger an external rule. It really depends on what files you need to process. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 10 of 11

rdhillon6HET8
Contributor
Contributor

2023 and still not implemented. What a joke. Did anyone manage to find a workaround to this ? 

Message 11 of 11

WCrihfield
Mentor
Mentor

Hi @rdhillon6HET8.  Probably the most effective workaround for this issue would be to create your own custom event handler code, and include it within your own Inventor ApplicationAddIn, that way it would load with the other add-ins when Inventor loads, so it will already be working for you in the background.  The basis for the 'event' named "Part Geometry Change", listed in the Event Triggers dialog, is the PartEvents.OnSurfaceBodyChanged.  And you can read more about how to create your own event handler code in the article at the following link, but this article was written with iLogic in mind, not necessarily Visual Studio, which is what most folks use for creating add-ins.

Create & Use Event Handler(s) (Triggers) In iLogic Rule Other Than Ones In Event Triggers Dialog 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes