Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

add part border dont work....

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
314 Views, 2 Replies

add part border dont work....

' create a drawing
Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Dim oDrawingDoc as DrawingDocument   
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oView1 as DrawingView
ViewScale = 1/1

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, "d:\Work12\TEMPLATES\PPPI-PART BORDER NL.idw", True)
    'oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "", True)
    oSheet = oDrawingDoc.Sheets.Item(1)
    
    ' Create a new NameValueMap object
 	 Dim oBaseViewOptions As NameValueMap
  	oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap
  	oBaseViewOptions.Add("SheetMetalFoldedModel", False) 
   
	'Define 2d view bottom left corner points for four views
	oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(10, 12) ' front view
	oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, kShadedHiddenLineDrawingViewStyle, "My View")
	oSheet.PartsLists.Add(oView1, ThisApplication.TransientGeometry.CreatePoint2d(27,20.625))
End If

 

Please take a look at the code below, can someone tell me what am I doing wrong?

 

???oSheet.PartsLists.Add(oView1, ThisApplication.TransientGeometry.CreatePoint2d(27,20.625))

 

Thank you

 

 

 

 

2 REPLIES 2
Message 2 of 3
Vladimir.Ananyev
in reply to: Anonymous

In your command  oSheet.PartsLists.Add(oView1, ... )
oView1 object is undefined.  

Replace it with the reference to the existing drawing view, e.g.  oBaseView.

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
Anonymous
in reply to: Vladimir.Ananyev

thank you! spasibo!

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

Post to forums  

Autodesk Design & Make Report