iPart and iLogic Error

iPart and iLogic Error

chayman
Enthusiast Enthusiast
380 Views
1 Reply
Message 1 of 2

iPart and iLogic Error

chayman
Enthusiast
Enthusiast

Hey guys,

 

I am creating a axial fan assembly with a casing and 2 flanges on both sides. However, the casing and flange (diameter & length) will change depending what model I selected. Our company has over 50+ models so I thought using iParts was the best route to go. Here is what I have done so far:

 

1. I created an iPart for the fan casing (12 in) with the following members; 126, 124, 124V, 122 and 122V

           * they vary in Diameter and length*

 

2. Created an Assembly and dropped the 1 X Casing iPart and 2 X Flange 

 

3. Created a user parameter in the assembly called "Model". This would allow me to select one of my fan models.

 

4. Created an iLogic ruled named "Fan Size". What I want this to do is find the model I select in the iPart Table (for example 126) and grab the dimensions for it's given Diameter and Length. 

 

I keep getting this error message: 

 

Error in rule: Fan Size, in document: Master_Axial Fan_Template.iam

iPart.CurrentRowValue("Length"): This function was called without a previous call to iPart.ChangeRow or iPart.FindRow.

 

Is there a reason why my code isn't working?

 

SyntaxEditor Code Snippet

iPart.ChangeRow("Master_Axial Fan_Casing:1", Model)
Length = iPart.CurrentRowValue("Length")
Diameter = iPart.CurrentRowValue("Diameter")

iLogicVb.UpdateWhenDone = True

 Please see attached models for your reference.

0 Likes
381 Views
1 Reply
Reply (1)
Message 2 of 2

NSBowser
Advocate
Advocate

Chayman,

 

ChangeRow requires the Row Member by name to select the row and errors at subsequent lookups if it couldn't change the row successfully. I might suggest using FindRow and find the column which matches the value of 'Model'. It will return an 'i' value which will = -1 if it fails to find one, you can check if i = -1 then return a message the row wasn't found. Otherwise it will find AND change the row for you to then follow with subsequent Lookups.


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes