Assemblies, Content center parts and iLogic

Assemblies, Content center parts and iLogic

fridtjofZM5ME
Collaborator Collaborator
1,545 Views
5 Replies
Message 1 of 6

Assemblies, Content center parts and iLogic

fridtjofZM5ME
Collaborator
Collaborator

I have an iAssembly containing a threaded rod (iPart), a nut, and a washer. The table rows in the both the iPart and the iAssembly reflects the thread diameter of the rod (iPart_M8, iPart_M10 etc. and iAssy_M8, iAssy_M10 etc.).

 

Is it possible to create an iLogic rule that changes the size of the nut and the washer accordingly? Previously I've just added the nuts and washers in all the neccesary sizes, placed them, and used the suppression column to get the desired result, but his doesen't seem like a very clever approach to the matter. It has to be a smarter way to do this...

0 Likes
Accepted solutions (1)
1,546 Views
5 Replies
Replies (5)
Message 2 of 6

dutt.thakar
Collaborator
Collaborator

Yes you can do that. It is slightly different though for content center parts, I assume here that you have your own iParts that you need to use in an assembly.

 

Create a Parameter Named "Size" in both iParts Nut and Washer. Add it to table and add values M8, M10 in specific rows.

 

Then create a text parameter named as "Size" in the assembly that you want to put in this iParts. Set the parameter to Multi value and add values M8, M10 etc.

Change the occurrence name that you see in browser for iParts, as "Washer" and "Nut" and then try adding below rule in assembly.

 

iPart.FindRow("Washer", "Size", "=", Size)

iPart.FindRow("Nut","Size","=",Size)

 Now when you change the different values in "Size" Parameter from drop down it will select the specific instance from iPart and change it.

 

Try and see if it works. All the best.

 

If this has answered your question, please accept this as solution.

 

Regards,

Dutt Thakar.

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 3 of 6

fridtjofZM5ME
Collaborator
Collaborator

If I understand you correctly, I have to save a copy of the nut and washer as a custom component that I am then allowed to edit? I also figured that might work in some way, but that doesen't quite answer the question.

 

What I'm after is an iLogic-way to automate the process of right-clicking the individual CC-parts in the assembly and click "Change size..." and choose the right size nut and washer based on either which row of the iAssembly is active at any given time, or, at the absolute best, based on what kind of thread Inventor automatically detects present on the part the nut and washer are placed onto from the Content Center to begin with. I guess we could call this keeping the size selection from the Content Center "Adaptive" in a way.

 

I'm still very new to the whole iLogic concept, but from browsing the menus in the iLogic editor it appears that a lot of the things that would relate to various Content Center functionality simply isn't there to begin with

0 Likes
Message 4 of 6

dutt.thakar
Collaborator
Collaborator
Accepted solution

If you are trying to tweak content center part, Make sure you drive the size from assembly parameter. Just like a drop down, you can also add that parameter in to iAssembly table, but you need to link it in the iLogic rule. First you need to insert one size of fastener in the assembly and constrain it manually.

 

After that try below line of code. You also need to rename the browser node once you add them in the assembly. If you don't want to write this, Open the iLogic rule editor and find the specific CC component, right click and select the option called as "Components.Add" it will add the code to add the fastener automatically.

 

One tweak to automate it with your size is, you need to remove the size in below code, for example in Nut you need to remove the last thing written as "M16x2-8.8" and add the Size parameter there, which should also follow the same thread size/ component size "Here M16x2-8.8" as it is in the CC parts.

 

Try and see if it works. Try also to play around with it. This code you will also find in the iLogic Snippets under the  "iLogic Assemblies/Components" section.

 

ThisAssembly.BeginManage

Components
.AddContentCenterPart("Hex Head Bolt-01","Fasteners:Bolts:Hex Head","Hex head bolt DIN 931 8.8 FZ","M16 x 70") Components.AddContentCenterPart("Lock Nut-01", "Fasteners:Nuts:Hex", "Lock Nut DIN 982 FZB","M16x2-8.8")

ThisAssembly.EndManage

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 5 of 6

fridtjofZM5ME
Collaborator
Collaborator

It didn't keep the constraints to begin with, but I figured that out eventually. This is what I ended up with that worked:

 

ThisAssembly.BeginManage
If Driving_parameter = 1 ul  Then
	Nut_dim = "M8"
	Washer_dim = 8
	Nut_Name = "ISO 4032 M8:1"
	Washer_name= "ISO 7089 8:1"
End If
If Driving_parameter = 2 ul  Then
	Nut_dim = "M10"
	Washer_dim = 10
	Nut_Name = "ISO 4032 M10:1"
	Washer_name= "ISO 7089 10:1"
End If
If Driving_parameter = 3 ul  Then
	Nut_dim = "M12"
	Washer_dim = 12
	Nut_Name = "ISO 4032 M12:1"
	Washer_name= "ISO 7089 12:1"
End If
If Driving_parameter = 4 ul  Then
	Nut_dim = "M16"
	Washer_dim = 16
	Nut_Name = "ISO 4032 M16:1"
	Washer_name= "ISO 7089 16:1"
End If
If Driving_parameter = 5 ul  Then
	Nut_dim = "M20"
	Washer_dim = 20
	Nut_Name = "ISO 4032 M20:1"
	Washer_name= "ISO 7089 20:1"
End If



Dim ISO_4032_M8_1_0Pos = ThisAssembly.Geometry.Matrix(0, 0, -1, 0,
                                                      0, 1, 0, 0,
                                                      1, 0, 0, -12,
                                                      0, 0, 0, 1)
Dim ISO_4032_M8_1_0 = Components.AddContentCenterPart(Nut_Name,
                                                      "LMV komponenter:Nuts:Hex",
                                                      "ISO 4032",
                                                      Nut_dim,
                                                      ISO_4032_M8_1_0Pos)
Dim ISO_7089_8_1_0Pos = ThisAssembly.Geometry.Matrix(0, -1, 0, 0,
                                                     0, 0, 1, 0,
                                                     -1, 0, 0, -12,
                                                     0, 0, 0, 1)
Dim ISO_7089_8_1_0 = Components.AddContentCenterPart(Washer_name,
                                                     "LMV komponenter:Diverse:Plain",
                                                     "ISO 7089", Washer_dim,
                                                     ISO_7089_8_1_0Pos)
													 
offset=headheight+Parameter(Nut_Name, "d1")+2

Constraints.AddMate("Mate:1", Nut_Name, "Proxy:Face2", "",
                    "Z Axis",
                    e1InferredType := InferredTypeEnum.kInferredLine,
                    e2InferredType := InferredTypeEnum.kNoInference,
                    solutionType := MateConstraintSolutionTypeEnum.kAlignedSolutionType)
Constraints.AddFlush("Flush:1", Nut_Name, "YZ Plane", "",
                     "XY Plane", offset)
Constraints.AddByiMates("Insert:2", Washer_name, "Insert In1",
                        Nut_Name, "Insert Back1")



ThisAssembly.EndManage
0 Likes
Message 6 of 6

fridtjofZM5ME
Collaborator
Collaborator

BTW, how do I get the iLogic rule to run automatically when I place this iassembly into another assembly?

0 Likes