Skip to main content

Posts

Showing posts from October, 2007

Solidworks API Programming: Centerline Macro

Solidworks API Programming Part 2: Sketching the cross center line on random rectangular surface Precisely speaking, this program is for the random surface which has even number of edges. Nevertheless, this program is used to draw centerline within sketch on the surface. No matter how it forms angle with front, top or right plane, program should sketch the centerline correctly. So it's not simple. To do so, I need to consider transformation between 3D space and 2D sketch coordinates. Of course This kind of transformation function is supported by Solidworks API. Way to go! 1. Make new macro Just click Tools - Macro - New 2. Source code analysis In VBA, Comment symbol is ' (single quotation) and Continuation symbol is _ (underscore). '-------------------------------------- ' ' Preconditions: ' (1) Part or assembly is open. ' (2) Face is selected. ' ' Postconditions: Plane or face on which ' selected sket...

Solidworks API Programming: Macro Recording and Editing

Solidworks API Programming, Part 1:  Automatically generated VBA source code analysis Let's start Solidworks API Programming with macro source code analysis. I just explain what I have done in person. Although I have not read the book, "Automating SOLIDWORKS 2006 using MACROS ( http://www.amazon.com/Automating-SOLIDWORKS-2006-using-MACROS/dp/1585032638 )", I think it could be a good reference for serious users. If you know better or best book for Solidworks API Programming, please leave the comment. 1. Macro Recording: Tools - Macro - Record This is the common function of MS-based programs which support VBA just like Excel. This function record the user action itself converting it into VBA source code. 1) Just click Tools - Macro - Record 2) Do what you want to do within solidworks like sketching and extruding 3) After finishing your work, just click Stop 4) Save window pops up. Write the filename and save it. 2. Macro Editing: Tools - Macro - Edit... L...