×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Why Do Drawings Have 3D Data?

Why Do Drawings Have 3D Data?

Why Do Drawings Have 3D Data?

(OP)
I am attempting to extract drawing data from a SolidWorks file through the API and have found that Solidworks drawings are stored as 3D objects that can be rotated, etc.  Why is this?  Does anyone know how I can just get the 2D drawing information?

Thanks for any help you can give!

RE: Why Do Drawings Have 3D Data?

It's because SW uses the Parasolid Kernal. It's a good thing IMO that they do it with 3D data. A Drawing is just looking at the 3D part in a 2d enviroment. FYI - It's not AutoCAD and thank god for that.

If all you want is 2D then export it out as a DWG.DXF.

Regards,

Scott Baugh, CSWP
3DVision Technologies

www.3dvisiontech.com
www.scottjbaugh.com
FAQ731-376
FAQ559-716 - SW Fora Users

RE: Why Do Drawings Have 3D Data?

Is this a knock knock joke!

Best Regards,

Heckler
Sr. Mechanical Engineer
SW2005 SP 2.0 & Pro/E 2001
Dell Precision 370
P4 3.6 GHz, 1GB RAM
XP Pro SP2.0
NIVIDA Quadro FX 1400


Do you trust your intuition or go with the flow?

RE: Why Do Drawings Have 3D Data?

What kind of 2D info do you need?

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP1.1 / PDMWorks 05
ctopher's home site

RE: Why Do Drawings Have 3D Data?

(OP)
If you export as DXF/DWG, you only get wireframe.  What you see in the shade display mode is not what shows.  This is the data I'm trying to extract.  Thanks for any help!  I appreciate all those who have responded.

RE: Why Do Drawings Have 3D Data?

moleary,

Exactly what are you trying to extract?  I guess I am confused as to what you are trying to do.  Could you please give some more details?

Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...

RE: Why Do Drawings Have 3D Data?

(OP)
1) Open <your path to SW>\samples\design portfolio\two_bolt_flange.sldprt

2) Click the "Make Drawing from Part/Assembly" icon right next to the Save icon.

3) Press OK to accept the defaults.

4) Left click in the drawing to place the part

5)Double-click on the part to enable the 5 drawing display mode icons that are in the same toolbar as the save icon and the "Make Drawing from Part/Assembly" icon just used.  The display modes are: Wireframe, Hidden Lines Visible, Hidden Lines Removed, Shaded With Edges, and Shaded.

My problem is that I can get the data in only the Wireframe, Hidden Lines Visible, and Hidden Lines Removed display modes.  The data in the shaded display modes cannot be extracted.  Also when exporting DXF/DWG, you can only get the data in wireframe mode.  Any texture or material data does not come across.  I want to be able to extract the picture that I see in the drawing when in the shade display mode but cannot.

Hope this helps clarify.  Again, thanks for the help everyone!

RE: Why Do Drawings Have 3D Data?

Why not save as .JPG from the model in your API?
Why go thru the dwg steps if you only want a 2D pic extracted? If you are looking to save as DXF, there is not a need for a "solid" view, drawing DXF will only do edges, corners, points, etc.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP1.1 / PDMWorks 05
ctopher's home site

RE: Why Do Drawings Have 3D Data?

(OP)
I don't want DXF/DWG.  Someone else mentioned that if all I wanted was 2D data then I should export as one of these formats.  I want to be able to capture what is seen in the drawing when it is shaded and transfer that data somewhere else.  Saving the model as a JPG will give me one image of the model in one view, but a drawing can have multiple views of the model.

RE: Why Do Drawings Have 3D Data?

Save the drawing as .jpg or .tif .....

RE: Why Do Drawings Have 3D Data?

Save as PDF as Scott suggested, or rotate the model to the views you want and save as JPG as you go. No need for a dwg.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP1.1 / PDMWorks 05
ctopher's home site

RE: Why Do Drawings Have 3D Data?

(OP)
I attempted to rotate the model and take jpg images as I go, but when I do, I get images of the opened drawing instead of the referenced part.  Both bstrModelName and bstrPathName return paths to the part and not the drawing, so I'm not sure what is going wrong here.  Any help would be appreciated!  Here is an excerpt of the code:

void ProcessViewFromDrawingDoc(IView *pCurrentView)
{    
    if (pCurrentView == NULL)
        return;

    HRESULT hr = S_OK;
    try
    {    
        BSTR bstrModelName;
        BSTR bstrPathName;
        IModelDoc2 * pViewModelDoc2;
        VARIANT_BOOL bOK = true;
        hr = pCurrentView->GetReferencedModelName(&bstrModelName);
        hr = pCurrentView->get_ReferencedDocument(&pViewModelDoc2);
        pViewModelDoc2->GetPathName(&bstrPathName);
        CString path = "C:\\cxr.jpg";
        BSTR bstrPath = path.AllocSysString();
        long lVersion;
        long lOptions;
        long lErrors;
        long lWarnings;
        bool bRetval;
        hr = pViewModelDoc2->SaveAs4(bstrPath, swSaveAsCurrentVersion, swSaveAsOptions_Silent,
                                    &lErrors, &lWarnings, &bOK);
    }
}

RE: Why Do Drawings Have 3D Data?

"moleary (Computer) 22 Apr 05 10:12  
I attempted to rotate the model and take jpg images as I go, but when I do, I get images of the opened drawing instead of the referenced part."

I have an answer for you.
After you rotate the model to the point that you want to make a jpg, press and hold the "alt" button and push the "Print Scrn" button (located next to F12). Then go to Start - all programs - accessories - paint.
Once paint has opened go to edit and click paste.
Then save this image.
Do that for each image you want.  

RE: Why Do Drawings Have 3D Data?

(OP)
Thanks for the suggestions, but I'm trying to do this through the API.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources