Automatic Drawing View Label Doesnt Work If View Is At an Angle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I currently have this code to automatically name drawing views, however this only works if the viewcube is in the exact orientation with no rotation.
'[ SETUP BLOCK Dim tmpSheet As Sheet = ThisDrawing.ActiveSheet.Sheet 'Set active sheet for local iLogic rule existing inside Drawing document Dim oView As DrawingView = tmpSheet.DrawingViews.Item(1) 'Get 1st view to determin base output Dim oRDD As DocumentDescriptor = oView.ReferencedDocumentDescriptor Dim oModelType As String '] '[ VIEW LOOP For Each tmpView As DrawingView In tmpSheet.DrawingViews Dim myDrawingViewName As String = "" 'Check name. anything NOT matching the master list or the name is NOT numbers only will get skipped If Not masterList.Contains(tmpView.Name) And Not IsNumeric(tmpView.Name) Then Continue For Dim oTrans As Transaction oTrans = ThisApplication.TransactionManager.StartTransaction(ThisDrawing.Document, "Rotate Drawing View temp") ' Set rotation to 0 If tmpView.Camera.ViewOrientationType = ViewOrientationTypeEnum.kArbitraryViewOrientation Then If tmpView.Rotation <> 0 Then tmpView.Rotation = 0 End If End If '] '[ CASE SELECTOR '[ PART VIEW LABELS Select Case tmpView.Camera.ViewOrientationType Case ViewOrientationTypeEnum.kBackViewOrientation myDrawingViewName = "O/S FACE" Case ViewOrientationTypeEnum.kBottomViewOrientation myDrawingViewName = "BOTTOM" Case ViewOrientationTypeEnum.kFrontViewOrientation myDrawingViewName = "I/S FACE" Case ViewOrientationTypeEnum.kIsoBottomLeftViewOrientation myDrawingViewName = "" Case ViewOrientationTypeEnum.kIsoBottomRightViewOrientation myDrawingViewName = "" Case ViewOrientationTypeEnum.kIsoTopLeftViewOrientation myDrawingViewName = "" Case ViewOrientationTypeEnum.kIsoTopRightViewOrientation myDrawingViewName = "" Case ViewOrientationTypeEnum.kLeftViewOrientation myDrawingViewName = "END" Case ViewOrientationTypeEnum.kRightViewOrientation myDrawingViewName = "END" Case ViewOrientationTypeEnum.kTopViewOrientation myDrawingViewName = "TOP" Case Else myDrawingViewName = "" End Select If Not myDrawingViewName = "" Then tmpView.Name = myDrawingViewName End If End If 'Always close your Transactions oTrans.End Next
I cant find the original post where this code was given, however the addition near the top of
' Set rotation to 0
If tmpView.Camera.ViewOrientationType = ViewOrientationTypeEnum.kArbitraryViewOrientation Then
If tmpView.Rotation <> 0 Then
tmpView.Rotation = 0
End If
End If
Was supposed to resolve the problem. It did not.
Does anyone know how to fix this bug? Ive checked what I can and the view sends back that its at 0 degrees no matter what so I guess that didnt fix it at all.
Ive decided to add more context here. If a drawing view is orented like this:
It works fine. However if the view is oriented as such:
It doesnt work, I understand this is because ViewOrientationTypeEnum.kTopViewOrientation is technically not true due to this however that is remarkably dumb....