Hi,
I've written some simple code which sets the scale of all the views in a drawing. However, I would like it skip any views which are iso, as we always have a small iso view in the corner of our drawings. The scale of these is much less that scale of the main views.
Is it possible to do this this in ilogic?
ie.
For Each oView As DrawingView In oSheet.DrawingViews
if oView.ORIENTATION = iso then
'next
else
oView.Scale = 1 / var
end if
next
I have not been able to find an orientation object in the DrawingView object.
thanks,
John
Solved! Go to Solution.
Solved by LukeDavenport. Go to Solution.
Using the DrawingView.Camera.ViewOrientationType might be good enough for you. The below code works fine for me - the only problem is if your ISO view is not a base view (its a projected or auxiliary view perhaps) then it won't be recognised as ISO in the ViewOrientationType Enum, just as 'Arbitrary'.
Sub Main Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument For Each oView As DrawingView In oDrawDoc.Sheets.Item(1).DrawingViews 'Define camera
Dim cam As Camera = oView.Camera If Not oView.Camera.ViewOrientationType = 10762 AndAlso _ Not oView.Camera.ViewOrientationType = 10761 AndAlso _ Not oView.Camera.ViewOrientationType = 10760 AndAlso _ Not oView.Camera.ViewOrientationType = 10759 Then MessageBox.Show("Not an ISO base view", "Title") oView.Scale = 0.1 End If Next End Sub
Hi @lucas_lacerda_proj ,
You can use something like this to check the ViewType.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument For Each oView As DrawingView In oDrawDoc.ActiveSheet.DrawingViews If Not oView.ViewType = DrawingViewTypeEnum.kProjectedDrawingViewType 'do some stuff with non-projected views MsgBox(oView.Name & " is NOT a projected view.",, "iLogic") End If Next
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument For Each oView As DrawingView In oDrawDoc.ActiveSheet.DrawingViews If oView.Viewtype = DrawingViewTypeEnum.kProjectedDrawingViewType 'do some stuff with projected views MsgBox(oView.Name & " is a projected view.",, "iLogic") End If Next
Drawing View Type.
Name | Value | Description |
kAssociativeDraftDrawingViewType | 10506 | View is an associative draft one. |
kAuxiliaryDrawingViewType | 10499 | View is an auxiliary one. |
kCustomDrawingViewType | 10498 | View with customized camera setting. |
kDefaultDrawingViewType | 10497 | Specifies the default View. The more strongly typed value is returned in a query. |
kDetailDrawingViewType | 10502 | View is a detail of a portion of the document contents. |
kDraftDrawingViewType | 10505 | View is a draft one. |
kOLEAttachmentDrawingViewType | 10500 | View is an OLE attachment. |
kOverlayDrawingViewType | 10507 | View is an overlay one. |
kProjectedDrawingViewType | 10504 | View is a projected one. |
kSectionDrawingViewType | 10503 | View is a section. |
kStandardDrawingViewType | 10501 | View with the camera set to one of the standard orthogonal views (Top, Iso, etc.). |