AnsweredAssumed Answered

Taking a New part and running api code

Question asked by Sven Jupp on Feb 24, 2016
Latest reply on Feb 26, 2016 by Sven Jupp

I am looking to develop an Add-in that will capture the event when a user takes a new part by pressing the 'new' button in Solidworks. So to clarify, I want the user to open Solidworks (there is no document open) then the user presses the new button (ideally I would add my own button to the toolbar but have no idea how to do that), then when they select a document I capture that event (check its type) and run my code to bring up a userform if it is a part or assembly so that the user can fill in some custom properties. So I have identified the following event that fires when the user clicks a new document (iSwApp_FileNewPreNotify) from the solidworks dialogue box that appears when you press the new button, I then want to intercept that new document and do some operations.

My preference would be to put my own 'New' button on that top level toolbar but I can work with the event I have found if I can figure out how to intercept the document it creates. I would also be up for advice on other methods to achieve the same thing.

 

Thank you in advance.

 

 

Sven

Outcomes