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: 

Accessing DetailDrawingView Object

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
dustinbagley
205 Views, 2 Replies

Accessing DetailDrawingView Object

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oView As DrawingView
Dim oDetailView As DetailDrawingView

For Each oSheet In oDrawDoc.Sheets
	For each oView in oSheet.DrawingViews
		For Each oDetailView In oView.DetailDrawingViews
			oDetailView.FenceRadius = 3
		Next
	Next
Next

I'm trying to write to 'Fence Radius' however, its telling me
that DetailDrawingView is not found in DrawingView despite the fact
that it is listed as such in API help.

dustinbagley_0-1678316880624.png

 

2 REPLIES 2
Message 2 of 3

Hi @dustinbagley 

 

The DrawingView object is not the parent of DetailDrawingView, DetailDrawingView merely inherits members of the DrawingView class. You can see it says 'Derived' as oppose to 'Parent' in the help pages. In your rule, if you type "oView." then let intellisense show you the members, then repeat for "oDetailView.", you'll see the same members across both.. These are the derived/inherited members.

 

When you are looping through the drawing views, the DetailDrawingView is a DrawingView, so you need to test if that drawing view is of the type DetailDrawingView, as below:

 

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oView As DrawingView
Dim oDetailView As DetailDrawingView

For Each oSheet In oDrawDoc.Sheets
	For Each oView In oSheet.DrawingViews
		If TypeOf oView Is DetailDrawingView Then
			oDetailView = CType(oView, DetailDrawingView)
			oDetailView.FenceRadius = 3
		End If
	Next
Next

Hope that helps.

Message 3 of 3
dustinbagley
in reply to: dustinbagley

Great, thank you for you help.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report