Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im working on this:
http://forums.autodesk.com/t5/inventor-customization/how-to-tackle-this-idea/m-p/6829858#M69613
And I'm not getting on how to make a view that is dependent on the vieworientation of another base view.
I tried
SyntaxEditor Code Snippet
Dim DrawingView.ViewOrientationFromBase As oOrientation = True Dim oOrientation As ViewOrientationTypeEnum = ViewOrientationTypeEnum.kRightViewOrientation
But that doesn't work.
I can't find documentation on this ViewOrientationFromBase but it seems this is the thing I need.
Anyone that dealt with this before?
What I have until now:
SyntaxEditor Code Snippet
'Get the active document Dim oDoc As Document = ThisApplication.ActiveDocument 'Exit if the document isn't drawing If oDoc.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub 'Get the correct sheet Dim oSheet As Sheet = oDoc.ActiveSheet 'Exit if the sheet have no views If oSheet.DrawingViews.Count = 0 Then Exit Sub 'Get the selection from user Dim oSelect As Object = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Pick a view") 'Exit if nothing is selected If oSelect Is Nothing Then Exit Sub 'Get the view Dim oView As DrawingView = oSelect 'Get the first document from the view Dim oModel As Document = oDoc.ReferencedDocuments.Item(1) 'Exit if the referenced document isn't sheet metal If oModel.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Exit Sub 'Get the view position Dim oPosition As Point2d = oView.Position 'Get the view size Dim oSpace As Double = oView.Width 'Offset the position oPosition.X = oPosition.X + oSpace 'Get the view scale Dim oScale As Double = oView.Scale 'Set the orientation 'Dim DrawingView.ViewOrientationFromBase As oOrientation = True NOT WORKING Dim oOrientation As ViewOrientationTypeEnum = ViewOrientationTypeEnum.kRightViewOrientation 'Set the view style Dim oViewStyle As DrawingViewStyleEnum = oView.ViewStyle 'Add the new view oSheet.DrawingViews.AddBaseView(oModel, oPosition, oScale, oOrientation, oViewStyle, False)
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
___________________________Solved! Go to Solution.