Using iLogic to exclude or include hardware in an iAssembly factory

Using iLogic to exclude or include hardware in an iAssembly factory

Anonymous
Not applicable
2,210 Views
13 Replies
Message 1 of 14

Using iLogic to exclude or include hardware in an iAssembly factory

Anonymous
Not applicable

I have an iAssembly that will have many different configurations. 

10 Transformers in an iAssembly with table

2 Rectifier configurations in an iAssembly with table

3 UI options (3 more coming)

4 Output Configurations (12 more coming)

 

I will quit if I have to update 700 models every time a change is made.  I started using iAssembly configurations to assist with this. I would like to clean up the table entries and remove all of the screws from the table. How do I use iLogic to include or exclude parts based on the selection of an iAssembly

 

Example,

I choose rectifier A in the table, I want the extra hardware associated with rectifier B to automatically disable so it is not in the model or the BOM. This will allow the final assembly table to be nice and clean with clear choices for quickly making a new configuration. The hardware has no ability to group in the table so with hundreds of screws in the list, I have no idea what screw I am actually turning off if I have to do it manually.  

 

0 Likes
Accepted solutions (1)
2,211 Views
13 Replies
Replies (13)
Message 2 of 14

philip1009
Advisor
Advisor

First off, you can rename the occurrences in your assembly in the Model browser, this won't affect the part number or file name of that occurrence, this way you can give each a unique name in your iAssembly table.

 

After naming each occurrence what you want edit your table by double-clicking the Include/Exclude feature under each part located under the Components tab:

iAssembly include_edited.jpg

 

Also when you right click the main Table node near the top of the model browser you'll get an Edit via Spreadsheet option.  This will allow you to edit the table in an Excel like environment including Find/Replace, mass copy/paste, etc.

 

They last thing I should mention is iParts and iAssemblies weren't really meant for template manipulation, they're really more for creating the libraries for your top level assembly template, using iLogic to edit your iPart/iAssembly tables is not recommended.

 

Basically the recommended route is use iParts/iAssemblies to create your libraries and then use iLogic at the top level to create your template.

Message 3 of 14

Anonymous
Not applicable

Maybe I am doing this wrong. What is the proper way to be able to generate final assembly configurations when you have several hundred options. The configurations must have an accurate model and BOM for making assembly prints. I though the whole point of an iAssembly factory was to easily make configurations and create the models for those configurations. How do you manage changes on such a large family of final assemblies if not using iAssemblies?

0 Likes
Message 4 of 14

philip1009
Advisor
Advisor

iLogic is the best way to go, there's a lot of learning along the way, including computer code, but if built up the right way you can have all your options in a simple form then one or a few buttons will automate tedious configuration tasks.  In my opinion it's the most powerful tool that Inventor comes with and it's a shame that a lot of schools don't teach it in a standard course.

 

To start with, take a look at the API Help Guide (Application Programming Interface):

API Help_edited.jpg

To access iLogic in Inventor, just open a document and on your Ribbon go to Manage > iLogic and click iLogic Browser.  Rules and Forms are only related to the document you have open, Global Forms and External Rules are always available no matter what file you have open, you just have to be careful about coding and consider every situation possible when using these.

 

Forms allows you to make a simple window that only has the necessary parameters you need to change in whatever format you need and also allows you to bring in your rules as buttons to activate the code in those rules.  It can't do everything that a full on VB Form in Windows will give you, but if you're clever enough it should be enough.

 

Also, under the Manage > iLogic tab on your ribbon is Event Triggers.  This allows rules to run automatically under certain events such as On Save or Parameter Changes.

 

For help with iLogic coding I recommend you head over to the Inventor Customization forum, there's plenty of expert iLogic/API users over there to help you along the way.

 

The code that iLogic uses is called Visual Basic, it isn't an exact correlation between the two, but the differences are easy to discern.  Here's a YT playlist that I've found is the best at teaching Visual Basic from the basics like "If This Then That" to more complex stuff like looping and arrays:

https://www.youtube.com/playlist?list=PLC601DEA22187BBF1

 

And here's a playlist from Ketiv AVA with all of their videos related to iLogic: https://www.youtube.com/playlist?list=PLetTiL10gBjH1duj0BKQObSejXfTD16Vh

 

You can still use iParts and iAssemblies, just use them to build up every possible combination you need in the library of individual parts and assemblies that will be used in your top level iLogic based assembly, there's simple code to swap out the occurrences in your library.

 

Good luck on learning this stuff, just be patient and you'll get it in time.

Message 5 of 14

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous 

 

edit: I see where philip1009 stated what I just typed after I replied, but I wanted to make sure this was clear, as your other thread suggested this might not be clear

 

