Automatic drawing API.

Discussion in 'SolidWorks' started by steve, Sep 12, 2005.

  1. steve

    steve Guest

    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
     
    steve, Sep 12, 2005
    #1
  2. steve

    CS Guest

    If you don't find anything contact me

    corey
    Scheich
    at
    this doesn't belong........
    hotmail
    dot
    com
     
    CS, Sep 13, 2005
    #2
  3. steve

    Luka Vilar Guest

    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
    .

    Hope that helps,
    Luka Vilar
     
    Luka Vilar, Sep 13, 2005
    #3
  4. steve

    steve Guest

    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
     
    steve, Sep 14, 2005
    #4
  5. Corey,
    I have not found all of what i would like just yet corey please let me know
    how you can help me.
    thanks.
     
    Steve Hanwtight, Sep 14, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.