Excel Macro for Drawing Automation
A few years back I created this Excel macro for drawing automation and I guess simplification as my then current employer had this nightmare of a system for part naming. Now who hasn’t said something like that before about a place they work?
The first part does not use a custom property tab builder file, this is captured in the Excel file instead. I have attached help files (as best I can do!) in Word 2016 and PDF formats.
I’m sure there will be some unintentional errors so feel free to note them back to me here.
In using this ‘system’ and Excel file is a database or more simply a list with some custom features. You can enter a part number on a blank line anywhere one is available below the top two lines.
The rest of the columns are almost self-explanatory but there is more help in the included help files in both Word 2016 and PDF formats.
The bigger difference here is that instead of just being a place to enter a note or definition, if you have notes or definitions entered on the Excel tab for those entries, you can select them from the drop down list presented when your cursor is in that cell with a drop down arrow to the right. That goes for Finishes, ID or the names of your draftsmen and the like, Material specifications and Company names. I needed company names so that my client names were populated on the drawing sheets by virtue of using them. If you don’t use company names use can use that cell for something else. Please note the restrictions in the other help files attached. Obviously the Primary tab is the actual list or database.
Opening the Excel file you are presented with the working page called Primary (tab). The top left cell is where you would enter a part number you have previously entered working in the rows below. Upon hitting ENTER the related data previously entered will be brought to the top row. Save the file. Now go to Solidworks and use the macro file included on an open file or assembly. The screen may blink. You can use the custom properties button at the top of the Solidworks screen to view the data entered into the properties for that part or assembly.
Next you would “Make drawing” and select the drawing file included (or one you have modified from this one) and drag views onto the drawing sheet. Once one valid view is entered the drawing sheet will populate from the custom properties.
Now from the custom properties tab available from the far right, select that and select the .drwprp file included here. If you cannot see it here after selecting “More Properties” it most likely not in the correct folder. This custom property file renames or enters a few of the standard fields on the drawing sheet. For instance when Inches or Metric is selected, the “Dimensions are in “ is so modified. When Machine is selected no bend tolerance is displayed, and the opposite when Bends is selected. If you have a cage code it can be so selected here, if not that field will be left blank. Also available is a tolerance type selection, the one shown is the current specification for tolerancing. If you use a proprietary format please add that to the list in the custom property tab file so it is available there in the drop down.
It is hoped that allowing for the easier editing and having ‘standards’ available from a drop down list would help speed up your work flow. Next following your normal procedures you would dimension and otherwise complete the drawing. They might also prevent spelling errors.
I’m sure there will be more to add as I must has missed something here or there, it would be by accident of course. While I might have all of this in my head it may all not get down to writing.
Please try this if you would like to, I’m sure it would take a little time. I created the majority of this back in 2014 and received some help from Deepak Gupta back then.
It is likely that you might have to add a property to your standard custom properties available from your modeling file, it is shown in the attached Add – Weight Mass pictures.
This system most recently run in 2016 and for testing purposes the files included were just tested in Solidworks 2017 on a machine with no production work on it whatsoever. So I would have to say, if it doesn’t work for you there must be something you missed. Try the help files again or the forums with your error messages. Or try posting here. Surprisingly there were no missing references.
Please try to read all the help files before starting, your reading list order might be:
Help – 1
Part Numbers Help
Custom Drawing Props
A special note to Rob Edwards
We had recently joked about this being a Christmas present, I spoke to my user group leader and he didn't object to me posting it here before the December meeting. I hope I was right and that trick I mentioned is found here. Let me know.
I pasted a set of pictures included and described in the help files.
SW XC Macros.zip 2.2 MB