Difference between LinkCAD and Import CAD with File Importing Event

Difference between LinkCAD and Import CAD with File Importing Event

dgoff96
Enthusiast Enthusiast
428 Views
2 Replies
Message 1 of 3

Difference between LinkCAD and Import CAD with File Importing Event

dgoff96
Enthusiast
Enthusiast

I am working on a script that runs when the "FileImporting" event is triggered. I had meant for it to only run when the "Import CAD" function is used, however I realized that this function runs when you import OR Link a file. Is there a way to know which of these is happening when the FileImporting event happens? Or is there a different event that I should use?

0 Likes
429 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

You could check what the last recent entries in the journal file say. Maybe they can help you tell the difference. Another approach might be to detect what command was launched using the DocumentChanged event:

  

https://thebuildingcoder.typepad.com/blog/2020/01/torsion-tools-command-event-and-info-in-da4r.html#...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

dgoff96
Enthusiast
Enthusiast

Thanks Jeremy,


I think you are right that the journal file will hold some answers. I tried with the Document Changed event, but the transaction names were still the same (Import Vector Data). I think that the Before Executed event is the answer, but I'm not quite sure how to implement that one. 

0 Likes