Jump to content

iLogic problem


PunkR0ckz

Recommended Posts

Hi guys, I've been working on this project for the past 2 months and everything was going smoothly till now. My project consists of multiple conveyors and there are some subassembly that can be there more than once and I need to use iLogic code.

 

I am able to use the Component.Replace function to replace a subassembly by another one properly.

My problem is how Inventor deals with part's/subassembly's name in the treelist.

 

Example of my problem:

I have 5 subassembly in my main assembly: Conveyor End:1, Conveyor Line:1, Conveyor Line:2, Conveyor Motor:1, Conveyor End:2

If my "zone" = 4, I want this to be; Conveyor End:1, Conveyor Bladder:1, Conveyor Line:1, Conveyor Motor:1, Conveyor End:2

If my "zone" = 3, I want this to be; Conveyor End:1, Conveyor Motor:1, Conveyor Line:1, Conveyor Motor:2, Conveyor End:2

 

If I use the Component.Replace line, I will be able to change my main ass'y Conveyor Line:1 by Conveyor Bladder:1 and by Conveyor Motor:1, but if I want to change my zones again, it will not work since there would be Conveyor Motor:2 instead of Conveyor Motor:1 and vice-versa in the treelist.

 

If someone has a simple solution to this problem, any ideas would be welcome!

 

Note: I am a big newbie with iCodes (second day using it, first project!)

Note 2: A sample of my iCode has been attached to this post, to show How I would like it to work.

Replacement of a part.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...