If I'm not mistaken the ilogic tools for iParts and iAssemblies are just used for changing rows in a iPart or iAssembly component.... so for instance if I had a General arrangement assembly that included iParts and iAssemblies, I could have some iLogic in that assembly that would automate the the "Row Change" of those components based on other selections, etc.

 

So to state it another way, there is not really anything in the iLogic tools to help you author the iPart/iAssembly factory tables. The iLogic tools simply automate the changing of the iPart/iAssembly members in another assembly.

 

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

EESignature

Message 6 of 14

Anonymous
Not applicable

So I am trying to create some iLogic rules and I already hit an issue. I have an iAssembly with 2 parts in it 750650110 and 750650111. This iAssembly is in my final iAssembly and I am trying to very basically create 2 final assembly configurations. When I select the version that uses the 750650110, I want the hardware that is specific to the 750650111 to disable by an iLogic rule.  This 1 rule alone would save me 17 table entries and that isn't even factoring in the constraints. 1 Model file to rule all of the configurations is the best thing since 3D CAD if it can actually work. 

 

When I run the rule the parts disappear, but they do not exclude. When I rebuild the model they reappear. So it is trying to work but not quite there.

 

 

If Component.iComponentIsActive("750650110:1") Then

Component.InventorComponent("RING TERMINAL .25 12-10GA RING TERMINAL .25 12-10GA-Silver:3").Excluded = True
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:10").Excluded = True
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:8").Excluded = True
Component.InventorComponent("Split Lock Washer - Inch 0.25:8").Excluded = True
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:7").Excluded = True
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:8").Excluded = True
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:6").Excluded = True
Component.InventorComponent("Split Lock Washer - Inch 0.25:6").Excluded = True
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:6").Excluded = True
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:7").Excluded = True
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:5").Excluded = True
Component.InventorComponent("Split Lock Washer - Inch 0.25:5").Excluded = True
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:5").Excluded = True
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:3").Excluded = True
Component.InventorComponent("Split Lock Washer - Inch 0.25:3").Excluded = True
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:3").Excluded = True
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:4").Excluded = True


Constraint.IsActive("DUAL BRIDGE HARDWARE:54") = False
Constraint.IsActive("DUAL BRIDGE HARDWARE:52") = False
Constraint.IsActive("DUAL BRIDGE HARDWARE:53") = False
Constraint.IsActive("DUAL BRIDGE HARDWARE:55") = False

Constraint.IsActive("Gun 2 Cable:1") = False
Constraint.IsActive("Gun 2 Cable:2") = False
Constraint.IsActive("Gun 2 Cable:3") = False
Constraint.IsActive("Gun 2 Cable:4") = False
Constraint.IsActive("Gun 2 Cable:5") = False
Constraint.IsActive("Gun 2 Cable:6") = False
End If


If Component.iComponentIsActive("750650111:1") Then

Component.InventorComponent("RING TERMINAL .25 12-10GA RING TERMINAL .25 12-10GA-Silver:3").Excluded = False
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:10").Excluded = False
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:8").Excluded = False
Component.InventorComponent("Split Lock Washer - Inch 0.25:8").Excluded = False
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:7").Excluded = False
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:8").Excluded = False
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:6").Excluded = False
Component.InventorComponent("Split Lock Washer - Inch 0.25:6").Excluded = False
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:6").Excluded = False
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:7").Excluded = False
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:5").Excluded = False
Component.InventorComponent("Split Lock Washer - Inch 0.25:5").Excluded = False
Component.InventorComponent("Plain Washer - Inch 1/4 - Regular - Type B:5").Excluded = False
Component.InventorComponent("Hex Nut - Inch 1/4 - 28:3").Excluded = False
Component.InventorComponent("Split Lock Washer - Inch 0.25:3").Excluded = False
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:3").Excluded = False
Component.InventorComponent("HHCS - Inch 1/4-28 UNF - 0.75:4").Excluded = False


Constraint.IsActive("DUAL BRIDGE HARDWARE:54") = True
Constraint.IsActive("DUAL BRIDGE HARDWARE:52") = True
Constraint.IsActive("DUAL BRIDGE HARDWARE:53") = True
Constraint.IsActive("DUAL BRIDGE HARDWARE:55") = True

Constraint.IsActive("Gun 2 Cable:1") = True
Constraint.IsActive("Gun 2 Cable:2") = True
Constraint.IsActive("Gun 2 Cable:3") = True
Constraint.IsActive("Gun 2 Cable:4") = True
Constraint.IsActive("Gun 2 Cable:5") = True
Constraint.IsActive("Gun 2 Cable:6") = True

End If

0 Likes
Message 7 of 14

Curtis_Waguespack
Consultant
Consultant

@Anonymous wrote:

When I run the rule the parts disappear, but they do not exclude. When I rebuild the model they reappear. So it is trying to work but not quite there.


 Hi @Anonymous 

 

I feel like you didn't read or didn't understand my last message. 

 

