Ilogic Elbow multi value

Ilogic Elbow multi value

SpokenEarth
Advocate Advocate
837 Views
7 Replies
Message 1 of 8

Ilogic Elbow multi value

SpokenEarth
Advocate
Advocate

Hi community members, In a new to Ilogic, I'm trying to create a variable elbow with multi values.
Example:
DN10: wall thickness multi value, Radius multi value

DN20 wall thickness multi value, Radius multi value

DN25 wall thickness multi value, Radius multi value

I hope someone can I assist me

Thanks

0 Likes
Accepted solutions (1)
838 Views
7 Replies
Replies (7)
Message 2 of 8

CGBenner
Community Manager
Community Manager

@SpokenEarth 

Hi,  I'm wondering if you could accomplish what you need with an ipart, or a Content Center family table.  Will you be using this for tube & pipe?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 3 of 8

SpokenEarth
Advocate
Advocate

Good point, i used Iparts before and sometimes can trigger conflict.
My intention is not to use it in tube & pipe module

0 Likes
Message 4 of 8

CGBenner
Community Manager
Community Manager

@SpokenEarth 

Thank you for clarifying that.  I'm going to move this to the Customization forum, you'll find a lot more help with ilogic in that group.  Good luck!

 

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 5 of 8

J-Camper
Advisor
Advisor

Here is a quick little rule that should trigger when ever the Text Parameter "DIN2605" is changed:

'Triggers rule to run when parameter is changed:
Dim curOption As String = DIN2605
'Current List: ("DN10", "DN20", "DN25", "DN32")
If curOption = "DN10"
	Parameter("EXTERNAL_Ø") = 21.3 mm
	Parameter("R") = 28 mm
	Parameter("WALL_THICKNESS") = 2 mm
Else If curOption = "DN20"
	Parameter("EXTERNAL_Ø") = 23.3 mm
	Parameter("R") = 30 mm
	Parameter("WALL_THICKNESS") = 3 mm
Else If curOption = "DN25"
	Parameter("EXTERNAL_Ø") = 26.3 mm
	Parameter("R") = 32 mm
	Parameter("WALL_THICKNESS") = 4 mm
Else If curOption = "DN32"
	Parameter("EXTERNAL_Ø") = 27.3 mm
	Parameter("R") = 34 mm
	Parameter("WALL_THICKNESS") = 5 mm
End If
'Update Document
InventorVb.DocumentUpdate()

I filled in random values for the different configurations, so those are likely incorrect.  It should be pretty straight forward to see how you can change those preset values, but let me know if you have any questions

Message 6 of 8

SpokenEarth
Advocate
Advocate

Hi JCamper, thank you for helping me out, the code works fine. What if I need to have different values for all DN?
Example:
DN10 wall thickness 2, 4, 6 ,8
DN20 wall thickness 5, 6, 7 ,10
DN25 wall thickness 8, 10, 12 ,14

0 Likes
Message 7 of 8

J-Camper
Advisor
Advisor
Accepted solution

You can set a MultiValue list after setting the "WALL_THICKNESS" Parameter to a value on that list:

'Triggers rule to run when parameter is changed:
Dim curOption As String = DIN2605
'Current List: ("DN10", "DN20", "DN25", "DN32")
If curOption = "DN10"
	Parameter("EXTERNAL_Ø") = 21.3 mm
	Parameter("R") = 28 mm
	Parameter("WALL_THICKNESS") = 2 mm ' temporary value set to lowest in list
	'Set List Options:
	MultiValue.SetList("WALL_THICKNESS", 2 mm, 4 mm, 6 mm, 8 mm)
Else If curOption = "DN20"
	Parameter("EXTERNAL_Ø") = 23.3 mm
	Parameter("R") = 30 mm
	Parameter("WALL_THICKNESS") = 5 mm ' temporary value set to lowest in list
	'Set List Options:
	MultiValue.SetList("WALL_THICKNESS", 5 mm, 6 mm, 7 mm, 10 mm)
