Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Do Drawings Have 3D Data?

Status
Not open for further replies.

moleary

Computer
Mar 23, 2005
38
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!
 
Replies continue below

Recommended for you

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 [pc2]
3DVision Technologies

faq731-376
faq559-716 - SW Fora Users
 
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?
 
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.
 
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...
 
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!
 
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
 
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.
 
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
 
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);
}
}
 
Close the drawing and open the part. Create images from the part file. I'm not 100% sure what exactly you are trying to accomplish.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP2.0 / PDMWorks 05
ctopher's home site
FAQ371-376
FAQ559-1100
FAQ559-1091
FAQ559-716
 
"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.
 
or paste all images into MS Word and save as one doc.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP2.0 / PDMWorks 05
ctopher's home site
FAQ371-376
FAQ559-1100
FAQ559-1091
FAQ559-716
 
Thanks for the suggestions, but I'm trying to do this through the API.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor