LucasC
Automotive
- Feb 18, 2019
- 157
Need a hand sorting out a do until loop. Any suggestions for a better method welcome.
My goal is to search all the views on the active sheet until I find the FrontView TYPE(not the name of the view as these can change). I'm choosing to target the front view type due to the sheet scale using its value in most cases. It's ultimately up to the designer to verify this information is correct.
My thought was to loop through all the views until CatDrawingViewType catViewFront was found, add that to the selection and pull the scale value. When I set the selection, the scale property is not available in the intellisense.
My goal is to search all the views on the active sheet until I find the FrontView TYPE(not the name of the view as these can change). I'm choosing to target the front view type due to the sheet scale using its value in most cases. It's ultimately up to the designer to verify this information is correct.
My thought was to loop through all the views until CatDrawingViewType catViewFront was found, add that to the selection and pull the scale value. When I set the selection, the scale property is not available in the intellisense.
Code:
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
'Look for Front View Scale Value
Dim ViewCount As Integer
Set ViewCount = drawingDocument1.sheets.ActiveSheet.views.Count
Dim FrontView As String
Set FrontView = drawingDocument1.sheets.ActiveSheet.views
Loop Until FrontView = CatDrawingViewType("catViewFront")
Dim ViewSel As selection
Set ViewSel = FrontView
Dim SheetScale
Set SheetScale = ViewSel[highlight #FCE94F].???[/highlight]