Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Event trigger "after document opens" is enacted before the parts load.

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
1338 Views, 5 Replies

Event trigger "after document opens" is enacted before the parts load.

Hello,

 

So I used an Event trigger "after document opens" to open a form that will enact changes to an assembly.

 

However, I noticed that the trigger happens before all parts in the assembly even load.  Since the form will make changes to the parts and they are not there, the form won't work correctly.  A form that is making changes to a parts that are not there is not too useful.

 

On my first attempt, the opening of the form would stop everything from loading so you would have to close the form in order for to work properly.  Then I realized I could use the iLogicForm.Show(" ", FormMode.NonModal) so operations can still occur in the background.  So now the user would basically have to figure out that they should wait for everything to load before they start clicking on options.  I am using large assemblies so I can imagine this happening often.  This seems dangerously prone to error.

 

I also added a pop-up message for this trigger but the pop-up message is just to inform the user.  However, the pop-up stops the file from loading so it is a waste of computational time when the designer is just reading the message.  I do not see a Non.Modal version for pop-ups so it seems that I cannot allow parts to load when a simple ok message pop ups.

 

I can not see how this Event trigger "after document opens"can be used in a responsible manner and can be practical.  Has anyone else notice this issue or have any ideas?

 

-Thank you

Tags (1)
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Hello Aj,

 

There will be many OpenDocument events triggered when you open the assembly and also for its referenced components.

Its not so easy and not recommended directly to use OpenDocument

 

I think you have to use OnActivateDocument once the OpenDocument is complete.

 

Steps which i followed to load a form after loading a Assembly:

  1. Monitor OpenDocument(After) for main assembly store the FilePath of the main assembly
  2. Ignore all other OpenDocument events occuring for referenced components
  3. Listen for OnActivateDocument and check if this event is for the main assembly, once this event is completed then load your form.

There will be Before & After events for OpenDocument and OnActivateDocument, you need to monitor only the After Events

To understand more on events there is a sample application which is shipped with Inventor called "Event Watcher".

Use that application for understanding on Inventor events.

 

Hope this helps....

http://forums.autodesk.com/t5/user/viewprofilepage/user-id/82872

Message 3 of 6
Anonymous
in reply to: Anonymous

Ok, this maybe more complicated than I was hoping but it kind of makes sense. I have a feeling I may have to give up on the idea if takes to much time but I will give it a go.

I am going to try to obtain Event Watcher to get a better feel. Follow up question: is OnactiveDocument suppose to be an event trigger that I do not have, inside the event watcher, or VB code I will need to program in an iLogic rule?
Message 4 of 6
Anonymous
in reply to: Anonymous

Event Watcher has all the events. look for OnActivateDocument.
Message 5 of 6
Anonymous
in reply to: Anonymous

Hello,

Ok, I tried the Event Watcher. It is pretty cool; I am sure I can use in debugging instances in the future. Thanks for mentioning it because I never heard of it before.

However, it seems the steps you are describing are manual steps. I am trying a way to automate it so the users without knowledge of iLogic or dev kit tools can use it. I guess I will have to learn how to use the VBA portion if I want to do this automatic. If not I will just have stick to my old way of providing instructions that explains where the iLogic browser and form option is.

Thank you
Message 6 of 6
Anonymous
in reply to: Anonymous

The steps which i mentioned are not for manual use. I suggested that you follow that steps to automate the process.

The Event Watcher will give you an idea of Inventor Events being triggered for specific Operations.
I am not sure, but i think the source code is also shipped with inventor. You can use some of the existing Methods from that.

If this helped you getting started, Accept this as Solutions or Hit the Kudos Button below.

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

Post to forums  

Autodesk Design & Make Report