Morning,
I'm writing a vba macro to automatically generate an ISO view in 2020X V6 I'm stuck on the DrawingGenViewProp object and how to get it from the drawing service, am i missing a reference?
The Error I'm getting is Object Does not support this property or method when setting Set oGenViewProp = oDrwGenServ.DrawingGenViewProp
thanks
Madaxe
Sub AddIsoView(CATIA, ReferencePartEditor As Editor, arr As
Variant)
'Error handling
On Error GoTo ErrorSub
Dim MyDrawing As DrawingRoot
Set MyDrawing = CATIA.ActiveEditor.ActiveObject
Dim MySheet As DrawingSheet
Set MySheet = MyDrawing.Sheets.ActiveSheet
Dim MyDrawingViews As DrawingViews
Set MyDrawingViews = MySheet.Views
Dim oGenViewFactory 'As DrawingDefineGenView
Set oGenViewFactory = MyDrawingViews.DrawingDefineGenView
Dim myListofPrdInst(0)
Set myListofPrdInst(0) =
ReferencePartEditor.ActiveObject.Parent
Dim myProjPlane(5)
myProjPlane(5) = Array(-0.707, 0.707, 0, 0, 0, 1)
' Retrieve the drawing generative service object from the CATIA
service
Dim oDrwGenServ As DrawingService
Set oDrwGenServ = CATIA.GetSessionService("CATDrawingService")
' Retrieve a Generative View Properties
Dim oGenViewProp 'As DrawingGenViewProperties
Set oGenViewProp =
oDrwGenServ.DrawingGenViewProp
Dim o3DPLMToDraw As VPMRootOccurrence
Set o3DPLMToDraw = ReferencePartEditor.ActiveObject
Dim MyNewIsoView As DrawingView
Set MyNewIsoView = oGenViewFactory.DefineIsometricView(10, 10,
myListofPrdInst, myProjPlane, "", True, oGenViewProp)
'Error handling
GoTo EndSub
ErrorSub:
MsgBox Err.Description
EndSub:
End Sub
Marc A Jeeves[Gulfstream Aerospace Corporation] @ Jul 11, 2022 - 09:42 AM (America/Central)