I basically recreated what you did, but when I write the code that you did @ 3:35 mark it gives me the following error: "iPart.CurrentRowValue("PipeOD"): This function was called without a previous call to iPart.ChangeRow or iPart.FindRow." What am I missing here?
+Craig Hayman Craig, The iPart.CurrentRowValue("PipeOD") function is to be used after an iPart.ChangeRow or Find Row because it does not have any arguments to identify which iPart in the assembly you might be using. In my video, I use iPart.ChangeRow to set the Pipe component to the correct iPart Member. Therefore, it knows to read that iPart table. Inventor assumes that you might have multiple iParts in your assembly. Are you using either of those functions in you rule? If you would be willing to share what you are working on, I would be willing to look it over. Steve
+itsaCADworld It is almost exactly what you have there. 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 and also one for the flange with the following members; 1. 126 2. 124 3. 124V 4. 122 5. 122V * they vary in OD, ID and length* 2. Created an Assembly and dropped the 1 X Casing iPart and 2 X Flange iPart 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 OD, ID, and length paramters then update all parts. I did exact;y what your code said ( I am very new to iLogic) and it gave me that error. Just for reference here is my code. iPart.ChangeRow("Master_Axial Fan_Casing:1", Model) Length = iPart.CurrentRowValue("Length") Inside Diameter = iPart.CurrentRowValue("ID") Outside Diameter = iPart.CurrentRowValue("OD")
+Craig Hayman I have been through your code several times, and rebuilt my code to make sure nothing has changed since I made the video. I cannot replicate the error you are getting. Are your Inside Diameter and Outside Diameter Parameter\Variables all one word, or is there a space.? Parameter\Variable names have to be one word, or use an under score between them. That may be your issue. I would also add Updates after the ChangeRow statement, and an Update when Done statement at the very end. InventorVb.DocumentUpdate() iLogicVb.UpdateWhenDone = True Hope this helps, Steve
+itsaCADworld All parameters are one word with an underscore connecting the words... Is there a way you can check my model and code? Maybe I am missing something here in the explanation that is key?
+Craig Hayman One more thing you can try before you send me the model is try restarting your PC. How iLogic works is that, the code you write is translated to an executable that sits in your temp directory. I have see scenarios, where users have made so many changes to their code that the executable gets screwed up and through strange errors. There are ways to get the executable to be regenerated, but I have seen that cause more trouble than good. So I typically restart Inventor, and possibly the PC to get the executable to regenerate. If that does not work, send me a message at steve.olson@mesa-cad.com. I will send you instructions on how to load the model to a ShareFile site. I can look the model and code over and let you know what I find. Steve
Hi how can you set the iPart "Pipe"'s name to just "Pipe". My iPart's member name always change so I cannot use the ChangeRow snippet because after each edit It always change.
How do i create a parameter with the units being "text"?
Manipulate the files in this way and very interesting.
I basically recreated what you did, but when I write the code that you did @ 3:35 mark it gives me the following error:
"iPart.CurrentRowValue("PipeOD"): This function was called without a previous call to iPart.ChangeRow or iPart.FindRow."
What am I missing here?
+Craig Hayman
Craig,
The iPart.CurrentRowValue("PipeOD") function is to be used after an iPart.ChangeRow or Find Row because it does not have any arguments to identify which iPart in the assembly you might be using.
In my video, I use iPart.ChangeRow to set the Pipe component to the correct iPart Member. Therefore, it knows to read that iPart table. Inventor assumes that you might have multiple iParts in your assembly.
Are you using either of those functions in you rule?
If you would be willing to share what you are working on, I would be willing to look it over.
Steve
+itsaCADworld
It is almost exactly what you have there.
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 and also one for the flange with the following members;
1. 126
2. 124
3. 124V
4. 122
5. 122V
* they vary in OD, ID and length*
2. Created an Assembly and dropped the 1 X Casing iPart and 2 X Flange iPart
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 OD, ID, and length paramters then update all parts.
I did exact;y what your code said ( I am very new to iLogic) and it gave me that error. Just for reference here is my code.
iPart.ChangeRow("Master_Axial Fan_Casing:1", Model)
Length = iPart.CurrentRowValue("Length")
Inside Diameter = iPart.CurrentRowValue("ID")
Outside Diameter = iPart.CurrentRowValue("OD")
+Craig Hayman
I have been through your code several times, and rebuilt my code to make sure nothing has changed since I made the video. I cannot replicate the error you are getting.
Are your Inside Diameter and Outside Diameter Parameter\Variables all one word, or is there a space.? Parameter\Variable names have to be one word, or use an under score between them. That may be your issue.
I would also add Updates after the ChangeRow statement, and an Update when Done statement at the very end.
InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True
Hope this helps,
Steve
+itsaCADworld
All parameters are one word with an underscore connecting the words...
Is there a way you can check my model and code? Maybe I am missing something here in the explanation that is key?
+Craig Hayman
One more thing you can try before you send me the model is try restarting your PC. How iLogic works is that, the code you write is translated to an executable that sits in your temp directory. I have see scenarios, where users have made so many changes to their code that the executable gets screwed up and through strange errors. There are ways to get the executable to be regenerated, but I have seen that cause more trouble than good. So I typically restart Inventor, and possibly the PC to get the executable to regenerate.
If that does not work, send me a message at steve.olson@mesa-cad.com. I will send you instructions on how to load the model to a ShareFile site. I can look the model and code over and let you know what I find.
Steve
Hi how can you set the iPart "Pipe"'s name to just "Pipe". My iPart's member name always change so I cannot use the ChangeRow snippet because after each edit It always change.
If you slowly double-click on the pipe in the browser, it should let you rename the browser node. Once you have done that, it should remain static.