Hi,
I made a flanged connection using I logic. Very simple Tube + Flange + Gasket + Blind flange + Bolting.
Then I tried to write some ilogic rule to have Blind flange on / off when needed, hence the Gasket & Bolting also need to be off. Like in these images:
That works fine visually, but I also want the BOM to be set accordingly. For the Blind flange & Gasket my BOM is OK. But for my bolting the BOM is not OK.
I tried to set the BOM structure the same way as the visibility but that failed. It only subtracted 1 bolt from my list (see code)
If Blindflange_status = 0 Then 'Bolting off Component.InventorComponent("Bolting:1").BOMStructure = BOMStructureEnum.kReferenceBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Bolting:1") = False Else 'Bolting on Component.InventorComponent("Bolting:1").BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Bolting:1") = True End If
Is there a way to set all parts within a pattern BOM structure?
I made my bolting by adding 1 bolt, 1 washer & 1 nut and then pattern them using feature pattern select.
It's the same parts, so I don't see why it should only remove one. I'm no iLogic wizard, but why don't you just add a supression for the pattern in that code as well?
Because the rule is based on the browser name:
In a pattern i have Bolt:1 - 8 times - this will make
Bolt:1
Bolt:2
...
This makes my rule only good for Bolt:1
Adding surppression would make a LOD and that is what i'm trying to avoid.
If Blindflange_status = 0 Then 'Bolting off Component.InventorComponent("Bolting:1").BOMStructure = BOMStructureEnum.kReferenceBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.InventorComponent("Bolting:2").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:3").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:4").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:5").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:6").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:7").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.InventorComponent("Bolting:8").BOMStructure = BOMStructureEnum.kReferenceBOMStructure Component.Visible("Bolting:1") = False Component.Visible("Bolting:2") = False Component.Visible("Bolting:3") = False Component.Visible("Bolting:4") = False Component.Visible("Bolting:5") = False Component.Visible("Bolting:6") = False Component.Visible("Bolting:7") = False Component.Visible("Bolting:8") = False Else 'Bolting on Component.InventorComponent("Bolting:1").BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.InventorComponent("Bolting:2").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:3").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:4").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:5").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:6").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:7").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.InventorComponent("Bolting:8").BOMStructure = BOMStructureEnum.kDefaultBOMStructure Component.Visible("Bolting:1") = True Component.Visible("Bolting:2") = True Component.Visible("Bolting:3") = True Component.Visible("Bolting:4") = True Component.Visible("Bolting:5") = True Component.Visible("Bolting:6") = True Component.Visible("Bolting:7") = True Component.Visible("Bolting:8") = True End If
Maybe there's an easier way - But I tested with my assembly, and I could get it to set it all to reference or normal depending on if it was active or not
If Bolting:1 is your pattern (which consists of single parts), then you need to mark the first instances of the parts and demote them to an assembly
Yes. This works, I know that.
Problem is (as you may know) there are a lot of different flange sizes all with different no. of bolting,
which would make my rule not so "smart" if I code it that way.
I'm looking for a "smart" rule that checks the pattern feature and removes items from BOM accordingly.
Visibility is not a problem that I can do for the entire pattern.
My alternative is add the entire flange tabel in a rule with the No. of bolting. Then set the No. of bolting to 1 when there is no blindflange needed. This would remove my BOM issue.
But it will also create a new problem. (if i edit the flange(s) to a size thats new. I would also have to edit the rule)
If Blindflange_status = 0 Then 'Bolting off For InstanceNumber = 1 To d3 Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kReferenceBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = False Next Else 'Bolting on For InstanceNumber = 1 To d3 Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = True Next End If
For InstanceNumber = 1 to d3 <--- This would be the parameter name of your pattern number.
For it to work, that parameter has to have the same name in all your assemblies.
Component.InventorComponent("Solid1_1: <--- Remember the :, and put in your own instance name
Ok,
But i did this when i placed my pattern i choose feature pattern select. because the qty is always correct this way. No error margin.
How do i get youre "d3" then?
Thanks for the help already. didn't know about the "For InstanceNumber" code.
As you can see on the red boxes - When you click the parameters, it will show to the right. find the right parameter, and you'll be able to double click.
or simply figure out what the name is from the parameters menu, and then write that. It becomes blue when it refers to a parameter in your assembly
And just to avoid confusion - The part only shows two parameters because I made a box to show you an example. The proper part is at my work place
'Get the part and dimension that controls the pattern amount CircularPattern =Parameter("Part1:1", "d0") If Blindflange_status = 0 Then 'Bolting off For InstanceNumber = 1 To CircularPattern Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kReferenceBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = False Next Else 'Bolting on For InstanceNumber = 1 To d3 Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = True Next End If
Try this. In the first line to bring in a parameter from a part in the assembly. The code then uses that parameter.
For this to work, the circular pattern dimension must have the same name in all of your assemblies
'Get the part and dimension that controls the pattern amount CircularPattern =Parameter("Part1:1", "d0") If Blindflange_status = 0 Then 'Bolting off For InstanceNumber = 1 To CircularPattern Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kReferenceBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = False Next Else 'Bolting on For InstanceNumber = 1 To CircularPattern Component.InventorComponent("Solid1_1:" & InstanceNumber).BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'Sets BOM Structure to Reference (Remove from BOM) Component.Visible("Solid1_1:" & InstanceNumber) = True Next End I
Right you are!