Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Newbie needs Help!

Buddy Brooks

New member
Hello,


I have just started programming with Solidworks and VBA. I have recently been working with Autocad, Lisp, and VBA. I have written some fairly complex Parametric part and assembly generation scripts. Our company is migrating to Solidworks and i need to know how to do the same with the solidworks API. I would like to reuse some of my old code. Is there anyway to use inches instead of meters forAPI calls? I will have to make massive changes to my code to use any of it. The conversion from screen dimensions to meters really threw me at first until I realized what it was. I recorded a macro and had no idea what was going on. I cannot find any good guides as to what the variables represent whensketching primitive shapes. The help fileis practically useless. I am using 2005 sp4. Maybe I'm missing some files.


A=X, B=Y C=Rad ? etc...? Part.CreateCircle A, B, C, D,E, F

What do these mean?
Part.ClearSelection2 True
Part.SketchRectangle A, B, C, D, E, F, G1
Part.SketchPolygon A, B, C, D, E, F
Part.CreateLine2 A, B,C , D, E, F
Part.CreateArcVB A, B, C, D, E, F, G, H, I, J
smiley19.gif



Why does it have to be so difficult?
 
Hello Brooks,


First thing isyou have tounderstand that the way you do it in Autocad is different, Here you have to play with different documents, part, drawing, Assembly. So for to write a code in part level,


we go like this,


Part.CreateLine2 A,B,....


Here we intend to draw a line in part level, so you specify part, then you say Creatline2 to create a line.


line2 i think is the Revised method/procedure to line1.


and you specify the start & end co-ordinate points for the same.


i hopeits clear to you as to why it should be the way it is.


ok,Bye.
 

Sponsor

Articles From 3DCAD World

Back
Top