- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I have a multiple sheet drawing and i want to replace views by suppress and unsuppress them according to different model configurations e.g "1" or "2".
I used the rule below and this worked well on a single sheet drawing, but when I got more sheets this only works on the active sheet.
How to solve this on a multiple sheet drawing? I have searched the forum without any luck.
If Parameter("30627.iam.Deling") = "2" Then ActiveSheet.View("VIEW1").View.Suppressed = True ActiveSheet.View("VIEW2").View.Suppressed = True ActiveSheet.View("VIEW3").View.Suppressed = False ActiveSheet.View("VIEW4").View.Suppressed = False Else ActiveSheet.View("VIEW1").View.Suppressed = False ActiveSheet.View("VIEW2").View.Suppressed = False ActiveSheet.View("VIEW3").View.Suppressed = True ActiveSheet.View("VIEW4").View.Suppressed = True End If
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @erik
Would this work for you? ![]()
Dim oDoc As DrawingDocument = ThisDoc.Document For Each oSheet As Sheet In oDoc.Sheets oSheet.Activate If Parameter("30627.iam.Deling") = "2" Then ActiveSheet.View("VIEW1").View.Suppressed = True ActiveSheet.View("VIEW2").View.Suppressed = True ActiveSheet.View("VIEW3").View.Suppressed = False ActiveSheet.View("VIEW4").View.Suppressed = False Else ActiveSheet.View("VIEW1").View.Suppressed = False ActiveSheet.View("VIEW2").View.Suppressed = False ActiveSheet.View("VIEW3").View.Suppressed = True ActiveSheet.View("VIEW4").View.Suppressed = True End If Next
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @JhoelForshav Thanks for your answer.
Unfortunately it does not work. As long as "View1" is not on the active sheet, it returns error message "No drawing named "View1" was found.
I am quite a novice in iLogic and are not so familiar with text coding. I use most boolean functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @erik
By adding On Error Resume Next I think it should work then ![]()
Dim oDoc As DrawingDocument = ThisDoc.Document For Each oSheet As Sheet In oDoc.Sheets On Error Resume Next oSheet.Activate If Parameter("30627.iam.Deling") = "2" Then ActiveSheet.View("VIEW1").View.Suppressed = True ActiveSheet.View("VIEW2").View.Suppressed = True ActiveSheet.View("VIEW3").View.Suppressed = False ActiveSheet.View("VIEW4").View.Suppressed = False Else ActiveSheet.View("VIEW1").View.Suppressed = False ActiveSheet.View("VIEW2").View.Suppressed = False ActiveSheet.View("VIEW3").View.Suppressed = True ActiveSheet.View("VIEW4").View.Suppressed = True End If Next
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report