Else If curOption = "DN25"
	Parameter("EXTERNAL_Ø") = 26.3 mm
	Parameter("R") = 32 mm
	Parameter("WALL_THICKNESS") = 8 mm ' temporary value set to lowest in list
	'Set List Options:
	MultiValue.SetList("WALL_THICKNESS", 8 mm, 10 mm, 12 mm, 14 mm)
Else If curOption = "DN32"
	Parameter("EXTERNAL_Ø") = 27.3 mm
	Parameter("R") = 34 mm
	Parameter("WALL_THICKNESS") = 5 mm ' temporary value set to lowest in list
	'Set List Options:
	MultiValue.SetList("WALL_THICKNESS", 5 mm) 'Not sure what these could be
End If
'Update Document
InventorVb.DocumentUpdate()

This should still only trigger if the "DIN2605" Parameter gets changed, or if you use run all rules.  So it could overwrite your selection if you change the list value and then run the rule. 

 

So here is a more complex rule that should avoid overwriting, unless the current value is not a part of the new list:

Sub Main
	'Triggers rule to run when parameter is changed:
	Dim curOption As String = DIN2605
	'Current List: ("DN10", "DN20", "DN25", "DN32")
	Dim WallThicknesses As New List(Of String)
	If curOption = "DN10"
		WallThicknesses.AddRange({"2 mm", "4 mm", "6 mm", "8 mm"})
		Parameter("EXTERNAL_Ø") = 21.3 mm
		Parameter("R") = 28 mm
		'Check current against list:
		If NotIncluded(Parameter.Param("WALL_THICKNESS").Expression, WallThicknesses) Then Parameter("WALL_THICKNESS") = WallThicknesses.Item(0)
		'Set List Options:
		MultiValue.List("WALL_THICKNESS") = WallThicknesses
	Else If curOption = "DN20"
		WallThicknesses.AddRange({"5 mm", "6 mm", "7 mm", "10 mm"})
		Parameter("EXTERNAL_Ø") = 23.3 mm
		Parameter("R") = 30 mm
		'Check current against list:
		If NotIncluded(Parameter.Param("WALL_THICKNESS").Expression, WallThicknesses) Then Parameter("WALL_THICKNESS") = WallThicknesses.Item(0)
		'Set List Options:
		MultiValue.List("WALL_THICKNESS") = WallThicknesses
	Else If curOption = "DN25"
		WallThicknesses.AddRange({"8 mm", "10 mm", "12 mm", "14 mm"})
		Parameter("EXTERNAL_Ø") = 26.3 mm
		Parameter("R") = 32 mm
		'Check current against list:
		If NotIncluded(Parameter.Param("WALL_THICKNESS").Expression, WallThicknesses) Then Parameter("WALL_THICKNESS") = WallThicknesses.Item(0)
		'Set List Options:
		MultiValue.List("WALL_THICKNESS") = WallThicknesses
	Else If curOption = "DN32"
		WallThicknesses.AddRange({"5 mm"})
		Parameter("EXTERNAL_Ø") = 27.3 mm
		Parameter("R") = 34 mm
		'Check current against list:
		If NotIncluded(Parameter.Param("WALL_THICKNESS").Expression, WallThicknesses) Then Parameter("WALL_THICKNESS") = WallThicknesses.Item(0)
		'Set List Options:
		MultiValue.List("WALL_THICKNESS") = WallThicknesses
	End If
	'Update Document
	InventorVb.DocumentUpdate()
End Sub

Function NotIncluded(testString As String, sampleList As List(Of String)) As Boolean
	Dim Result As Boolean = True 'Default Response
	'Check list for match
	For Each s As String In sampleList
		If testString = s Then Result = False : Return Result 'Return match found
	Next
	'Return no match found
	Return Result
End Function

Let me know if you have any questions, or if this is not working as intended

Message 8 of 8

SpokenEarth
Advocate
Advocate

Thank you so much!!!....it worked perfect

0 Likes