Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the Baseview information (For Section & Detail views)

1 REPLY 1
Reply
Message 1 of 2
karthikkumar_ml
356 Views, 1 Reply

Get the Baseview information (For Section & Detail views)

Is there a way to get sheet number of the base view for the Selected Child view (Mainly for Section. Detail Views). Because the Section views, Detail views (initially they would have created on the same sheet where the parent is, then they moved to different sheets). So we place the parent view sheet number.

1 REPLY 1
Message 2 of 2

DrawingView object has two useful properties: 

  • ParentView returns the reference to the parent DrawingView object. 
  • Parent returns the reference to the parent Sheet object.

 

Private Sub Test()

  'Get the active drawing document with an Drawing View .
  Dim oDrawDoc As DrawingDocument
  Set oDrawDoc = ThisApplication.ActiveDocument
  
  '3rd sheet with a given drawing view (e.g., section view)
  'This section view was moved from the 1st sheet
  Dim oSheet As Sheet
  Set oSheet = oDrawDoc.Sheets.Item(3)
  
  'reference to the section view
  Dim oView As DrawingView
  Set oView = oSheet.DrawingViews.Item(1)
  Debug.Print oView.Name
  
  'name of the parent base view
  Dim oParentView As DrawingView
  Set oParentView = oView.ParentView
  Debug.Print oParentView.Name
  
  'reference to the parent sheet
  Dim oParentSheet As Sheet
  Set oParentSheet = oParentView.Parent
  Debug.Print oParentSheet.Name
End Sub

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report