Message 1 of 6
How to pull Visibility status from an assembly into .idw to turn flat patterns on or off
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I work with large assemblies of parts that vary in style and function depending on the customer, but use a base model for each and have some automation to help with that.
In the .idw I have a bunch of flat patterns set up and right now its a manual process to turn these off when they are not needed before I send these drawings out.
I've made some code that will turn flat patterns on or off depending on a parameter, but I'm wondering if there is any way to pull in the status of the inventor part itself, read if that part is currently visible or not, and use that as the determining factor to have a flat pattern turn on or off instead of a created parameter.
'' Suppresses/unsupresses views based on if they are on/off in the iLogic menu '' NOTE: Parameters/views can be selected/seen from the model tab above ' Initializes variables "odoc" and "oSheet" odoc = ThisDoc.Document Dim oSheet As Sheet ' If parameter is turned off in the iTrigger menu, then If Component.Visible("MK HAT SECTION:1")=True Then '<- this is the bit of code that does not work. ' For each Sheet in the document (Code inside will run on every sheet - allows sheet order to be changed) For Each oSheet In odoc.Sheets ' Initializes variable "oView" Dim oView As DrawingView ' For each DrawingView on the sheet (Runs through every view that the sheet has" For Each oView In oSheet.DrawingViews ' Initializes the selection of oView based on the sheet name Select Case oView.Name ' Selects which view(s) you want to control Case "VIEW53" ' Suppresses the selected views oView.Suppressed = True ' Terminates selection End Select ' Terminates inner for loop Next ' Terminates outer for loop Next ' If Cabinet 1 is NOT 0 in the iTrigger menu ' Works the same as above, but oView.Suppressed is false turns the view back on ‘ Could add more If statements To Replace “else” Else For Each oSheet In odoc.Sheets Dim oView As DrawingView For Each oView In oSheet.DrawingViews Select Case oView.Name Case "VIEW53" oView.Suppressed = False End Select Next Next ' Terminates the if statement End If