Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open assembly in 2D drawing with iLogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
rene_hersbach
386 Views, 2 Replies

Open assembly in 2D drawing with iLogic

Dear, So i copied a code from another subject, facing the same problem. But the code is not working for me. Please note that I'm just a beginner when it comes to programming with Inventor. When i remove the 'imports' it gives this error: Error in rule: Rule2, in document: test ring v2.0.iam The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) I've been desperately trying to find a way for this, but it's just not working for me. kind regards, rene
2 REPLIES 2
Message 2 of 3

Somehow attachements don't work for me. Hereby i post the full code: Sub Main Imports Inventor.ViewOrientationTypeEnum Imports Inventor.DrawingViewStyleEnum Dim oDrawingDoc as DrawingDocument Dim oPartDoc as Document Dim oSheet As sheet Dim oTG As TransientGeometry Dim oView1 as DrawingView Dim oView2 as DrawingView Dim oView3 as DrawingView Dim oView4 as DrawingView ViewScale = 3/16 'Ask to create drawing? dwgQuery=MsgBox("Would you like to Create a drawing for this MODEL?", vbYesNo,"Drawing Selection") If dwgQuery = vbYes Then oPartDoc = ThisDoc.Document 'Define IDW Template File Location oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "F:\Stage\Inventor\sheet metal3\Drawing1.idw", True) ' oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "", True) oSheet = oDrawingDoc.Sheets.Item(1) 'Define 2d view bottom left corner points for four views oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(1, 1) oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(1, 6) oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(5, 1) oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, 3/16,kFrontViewOrientation, kHiddenLineDrawingViewStyle) oView2 = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint2, kHiddenLineDrawingViewStyle, 3/16) oView3 = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint3, kHiddenLineDrawingViewStyle, 3/16) End If End Sub
Message 3 of 3

Don't need to bother anymore, for all I was searching for with the sheet metal/multi body part to 2d drawings as come to an end.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report