Hello all,
Ran into a problem, which I can work around but its not an ideal solution.
The Problem
I have two section views on my drawing, both have the view identifier 'A'. However they are sections from different base views of the same part. So 'View1' on my drawing is sectioned to give the first 'A' view. Then i have 'View2' (which shows the same thing as 'View1') and is sectioned to give the second 'A' view. When the part being sectioned increases past a certain size I want to hide the first 'A' view and then leave the other 'A' view showing. And vica versa when the part decreases in length, using iLogic to do this in both cases.
I entered this line of code into a rule just to see what it does.
ActiveSheet.View("A").View.Suppressed = True
In my mind, both 'A' views should dissaper from the drawing. However, upon running only the first one dissapears. So it seems they are differentiated some how. Maybe by the order they were created? or by which view they are sectioned from?
Is there any way i can adjust the code to differentiated between the 2 views with the same view identifier?
Any help is much appreciated as always,
Many Thanks
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
Hi,
I've now taken a different approach to the drawing, which removes the problem stated above. However, if there is a quick solution i'd be interested to know how to do this for future reference.
Many Thanks
You could rename the second view. Is there a reason you don't want to rename it?
The following code will operate on both views:
Sub Main
SetSuppressionOfViews("A", True)
End Sub
Sub SetSuppressionOfViews(viewName As String, suppressed As Boolean)
Dim sheetX As Sheet = ThisDrawing.ActiveSheet.Sheet
For Each viewX As DrawingView In sheetX.DrawingViews
If (viewX.Name = viewName) Then
viewX.Suppressed = suppressed
End If
Next
End Sub
Hi Mike,
Thanks for the snippet of code, i'll add it to my library. Well on my drawing I had drawing views A, B, C etc all the way to VIEW G. This was for an assembly which was small in width and height.
I then had a separate set of views for an assembly which was large in width in height thus requiring 'breaks' (using the code you provided in one of my other threads 🙂 )
One of the two sets of views would supress depending on the size of the gate. So if the first set were supressed, my drawing views would start from VIEW H. Which isnt conventional, i wanted both sets to start with VIEW A which is the reason i had duplicate view identifiers.
However, using your break code i relaised i could just introduce the break when needed into the first set of views; eliminating the problem all together and making the code much neater. I hope that made sense!
Once again, many thanks for your help, I appreciate your input 🙂
Regards