There are sheets "Sheet1" and "Sheet2" with projection views "View1" and "View2" Provided that some variable A = 0, you need to hide the views "View1" and "View2", and if after hiding the variable A changed its value from 0 to any other, then "View1" and "View2" appeared again. The code below performs this task, but provided that the number of sheets in the drawing file does not change by number. How to properly manage the view so that when you add or remove sheets, their numbering does not affect the process? If A = 0 Then ThisDrawing.Sheet ("Sheet1: 1"). View ("View1"). View.Suppressed = True ThisDrawing.Sheet ("Sheet2: 2"). View ("View2"). View.Suppressed = True Else ThisDrawing.Sheet ("Sheet1: 1"). View ("View1"). View.Suppressed = False ThisDrawing.Sheet ("Sheet2: 2"). View ("View2"). View.Suppressed = False End If
Thank you for your comment! I see a couple other ways you could accomplish this. If you'd like to call out the sheet by Index instead of name you could replace "ThisDrawing.Sheet("Sheet1:1")" with "ThisDrawing.Document.Sheets(1)". For calling out the sheets, the index starts at "1". Otherwise you could loop through all sheets that exist and try to supress the views using something like this: Dim suppressView As Boolean = False If A = 0 Then suppressView = True End If For Each mySheet In ThisDrawing.Sheets.NativeEntity mySheet.View("View1").View.Suppressed = suppressView mySheet.View("View2").View.Suppressed = suppressView Next
hi, when I use the snipped for balloon, some of the commands doesn't get have the collor it is supposed to have. so inventor doesn't recognise it. do I need to add these commands in or how does it work?
Hello. Instead of using the faces, could we use the planes and name them to use as a basis for dimensioning in the drawings? Thanks
the snipet is not present in my inventor
These new snipets are only available in Inventor 2021, is this the version you're using?
There are sheets "Sheet1" and "Sheet2" with projection views "View1" and "View2"
Provided that some variable A = 0, you need to hide the views "View1" and "View2",
and if after hiding the variable A changed its value from 0 to any other, then "View1" and "View2" appeared again.
The code below performs this task, but provided that the number of sheets in the drawing file does not change by number.
How to properly manage the view so that when you add or remove sheets, their numbering does not affect the process?
If A = 0 Then
ThisDrawing.Sheet ("Sheet1: 1"). View ("View1"). View.Suppressed = True
ThisDrawing.Sheet ("Sheet2: 2"). View ("View2"). View.Suppressed = True
Else
ThisDrawing.Sheet ("Sheet1: 1"). View ("View1"). View.Suppressed = False
ThisDrawing.Sheet ("Sheet2: 2"). View ("View2"). View.Suppressed = False
End If
Thank you for your comment! I see a couple other ways you could accomplish this. If you'd like to call out the sheet by Index instead of name you could replace "ThisDrawing.Sheet("Sheet1:1")" with "ThisDrawing.Document.Sheets(1)". For calling out the sheets, the index starts at "1".
Otherwise you could loop through all sheets that exist and try to supress the views using something like this:
Dim suppressView As Boolean = False
If A = 0 Then
suppressView = True
End If
For Each mySheet In ThisDrawing.Sheets.NativeEntity
mySheet.View("View1").View.Suppressed = suppressView
mySheet.View("View2").View.Suppressed = suppressView
Next
hi,
when I use the snipped for balloon, some of the commands doesn't get have the collor it is supposed to have. so inventor doesn't recognise it.
do I need to add these commands in or how does it work?