There is nothing in the ilogic tools to help you configure the ipart/iassembly table. There are some iLogic ipart/iassembly functions that will allow you to change from one member to another once you have the tables configured, but that is it. 

 

Think of the ipart/iassembly tables as a library.... ilogic will allow you to trade one book from the library for another, but it does not help you write the books (or build the library).

 

But you can create a configuration that does not include iparts and iassemblies and make them active/not active quite easily... but then you might not really even need iparts/iassemblies.

 

In any case, if you're going to go the iLogic route, it'd be best to post to the Inventor Customization forum where programming related questions are better suited:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

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

EESignature

Message 8 of 14

johnsonshiue
Community Manager
Community Manager

Hi! On top of what experts already mentioned, I don't think there is a good workflow using iLogic to drive iAssembly or iPart table. iAssembly/iPart were designed to generate library components (self-sustained, independent, and totally driven by the table). iLogic rule can alter the table but it is no different than you edit the iAssembly/iPart table manually. Like I said, the tables should be clearly defined and should not be altered constantly.

If I understood your particular requirement correctly, you should be using iLogic without editing iAssembly/iPart. You can focus on setting up one variation. Then you use iLogic rule to drive parameter change at all levels. When you have one variation done, use iLogic Design Copy to spawn the variation.

At the moment, I am not aware of a better approach to fulfill your requirements in Inventor.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 9 of 14

philip1009
Advisor
Advisor

iParts and iAssemblies are best used to create/update/maintain a background library, when you have a file from that library placed in your top assembly there is code to easily swap between members of the same library: "ThisDoc.Document.ComponentDefinition.Occurrences.ItemByName("Part1:1").ChangeRowOfiAssemblyMember('Specify Row Number as Long or MemberName as String')" ' ChangeRowOfiPartMember works the same way.

 

However, I highly recommend you don't use the code that does that function.  In a fresh Inventor session, when you do what's called a Table Replace, either manually or through code, you'll see that, depending on the size and number of iParts/iAssemblies used to build up your library, it will take Inventor a long time to get that function done.  If you open Task Manager while Inventor is doing this and filter your Processes tab by CPU you'll see one or a few Excel processes in the background.  When any of those tables are accessed in a new Inventor session they will have to be perused for whatever reason, at some point one of my iAssemblies that had several thousand members would take 15 minutes for the first change to happen, however after those tables have been perused it will be faster until you closed Inventor again.  It's not a good method when you want a template that changes ASAP.

 

Therefore my recommendation is to use Component Replace in your code instead:

ThisDoc.Document.ComponentDefinition.Occurrences.ItemByName("Part1:1").Replace("C:\Vault Working Folder\Designs\Assembly Template\Library\Part2.ipt", False)

 

It goes so much faster than Table Replace since it bypasses those background Excel processes, however the only nagging requirement is you have to pre-Generate all table members so the files of your parts and assemblies are in your library along with all the code you'll have to come up with to generate the correct string of text that selects the correct file that you want to replace the Occurrence with.  I guess if you wanted to, you could put both Component Replace in your code with Table Replace as a backup, if the file you're looking for isn't in your library than you could do a Table Replace which will create the file in your library at the same time as the Table Replace function.

0 Likes
Message 10 of 14

Anonymous
Not applicable

 

 

 

0 Likes
Message 11 of 14

Anonymous
Not applicable

 

I feel like you didn't read or didn't understand my last message. 

 

There is nothing in the ilogic tools to help you configure the ipart/iassembly table. There are some iLogic ipart/iassembly functions that will allow you to change from one member to another once you have the tables configured, but that is it. 

 


 

 

I think this is a misunderstanding going both ways. I do not want to use iLogic to modify or generate the tables. I want to use it to include or exclude all of the hardware and simple parts that go with a specific table configuration but are not in the table. iLogic has an enable feature to it, so I am not understanding why this will not work. 

 

Having the ".Excluded = True" as part of iLogic  leads me to believe that iLogic can control weather a part is included or excluded in an assembly, same as a table entry would do, without having to use a table entry for that item using the iLogic to perform these tasks automatically.

Component.InventorComponent("RING TERMINAL .25 12-10GA RING TERMINAL .25 12-10GA-Silver:3").Excluded = True

 

 

This brings back my question of how assemblies with 100's of configurations should be handled. The Boss doesn't want to hear that it will take a month to update all of the models and prints to add a freaking decal to all of machines. There has to be a more efficient way to do this. How does everyone else deal with this?

 

I want ONLY these options in my final iAssembly table to choose from:

Transformer (1-10)

Bridge (1-2)

Output Style (1-4)

UI Style (1-3)

 

Based on what options I select in the table, I want the associated pieces to "know" if they belong in that configuration or not. Is that not what iLogic was designed for?

 

 

