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 "Base View" to a drawing using VBA

2 REPLIES 2
Reply
Message 1 of 3
isocam
809 Views, 2 Replies

Add "Base View" to a drawing using VBA

Can anybody help???

 

I have the following code....

 

Public Sub CreateBaseView()
   Dim oDrawDoc As DrawingDocument
 
   Set oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, ThisApplication.GetTemplateFile(kDrawingDocumentObject))

   Dim oModelDoc As Document
 
   Set oModelDoc = ThisApplication.Documents.Open("C:\Test.ipt", False)

   Dim oMap As NameValueMap
 
   Set oMap = ThisApplication.TransientObjects.CreateNameValueMap
 
   Call oMap.Add("WeldmentFeatureGroup", kMachiningFeatureGroup)

   Set oDrawView = oDrawDoc.ActiveSheet.DrawingViews.AddBaseView(oModelDoc, ThisApplication.TransientGeometry.CreatePoint2d(10, 10), 0.5, kBottomViewOrientation, kHiddenLineRemovedDrawingViewStyle, , , oMap)

   oModelDoc.Close
End Sub

 

I am trying to automatically add a "base view" to a drawing, using inventors VBA.

 

The line coloured "RED" does not work, can anybody tell me what is wrong???

 

Many thanks in advance!!!!

 

IsoCAM

 

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

Please look at the following method if it could help you:

DrawingView.GetWeldmentState(WeldmentState As WeldmentStateEnum, Component As Object)

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
Mario-Villada
in reply to: isocam

I think you need to define the variable oDrawView before the red line like this:

dim oDrawView as DrawingView

 

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

Post to forums  

Autodesk Design & Make Report