Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic FORM in an assembly opens when I open the drawing of that assembly?

10 REPLIES 10
Reply
Message 1 of 11
stracy99
3518 Views, 10 Replies

ilogic FORM in an assembly opens when I open the drawing of that assembly?

I have a form in an assembly which I turn on using a rule with, iLogicForm.Show ("form name") and a trigger to open when file is opened. Works fine.

 

The problem is when I open the the .idw of the .iam the form comes up. Is there a way to stop the form from opening?

Thanks for the help,

Steve

 

 

 

 

10 REPLIES 10
Message 2 of 11
dsowle
in reply to: stracy99

I'm having the same problem.  Did you ever find a solution?

 

For now, in the drawing (.idw or .dwg), in the Event Trigger dialog box, I unchecked the "Run these rules when events occur" check box.   That keeps the form from showing, but then triggers in the drawing don’t work.

Message 3 of 11
mrattray
in reply to: stracy99

I haven't found a way around this.
My solution is to not use the on open trigger. Instead I use the iTrigger to "manually" load the form. I added the iTrigger command to the marking menu to make it more easily accessible.
Mike (not Matt) Rattray

Message 4 of 11
jtylerbc
in reply to: mrattray


@mrattray wrote:
I haven't found a way around this.
My solution is to not use the on open trigger. Instead I use the iTrigger to "manually" load the form. I added the iTrigger command to the marking menu to make it more easily accessible.

 

I also avoid using the On Open trigger for this reason.  I don't think there is a way to stop this currently, because TECHNICALLY, the program is opening the file (even though it's only opening it in the background).  It makes more sense to me that the trigger would only apply when the assembly was explictly opened, but that isn't the way it works currently.

 

Might be a good suggestion to post on the Idea Station.  Maybe there are reasons to use it this way, but I can't imagine any cases where the current behavior is actually what I would want.

Message 5 of 11
johnsonshiue
in reply to: jtylerbc

John's understanding is consistent with my understanding. Indeed, when Inventor opens a drawing file referencing an assembly file, the assembly file is indeed opened in order to keep associativity. So, indeed it is opened.

Thanks!

 

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 6 of 11
martijngts
in reply to: stracy99

Hi there,

 

You could use the following code to check if the rule is started by the assembly or the drawing

 

If ThisApplication.ActiveDocumentType = kDrawingDocumentObject Then 

 

Then within the if-statement you can decide what to do like stop the code or display a messagebox

 

Hope this helps,

 

Martijn van Wijngaarden

Message 7 of 11
mrattray
in reply to: martijngts

That won't stop a trigger from firing.
Mike (not Matt) Rattray

Message 8 of 11
mcgyvr
in reply to: mrattray

Not sure why Autodesk didn't think of a way to prevent that..

Something like an internal flag of "background opened" or just plain "opened"



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 9 of 11
Nsteel
in reply to: stracy99

I had a simmilar problem where I had a rule in my part set to fire whenever there was a change in the part, but this caused issues when changing part in the assembly and I ended up with countless forms popping up.

The way I found around this was to put in an if statement asking tihs document was teh active document.

This way the rules in my parts and subassemblies only fire when I am actuall in them as opposed to changing thing from the assembly above:

------------------------------

Dim myDoc As Document
doc = ThisDoc.Document

myDoc = ThisApplication.ActiveDocument

 

'this checks if the file with the firing rule is the document you are currently in and using
If doc Is mydoc Then

' your code here

Else
End If

 

 

------------------------------------

I Hope this is of some help.

 

 

Message 10 of 11

It is possible to stop a part's form from popping up when you open an assembly in which the part exists.

 

In the part, use the following code (you can safely map it to trigger on an After Document Open event).

If ThisApplication.ActiveDocument Is ThisDoc.Document Then
	iLogicForm.Show("My Form")
End If

 

It checks to see if the document that is activated (i.e. the assembly) is the same as that running the code. It triggers when you open the part, but not when you open an assembly into which it is placed.

 

Enjoy!

Message 11 of 11

I used that code as you suggested and works exactly as you mentioned. I added it to the part file and now when I open my assembly the part's form doesn't open. In addition when I open the part, the form appears on a trigger. 

 

However, if I open the part from the assembly, the parts form doesn't automatically appear. I have a form in my assembly that has a button to open a specified part. Upon hitting that button I want the form to appear when the part opens. Not sure what is preventing this from happening as when I open the part from the file explorer for example it works (the form appears off the trigger), but not when I open it from the assembly. Any idea what might be the under lying issue. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report