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
Please look at the following method if it could help you:
DrawingView.GetWeldmentState(WeldmentState As WeldmentStateEnum, Component As Object)
I think you need to define the variable oDrawView before the red line like this:
dim oDrawView as DrawingView