Convert from 3D to 2D using .Net

Convert from 3D to 2D using .Net

Anonymous
Not applicable
1,769 Views
6 Replies
Message 1 of 7

Convert from 3D to 2D using .Net

Anonymous
Not applicable

Hi Team,

 

I want to convert Autodesk Inventor 3D drawings to AutoCAD 2D drawings using C#.Net. I research a lot but unable to find the solution.

 

Please me out if any API is there to convert 3D drawing to 2D drawings.

 

Thanks a lot.

 

Krishna Singh

0 Likes
1,770 Views
6 Replies
Replies (6)
Message 2 of 7

YuhanZhang
Autodesk
Autodesk

If I understand right, you want to convert the Inventor drawing(IDW) to AutoCAD drawing(DWG), right? If yes, you can use the SaveAs to do this like below:

 

DrawingDocument.SaveAs("C:\Temp\myfilename.dwg",true)

 

 

The second argument should be true when you translate a document type from native type to other CAD types.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi Yuhan,

 

Thanks for the reply.

I really appreciate your help but my issue was not related to save inventor file into drawing file. Actually, I have to create views in 2D drawing like front view, top view bottom view etc from 3D Inventor drawing file.

Now I have done with creation of all the views like front, top, bottom etc. and also detail view and section view using c# customization code.

 

Now I am facing the problem to Get Model Space of the respective view in Inventor 2D drawing using c#.

 

Could you please help me on this like to get model space of view using c#?

 

Many Thanks,

Krishna Singh

0 Likes
Message 4 of 7

YuhanZhang
Autodesk
Autodesk

Hi Krishna,

 

You can use the DrawingView.Camera to get the view orientation info, if the Camera.ViewOrientationType returns kArbitraryViewOrientation, you can use  the Camera.Eye and Target to get the view direction in 3D model space, or if it returns kFrontViewOrientation etc. you can find the mapped view orientation in the View Cube in model space. Hope this clears.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 5 of 7

Anonymous
Not applicable

Hi Yuhan,

 

many thanks for reply.

 

Sorry from my heart as I missed guid you. I need to Get Model Sketches from the created view using .net code so that I can read the text written in 3D file and merged it into 2D file.

 

Plz help me if you have any solution for this.

 

Please see the attached screenshot.

0 Likes
Message 6 of 7

YuhanZhang
Autodesk
Autodesk

Hi Anshirk,

 

I got it, you can use the DrawingView.SetIncludeStatus to set whether to include the model sketches to drawing view or not. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 7 of 7

Anonymous
Not applicable

@Anonymous 

Hello anshirk.sharp,

 

would you be so kind and share sample code on how to create a 2D drawing of a 3D model with an arbitrary view direction? Thank you so much

0 Likes