0 Likes
Message 12 of 14

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@Anonymous wrote:

 

I think this is a misunderstanding going both ways. I do not want to use iLogic to modify or generate the tables. I want to use it to include or exclude all of the hardware and simple parts that go with a specific table configuration but are not in the table. iLogic has an enable feature to it, so I am not understanding why this will not work.  Because when you place the iAssembly member into another assembly it will not reflect the iLogic exclusions, you would have to place the iAssembly member, then run the iLogic rule... and because it would better practice to just use one or the other.

 

Having the ".Excluded = True" as part of iLogic  leads me to believe that iLogic can control weather a part is included or excluded in an assembly, Yes it can do this same as a table entry would do, no it will not be the same result, as you've noticed it will not modify the table to reflect the the suppression state when you use iLogic to suppress this is a potential problem and creates two places to touble shoot issues rather than just one, iAssemblies without having to use a table entry for that item using the iLogic to perform these tasks automatically. I'm suggesting you use one or the other, missing the two in the way that you are attempting has no benefits as far as I can tell

Component.InventorComponent("RING TERMINAL .25 12-10GA RING TERMINAL .25 12-10GA-Silver:3").Excluded = True

 

 

This brings back my question of how assemblies with 100's of configurations should be handled. The Boss doesn't want to hear that it will take a month to update all of the models and prints configuring a large iAssembly as you describe should not take that long, a few days to setup and test, and then making modifications should only take minutes to add a freaking decal to all of machines. Just for clarification the Decal command is not supported in assemblies, but if you mean a part file representing a decal then this can be included/excluded as well... you might know this already but just in case not I thought it should be mentioned There has to be a more efficient way to do this. How does everyone else deal with this? Creating container subassemblies to hold hardware, etc. and using Excel to copy-fill and or Copy/paste in the table to quickly configure it is the way many would do this for large assemblie - OR - using ilogic to configure the assembly would be the way many others would do this, mixing the two is likely a rocky road

 

I want ONLY these options in my final iAssembly table to choose from:

Transformer (1-10)

Bridge (1-2)

Output Style (1-4)

UI Style (1-3)

 

If you decide to use iAssemblies then make those items Keys, and have your hardware subassemblies turn off the rest per your table configurations

 

Based on what options I select in the table, I want the associated pieces to "know" if they belong in that configuration or not. Is that not what iLogic was designed for? Not really, iLogic can do many things one of which is suppressing components, as I've mentioned there are functions in iLogic that relate to iAssemblies, these can control the which member (aka row) of the iAssembly is used when you run a rule, but it relies on the table to be configured a head of time....

 


Could you mix the two in the way that you are wanting to do?.... I guess maybe it could work....to me it would make a mess, and result in two places to have mistakes and conflicting information. 

 

I see no reason to mix the two, choose the one that you think will work best, but I'd work through a "proof of concept" taking it all the way from setup to use in design, to see what limitations or problems you encounter before spending time configuring the entire thing.

 

if you do decide to use iLogic please post your code and programming questions on the Inventor Customization forum rather than this general Inventor forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

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

EESignature

0 Likes
Message 13 of 14

philip1009
Advisor
Advisor

In an iAssembly if you exclude a screw from your assembly then it will do that for all member rows, if you want to control that screw differently for each member row, then you have to put the Include/Exclude column for that particular screw in your iAssembly table, any and all differences between member rows have to be represented in the table, iLogic cannot help you get around that.  If you want to use iLogic to control your top level assembly it cannot be an iAssembly, it'll be just a regular assembly with some iLogic code to automate your manual labor such as configuring your assembly.

 

Either the API for easy edit of iAssembly tables isn't available or isn't exposed to the user, I've tried using iLogic to configure iPart/iAssembly tables in the past.  It's a fool's errand imo so iAssembly is just a library tool.

 

Could you provide an example or picture of what you're configuring with iLogic?  I'll see if I can provide an example of what I'm trying to explain, I know I'm not the best teacher.

Message 14 of 14

Curtis_Waguespack
Consultant
Consultant

 

 


@philip1009 wrote:

  If you want to use iLogic to control your top level assembly it cannot be an iAssembly....

 


@philip1009 

 

I'm not sure this is technically true, but in practice it should not be an iAssembly, and conversely I would not generally advise using iLogic in an iAssembly... it's a bit like creating an 8 cylinder engine with four steam cylinders and four internal combustion....  could it work? I guess, but I wouldn't want to maintain it. 

 

I think the final solution is going to be iLogic, and I think with some diligent component naming, the code can be pretty tidy, but using a "For each component, if name contains ________" type block... 

 

so with all of that in mind, and since the discussion has been posted over here too, i think that's the better place to continue the conversation:

https://forums.autodesk.com/t5/inventor-customization/using-ilogic-to-enable-or-disable-hardware-in-...

EESignature