iLogic part form triggering when placed or opening an assembly

iLogic part form triggering when placed or opening an assembly

Christian3.14
Advocate Advocate
1,747 Views
6 Replies
Message 1 of 7

iLogic part form triggering when placed or opening an assembly

Christian3.14
Advocate
Advocate

I created a form to trigger when I create a new part or open an existing part. However, when I place the part in an assembly, the form triggers.  In addition, when I open an assembly, the forms for every component in the assembly will trigger. In the form editor, show on place component is set to false. I have the form to trigger under new document and after open document in the part template. In the assembly template, I do not have any event triggers or forms set. Does anybody have insight on how to prevent the part forms from triggering in these situations?

0 Likes
Accepted solutions (2)
1,748 Views
6 Replies
Replies (6)
Message 2 of 7

J-Camper
Advisor
Advisor
Accepted solution

Technically when placing a component it gets "Opened", I'm assuming the same thing happens when you open an assembly with parts [the parts are "Opened" with the assembly].  If you add the first line of code to the rule that opens the form, it should fix the issue:

If ThisApplication.ActiveDocumentType <> kPartDocumentObject Then Exit Sub
iLogicForm.Show("Form 1")'replace with your form name

This is telling inventor to terminate the rule if the Active document is not a Part Document.  If it is a part document it will carry on to the next line which opens the form.

 

Let me know if you have questions, or if the issue persists after this change.

0 Likes
Message 3 of 7

WCrihfield
Mentor
Mentor
Accepted solution

To prevent it from opening when you place it in an assembly:

Within your code to launch the form, before the line to launch the form, check the following:

 

If ThisApplication.ActiveDocumentType = DocumentTypeEnum.kPartDocumentObject Then
	iLogicForm.Show("Form 1")
End If

 

That way it wouldn't show the form if the active document was an assembly.

Looks like my post was a little late.

Hey, "Great Minds Think Alike"! 😁

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 7

Christian3.14
Advocate
Advocate

Perfect. Thanks you two!

0 Likes
Message 5 of 7

DavidTunnard
Collaborator
Collaborator

@WCrihfield & @J-Camper 

 

Do you know how I could fix the same issue if the form was part of a subassembly that gets placed into a parent assembly?

 

 

0 Likes
Message 6 of 7

WCrihfield
Mentor
Mentor

You can try the one setting mentioned in the original post here, but that is not necessarily a guarantee, as you have seen.  While editing that Form, and you have the main/top node selected (for the whole form itself), then down within the Properties area, below the Behavior sub group, make sure the setting named "Show on Place Component' is set to False.

WCrihfield_0-1731067864366.png

Beyond that, I assume it is showing because you have something it in the Event Triggers dialog.  Every time you place an assembly component occurrence into an assembly, that also 'initializes' the Document associated with that File, and adds that File/Document reference to the parent assembly.  Initializing a Document is similar to opening it, but not visibly, but it only loads a portion of its data into Inventor's session memory, instead of all of its data.  So, that action will trigger the On Open event.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 7

J-Camper
Advisor
Advisor

@DavidTunnard,

You could try this:

If ThisApplication.ActiveDocument IsNot ThisDoc.Document Then Exit Sub

"ActiveDocument" would be the main assembly you are placing within.  "ThisDoc" would be the sub assembly calling for the form upon it's placement. 

0 Likes