Automatic drawing API.

Sep 12, 2005 4 Replies

Hi all, I'm thinking about making/getting an api to make drawings from a pre selected assembly. My thoughts are to open the assembly in question. Then to select the drawing template to use, then click ok Have it traverse through the assembly and make and save each drawing. Taking the advice of leonard Kikstra. "USE EXISTING CODE - DON'T REINVENT THE WHEEL." I have had a quick look around and can't find anything just yet so I thought I would ask around. So before I start I was wondering if anyone has already done it?



I have been using SW scheduler to do this, It' a bit limited as it only allows you to make them from a selected directory. This will not guaranty all drawings for the assembly have been made.



I don't need fancy code just a bit of code that looks a bit like wheel that I can knock the bumps off if need be. The fact it I will hard code most of it anyway then add the prompts and dialogs.



Thanks in advance Steve Hanwright



If you don't find anything contact me

corey Scheich at this doesn't belong........ hotmail dot com

Hi Steve,

i've got all that u need:

- inserting drawing views

- drawing views positioning / orientation

- inserting dimension (automatic)

- setting up sheet / templates

All of the above was done in MC++ (MVS .NET 2003) as Addin project, API programing involving Drawings is very tricky, 'cause SW have so many "features - bugs" from API point of view, especially when it comes to Drawings.

Anyway, here is code snipet:

// creates new Drawing using SolidWorks Drawing Template, // drawing paper size defined by user - in meters DrawingDoc* pDrawingDoc = m_swApp->NewDocument( swTemplatePath, swDwgPaperSizes_e::swDwgPapersUserDefined, width, height);

// creates drawing View, from Assebmly/Part in "Right - model view" // and place center of View at 0,0,0 View* oNarisView = pDrawingDoc->CreateDrawViewFromModelView3( sDocumentName, "*Right", 0.0, 0.0, 0.0);

// save Drawing pDrawingDoc->SaveAs4(fileName, swSaveAsVersion_e::swSaveAsCurrentVersion, swSaveAsOptions_e::swSaveAsOptions_Silent, &Errors, &Warnings);

OK, that is all for now, if u need any help please write me to snipped-for-privacy@ib-caddy.si.

H>Hi all,

Thanks for your reply, i'm just stsrting to do a bit of api stuff so i'm just using vb for now. So i'm not sure quite how to use the info you have given me but i guess the calls will give me a hint how to use them in vb. thanks Steve H

Corey, I have not found all of what i would like just yet corey please let me know how you can help me. thanks.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required