Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iPart.ChangeRow failure

9 REPLIES 9
Reply
Message 1 of 10
tom_wise
544 Views, 9 Replies

iPart.ChangeRow failure

Hello, it's been a while since I've logged in, but here is my issue.

 

We are trying to drive automated assemblies in Inventor using iLogic and iParts.  The iParts contain all the information to identify themselves in our MRP system. 

 

If I create just a single assembly, and add 1 iPart, the iLogic will change the component properly. 

(Example:  iPart.ChangeRow("BushingMtgPlate:1","492"))

This example line changes the main iPart to row using member name 492. 

 

If I add any component to the assembly, another iPart or a simple part, the iLogic rule states that there is no member row found for the part 492.

 

I must be missing something, but can anyone help?  I've got to string about 4-6 parts together this way and have them change according to the main part that is inserted later through an iTrigger of some sort.

9 REPLIES 9
Message 2 of 10
LOONYLEN
in reply to: tom_wise

Tom,

 

I think I could help you if I had some more information.

What drives your iPart to change to a certain member?

Are you using a form?

I'll send you a pack n go example that I have created and seems to work.

 

Len

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
Message 3 of 10
swordmaster
in reply to: tom_wise

Tom,

Have you "stabilized" the name of the component you are replacing (swapping out row members) in the Inventor model tree.

Most likely this is your issue

 

Inventor 2010 Certified Professional
Message 4 of 10
tom_wise
in reply to: swordmaster

I have attached the assembly with the three basic components. The information in the custom iProperties fields in the bushing (the 55...ipt part) will eventually pass it's information on to the plates below it, and the eventual attachment to a tank wall that isn't included here. I've attached the two iParts, assembly, and standard part for the example.

 

The first item I need to do is make an iLogic rule that will dictate to the plate and bushing what size they need to be from the iProperties of the bushing. The only thing I was trying to do first was create an iLogic rule to simply change the plate and bushing:

 

iPart.ChangeRow("BushingMtgPlate:1","491")
iPart.ChangeRow("BushingMtgPlateGasket:1","491-Gasket")


iLogicVb.UpdateWhenDone=True

 

Following this, I got the previous error if I try to change them again. Later on I found that the only way to do it is to open each part, regen all, save, regen all, and save again, then regen the main assembly, then it would work. That is not acceptable.

 

Eventually, I would have to get the "491" from the iProperties of the bushing and substitute that into the iPart.Changerow statement. This may be too much to bite on at first in one post, I do apologize for that.

 

- Version 2013, and I don't have a choice as to the part being substituted in the model as far as I know. I also cannot have the library components being changed later on. So the regen/save routine is also a no go.

 

Any Ideas? I'm considering trying to do a VBA program to do the selection routines and match mates by name. That seems to be the only way out I have right now.

Message 5 of 10
swordmaster
in reply to: tom_wise

"Following this, I got the previous error if I try to change them again"

you need to "stabilize" the name of the component  , otherwise the ilogic rule will work only the first time

Inventor 2010 Certified Professional
Message 6 of 10
tom_wise
in reply to: swordmaster

I don't know what is required to "stabilize" the assembly.  How would you go about doing that?

 

(Thanks for the responses all)

Message 7 of 10
swordmaster
in reply to: tom_wise

You must manually change the component name assigned in order to "stabilize" it so it will not change when the table configuration row is modified.

To do this find the component in the Inventor model tree panel, click on it twice (slowly) this will allow you to rename the component. Use the new name in your ilogic code

Inventor 2010 Certified Professional
Message 8 of 10
LOONYLEN
in reply to: tom_wise

Tom,

 

I believe Swordmaster is correct.

I'm still using Inventor 2012, so I wouldn't be able to open your assembly to check for myself.

This "Stabilizing" workflow must be followed in order for your iLogic code to operate correctly.

If you still do not understand what we're talking about, send me a private message and I'll help you further.

 

Len

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
Message 9 of 10
tom_wise
in reply to: LOONYLEN

I did rename it in the browser, but it still will not change the row a second time (or more) without the rebuild all / save option. 

I'm investigating another option to try to avoid the iPart designation.

Message 10 of 10
swordmaster
in reply to: tom_wise

This should work, there must be something wrong. Did you use the stabilized name in the ilogic code?

Did you generate the ipart members prior to running the replace code?

What ilogic error messages do you get?

Inventor 2010 Certified Professional

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

Post to forums  

Autodesk Design & Make Report