How to NOT run an "After Open Document" rule event trigger?

How to NOT run an "After Open Document" rule event trigger?

Anonymous
Not applicable
900 Views
4 Replies
Message 1 of 5

How to NOT run an "After Open Document" rule event trigger?

Anonymous
Not applicable

I have mistakenly created a monster! 

 

I have many drawing files that run a rule on the trigger "After Open Document", but I have a minor, but costly, error in this rule (local rule in each file, copied from template).

 

Is there a way to open a file, but defer any triggers or rules from running?

 

(The rule was supposed to defer updates. My mistake is that it un-defers and thus updates the model, ruining the drawing.)

0 Likes
Accepted solutions (1)
901 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor

If you use FastOpen through the API, it should leave the model disconnected from the drawing, which should give you time to change things.

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-44DDD7C9-D90E-4F49-BEE2-757EE785C826

 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 5

Anonymous
Not applicable

That seems like it would work, but I am a hopeless Copy-Jockey when it comes to iLogic

 

Dim oFileDlg As Inventor.FileDialog = Nothing
Call ThisApplication.CreateFileDialog(oFileDlg)

oFileDlg.InitialDirectory = ThisDoc.WorkspacePath()

Call oFileDlg.ShowOpen()

Documents.OpenWithOptions( oFileDlg.FileName, FastOpen, True)

I'm sure I need to Dim [something] As [whoknows] for the Documents part to work, but my mind has just melted.

 

I would be grateful if you could help me with what I need to make this work.

0 Likes
Message 4 of 5

MechMachineMan
Advisor
Advisor
Accepted solution

SyntaxEditor Code Snippet

Dim oFileDlg As Inventor.FileDialog = Nothing
Call ThisApplication.CreateFileDialog(oFileDlg)

oFileDlg.InitialDirectory = ThisDoc.WorkspacePath()

Call oFileDlg.ShowOpen()

Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Add("FastOpen", "true")

ThisApplication.Documents.OpenWithOptions(oFileDlg.FileName, oOptions, True)

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 5 of 5

Anonymous
Not applicable

Wahoo!! Thank you for saving my melting brain!!

0 Likes