How to create the API to generate incremental part numbering

I would like to create an addin that will generate incremental numbers for both parts and assemblies as soon as the save command is invoked. SolidworksApi macros
Answers 2
SF
SF 2009-07-16 Best Answer

Hi Nigel,

     Jeff Cope made a macro that will probably get you pretty close. It uses Access as a database to store the next part number but you could do something similar with just a a text file. You can download it here: http://extensiblecad.com/words/2008/02/09/macros-301-generate-document-numbers-from-ms-access-database-and-auto-insert-them-into-new-documents/.

If you follow his instructions exactly it will create a new part number when a new document is created. You can use the macro code and change it so that it triggers based on when the document is saved. Keep in mind that you will want to have some code that handles whether a part number has already been assigned or not.

Does that help?

SF
SF 2009-07-17
Thanks for that kevin I think thats exactly what I am looking for.