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.
Solved! Go to Solution.
Solved by dustinbagley. Go to Solution.
Solved by lmc.engineering. Go to Solution.
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.
Can't find what you're looking for? Ask the community or share your knowledge.