I have a question for you all, I have a sheet metal part that I converted into an iPart and I set up different rows with different sheet metal styles. What I want to do is run an iLogic code to change to a specific row which in turn would change the actual material of that sheet metal part....I've tried the snippet iPart.ChangeRow but cannot get it to run the code. I'm not sure if I'm not doing something right or what...Any help is greatly appreciated..Thanks
ipart.ChangeRow
is the command your need to use.
Did you "stabalize" the component name? If not it will not work.
If you do not know what i mean by "stabalize" i can go into more detail
Inventor 2009,windows xp 32 bit, excel 2000
I've seen "stabalize" in other threads and I'm not quite sure what it means, if you could go into detail that would be awesome, Thank you
Okay here goes,
If you look at the ilogic code snippet for ipartchangerow it looks like
iPart.ChangeRow("iChangedComponentName:1","rowName")
"iChangedComponentName" IS what i mean by the stabilized name
Consider the following code
If myparameter = 1 then
iPart.ChangeRow("PART_A:1","my first ipart row")
else if myparameter = 2 then
iPart.ChangeRow("PART_A:1","my second ipart row")
end if
So with "myparameter" = 1 the ipart row is updated and you will see the member name in the Inventor browser
Now if you change "myparameter" to equal 2 you would think that the second ipartchangerow code would change.........IT DOES NOT
This is because it is looking for PART_A but you already changed out PART A with another member.....make sense?
So what you need to do is "stabilize" the name of the occurence in the Inventor browser. So i would find PART_A in the browser click on it once to highlight it (pause a little) then click on it again , this allows you to rename it.
So i change the name to "stabilized_part"
The final code looks like this
If myparameter = 1 then
iPart.ChangeRow("stabilized_part","my first ipart row")
else if myparameter = 2 then
iPart.ChangeRow("stabilized_part","my second ipart row")
end if
hope this helps
mrattray,
Yes this is sort of a template, We are attempting to automate our sheet metal product and depending on customer specs we want to change material "on the fly" while also chaging the dimensions of the product. We are also running the entire product though a form so i want one of the inputs to be material. My manager and I discussed the possibility of creating a table in the part with the different sheet metal styles and running them from an assembly that way a parameter could be linked back to the part to change the row and ultimatly change the sheet metal material .
swordmaster,
I tried to change the part name but I got error messages.
I strongly recommend that instead of using iParts you use some other sort of means of managing your sheetmetal styles. I have all of my sheetmetal data loaded into an iLogic rule that allows me to configure based on a form. It works awesome.
Is there anyway you could show me how to set that up? I've never been one for writing code and almost all my iLogic knowledge is based off of forums and discussion groups lol
That's the same place mine came from, plus a lot of trial and error. Especially error.
Most of that code just has to do with concocting data for our ERP system and setting up bend allowances.
Just start off simple and build from that. Start with the material. I have a multi-value user parameter set up with all of the material types we use. By material here, I just mean CRS, 304 SS, etc., not thicknesses. I then added that parameter to my form and handled the actual changing with a simple one liner:
iProperties.Material = matl
( Where matl is the name of the multi-value user parameter I set up)
Thickness is even easier to handle. Just add the sheetmetal parameter Thickness to your form. When you change it in your form it will automatically change in the part. If certain materials are only available in certain Thicknesses you can write code to enforce its usage.
The only problem that arises from that is I have alot of different material type that are the same thickness and certain machines can only do certain bend radiuses with said certain material. So your method would work I would just have to do the code for each aspect of each custom sheet metal rule we have sheet metal rule. And we just dissproved the iPart experiment, you can change material on the fly but now all parameters for that specific part are relabled as linked and cannot be adjusted with iLogic from the assembly
It sounds like it may be a lot of coding for you. Have you experimented with linking an Excel file?
Hi
Hope I didn't get it wrong, you can try the iPart.FindRow, which will look up the parameter in iPart factory. Attached please find a sample I made. Noticed that we didn't add the extension (.ipt) in the rule.
I created two different style in the sheetmetal iPart which varies from its thickness, if you would like to share your sample I can look at it. you can send it to my email jingyiDOTliuATautodeskDOTcom.
i = iPart.FindRow("Test iLogic and Sheetmetal-iPart:1", "SheetMetalRule", "=", Thickness)
Hello everyone,
i am having a similar problem:
i want to create an Sheet Metal Ipart to publish on Content Center later and insert diferents sheet metal with diferents thicnesses on Assembly.
But i'm having problems creating the ipart table whit diferents thicknesses and diferents sheet metal rules...The diferent iparts created doesnt change its thickness like i entered on the ipart table.
I hope you can help me!
I'm using Inventor Autodesk 2011
Attached example file.
By 'stabilize' it simply means to rename the iPart in the browser to some common name. So rather than the iPart member name listed it is something more generic. Then you use that generic name in the FindRow Snippet.
iRow = iPart.FindRow("GenericName", "Column1Name", "=", Pump_Model,"Frame","=", Left(Motor_Frame,3)+"JM")
Can't find what you're looking for? Ask the community or share your knowledge.