Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic, Tables, BOM and Layers!

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sgwilliams
1222 Views, 2 Replies

iLogic, Tables, BOM and Layers!

I have a idw file which has two sheets. On sheet 2 I'm trying to make a line item in a BOM table visible only when a layer is turned on. We also need this too function in a dwf file after we publish our sheets so we can toggle it on and off using layers.

 

Say I have a table that has items 1 thru 5. When I turn off a layer called layerblue, I would like item number 4 to not be visible. Is this possible using the iLogic function?

 

Is this something that can be done or do I need to use the VB side to make this a reality.

 

Work Station : Custom built, Liquid Cooled, Asus Pro WS X570-ACE Motherboard; AMD Ryzen 9 3900X 3.8 GHz 12-Core Processor; ASUS TUF Gaming NVIDIA GeForce RTX 3060 V2 OC Edition Video Card; 32 GB CORSAIR Dominator Platinum DDR4-2132 Memory ; Samsung 850 EVO 1TB SSD Drive.
2 REPLIES 2
Message 2 of 3

Hi sgwilliams,

 

Here is a simple iLogic rule that checks to see if the layer is turned off and then hides the 4th row of the parts list. You could tie this rule to an event trigger such as the save event, so that the rule is run everytime the drawing is saved.

 

' Set a reference to the drawing document.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
    
' Set a reference to the first parts list on the active sheet.
' This assumes that a parts list is on the active sheet.
Dim oPartList As PartsList
oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)

' Set a reference to the 4th row
Dim oRow As PartsListRow
oRow = oPartList.PartsListRows.Item(4)

'check layer and turn parts list row on/off 
If oDrawDoc.StylesManager.Layers("layerblue").Visible = False Then
'turn off row
oRow.Visible = False
Else
'turn on row
oRow.Visible = True
End If

 

alternate rule that just toggles them both on / off at the same time

 

' Set a reference to the drawing document.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
    
' Set a reference to the first parts list on the active sheet.
' This assumes that a parts list is on the active sheet.
Dim oPartList As PartsList
oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)

' Set a reference to the 4th row
Dim oRow As PartsListRow
oRow = oPartList.PartsListRows.Item(4)

'toggle on / off layer and parts list row
If oDrawDoc.StylesManager.Layers("layerblue").Visible = False Then
oDrawDoc.StylesManager.Layers("layerblue").Visible = True
oRow.Visible = True
Else
oDrawDoc.StylesManager.Layers("layerblue").Visible = False
oRow.Visible = False
End If

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 3 of 3
sgwilliams
in reply to: sgwilliams

Curtis this does half of what I'm looking to accomplish but it doesn't follow thru when I publish the dwf file. it will not remove the line item when I turn the layer off in the dwf viewer.

 

I have found a way to accomplish what I'm after but the iLogic doesn't do it. My work around is to:

  1. create a BOM & hide the line item that I'm trying to toggle on /off with the layer.
  2. Once this is accomplished I create a table that has only one row and no headings so it looks like a line item in my BOM.
  3. I then add the layer attribute to the single row table I created.

After the file is published to dwf file it can be turned on and off as it is required. 

 

Curtis Thanks for your help. I will use your answer as a solution because it helped point me in the right direction & it did half of what I was looking to accomplish, even tho I did not use it in the final fix.

Work Station : Custom built, Liquid Cooled, Asus Pro WS X570-ACE Motherboard; AMD Ryzen 9 3900X 3.8 GHz 12-Core Processor; ASUS TUF Gaming NVIDIA GeForce RTX 3060 V2 OC Edition Video Card; 32 GB CORSAIR Dominator Platinum DDR4-2132 Memory ; Samsung 850 EVO 1TB SSD Drive.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report