iLogic to Place Content Centre Components Driven by Parameter

iLogic to Place Content Centre Components Driven by Parameter

kevin.dawson225WY
Participant Participant
482 Views
2 Replies
Message 1 of 3

iLogic to Place Content Centre Components Driven by Parameter

kevin.dawson225WY
Participant
Participant

Hi,

I have been creating an automated assembly that has a pair of flanges of variable size and thickness. I have Parameters set that dictate the required length and dia of the bolts but I can't get it to work. The whole assembly works fine I'm just trying to finesse it a bit by automating the bolt size (by placing from content centre).

I've followed the Youtube Ketiv.com Automated Assembly Generation with iLogic video for guidance.

There seem to be two issues with my code;

1. My code does not read the Parameters (AS_Bolt_DIA and AS_BOLT_LENGTH)

2. My code has no reference to the Standard of bolts used (ANSI) and am not too sure how to add it in.

I need the bolt, washer and nut to come from the content centre.

Any help would be gratefully received, I have only been using iLogic for the last 3 months so have mastered the basics but this is the first time I've tried to tie in the Content Centre.

Oh, and I forgot to say that when it comes to coding I'm probably only second to one of the Muppets.

Post Edited

Noticed that 'Material' in line 12 should be upper case and I had a closing bracket missing at the end of line 10 - problem not fixed though.

Error Message reads;

Error in rule: Flange Bolts, in document: TOPSIDE HO ASSY.iam

AddContentCenterPart: No content center row with the specification "Fasteners:Bolts:Hex Head BHHH UNC, Heavy Hexagon Bolt Inch (ANSI B18.2.1)) SIZE_SEL AS_BOLT_DIA,NLG AS_BOLT_LENGTH,MATERIAL Steel, ASTM A320 L7,Finish GALVANISED,Certification BS EN 10204 (DIN 50059)TYPE 3.1" was found.
SHH M, Hexagon Head Screw Metric (DIN 933), BHHH M, Heavy Hexagon Bolt Metric (ANSI B18.2.3.6M), BHHH UNC, Heavy Hexagon Bolt Inch (ANSI B18.2.1), BHH M, Hexagon Head Bolt Metric (DIN 931), SHHH M, Heavy Hex Screw Metric (ANSI B18.2.3.3M), 

Here is the code used to generate the Error;

 

 

'Flange Bolt Length	
AS_BOLT_LENGTH = RoundToFraction(BOLT_LENGTH_1, 1 / 2, RoundingMethod.RoundUp)

'Flange Bolt Dia
Parameter("ISOLATION BUSH:1", "IMPERIAL_BOLT_SIZE") = AS_BOLT_DIA
AS_BOLT_DIA = RoundToFraction(Parameter("ISOLATION BUSH:1", "IMPERIAL_BOLT_HOLE"), 1 / 8, RoundingMethod.RoundDown)

'Flange Bolt Placement
Dim componentB = Components.AddContentCenterPart("FlangeBolt", "Fasteners:Bolts:Hex Head", 
												"BHHH UNC, Heavy Hexagon Bolt Inch (ANSI B18.2.1))", 
												{"SIZE_SEL", "AS_BOLT_DIA", "NLG", "AS_BOLT_LENGTH",
												"MATERIAL", "Steel, ASTM A320 L7", "Finish", "GALVANISED",
												"Certification", "BS EN 10204 (DIN 50059)TYPE 3.1" },
												position := Nothing, grounded := False, 
												visible := True, appearance := Nothing)



Parameter.UpdateAfterChange = True

 

0 Likes
Accepted solutions (1)
483 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor
Accepted solution

Hi @kevin.dawson225WY 

 

When you assigned the value to the variable "AS_BOLT_DIA" you are not using that within the add method, your using a string called "AS_BOLT_DIA". Remove the quotes around the variable name to use the variable assigned value. 

'Flange Bolt Length	
AS_BOLT_LENGTH = RoundToFraction(BOLT_LENGTH_1, 1 / 2, RoundingMethod.RoundUp)

'Flange Bolt Dia
Parameter("ISOLATION BUSH:1", "IMPERIAL_BOLT_SIZE") = AS_BOLT_DIA
AS_BOLT_DIA = RoundToFraction(Parameter("ISOLATION BUSH:1", "IMPERIAL_BOLT_HOLE"), 1 / 8, RoundingMethod.RoundDown)

'Flange Bolt Placement
Dim componentB = Components.AddContentCenterPart("FlangeBolt", "Fasteners:Bolts:Hex Head", 
												"BHHH UNC, Heavy Hexagon Bolt Inch (ANSI B18.2.1))", 
												{"SIZE_SEL", AS_BOLT_DIA, "NLG", "AS_BOLT_LENGTH",
												"MATERIAL", "Steel, ASTM A320 L7", "Finish", "GALVANISED",
												"Certification", "BS EN 10204 (DIN 50059)TYPE 3.1" },
												position := Nothing, grounded := False, 
												visible := True, appearance := Nothing)



Parameter.UpdateAfterChange = True

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 3

kevin.dawson225WY
Participant
Participant
Many thanks for your help - really appreciated, it worked a treat.
0 Likes