Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using iLogic to change an iPart row?

14 REPLIES 14
Reply
Message 1 of 15
rdiamond113
5312 Views, 14 Replies

Using iLogic to change an iPart row?

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 

 

Product Design Suite 2015, Windows 7, 64 bit

"Pushing the envelope, just to watch it bend"
14 REPLIES 14
Message 2 of 15
swordmaster
in reply to: rdiamond113

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

Inventor 2010 Certified Professional
Message 3 of 15
rdiamond113
in reply to: swordmaster

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

Product Design Suite 2015, Windows 7, 64 bit

"Pushing the envelope, just to watch it bend"
Message 4 of 15
swordmaster
in reply to: rdiamond113

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

 

Inventor 2010 Certified Professional
Message 5 of 15
mrattray
in reply to: rdiamond113

Is this for a template?

Mike (not Matt) Rattray

Message 6 of 15
rdiamond113
in reply to: mrattray

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.

Product Design Suite 2015, Windows 7, 64 bit

"Pushing the envelope, just to watch it bend"
Message 7 of 15
mrattray
in reply to: rdiamond113

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.

Mike (not Matt) Rattray

Message 8 of 15
rdiamond113
in reply to: mrattray

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

Product Design Suite 2015, Windows 7, 64 bit

"Pushing the envelope, just to watch it bend"
Message 9 of 15
mrattray
in reply to: rdiamond113

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.

Mike (not Matt) Rattray

Message 10 of 15
rdiamond113
in reply to: mrattray

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 

Product Design Suite 2015, Windows 7, 64 bit

"Pushing the envelope, just to watch it bend"
Message 11 of 15
mrattray
in reply to: rdiamond113

It sounds like it may be a lot of coding for you. Have you experimented with linking an Excel file?

Mike (not Matt) Rattray

Message 12 of 15
jingyi.liu
in reply to: rdiamond113

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)


Jingyi Liu

Inventor Product Manager
Tags (1)
Message 13 of 15
Javiersecco
in reply to: jingyi.liu

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.

Message 14 of 15
Mcadae
in reply to: swordmaster

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")
Erik J. Kurek
MCADAE, ICE, MICE
Manufacturing SME
Inventor 2013

Dell Precision WorkStation T3500
Bus Clock: 4800 megahertz
2.40 gigahertz Intel Xeon
8192 Megabytes Installed Memory
Windows 7 Professional (x64) Service Pack 1
NVIDIA Quadro FX 3700
Message 15 of 15
Mcadae
in reply to: Javiersecco

See my explanation:

http://forums.autodesk.com/t5/Inventor-General/Using-iLogic-to-change-an-iPart-row/m-p/4552003#M4864...

 

 

Erik J. Kurek
MCADAE, ICE, MICE
Manufacturing SME
Inventor 2013

Dell Precision WorkStation T3500
Bus Clock: 4800 megahertz
2.40 gigahertz Intel Xeon
8192 Megabytes Installed Memory
Windows 7 Professional (x64) Service Pack 1
NVIDIA Quadro FX 3700

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report