romaleee
Mechanical
- May 13, 2016
- 37
Hi,
can anyone help me with automating "Multiple broken views" in same direction. I would like to get this with vba::
The code seems to break when it gets to creating second BrokenView
Thanks in advance
can anyone help me with automating "Multiple broken views" in same direction. I would like to get this with vba::
The code seems to break when it gets to creating second BrokenView
Code:
Sub CATMain()
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets
Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.ActiveSheet
Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views
Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.ActiveView
Dim factory2D1 As Factory2D
Set factory2D1 = drawingView1.Factory2D
Dim drawingViewGenerativeBehavior1 As DrawingViewGenerativeBehavior
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior
drawingViewGenerativeBehavior1.UnBreak
Dim arrayOfVariantOfDouble1(7)
arrayOfVariantOfDouble1(0) = 403.5
arrayOfVariantOfDouble1(1) = 150.324075
arrayOfVariantOfDouble1(2) = 411.5
arrayOfVariantOfDouble1(3) = 150.324075
arrayOfVariantOfDouble1(4) = 403.5
arrayOfVariantOfDouble1(5) = 760.534615
arrayOfVariantOfDouble1(6) = 411.5
arrayOfVariantOfDouble1(7) = 760.534615
Set drawingViewGenerativeBehavior1Variant = drawingViewGenerativeBehavior1
drawingViewGenerativeBehavior1Variant.DefineBrokenView arrayOfVariantOfDouble1, 0#, 1#
arrayOfVariantOfDouble1(1) = 0.324075
arrayOfVariantOfDouble1(3) = 0.324075
arrayOfVariantOfDouble1(5) = 100.534615
arrayOfVariantOfDouble1(7) = 100.534615
Set drawingViewGenerativeBehavior1Variant = drawingViewGenerativeBehavior1
drawingViewGenerativeBehavior1Variant.DefineBrokenView arrayOfVariantOfDouble1, 0#, 1#
End Sub
Thanks in advance