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: 

iLogic connection from part to part

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
Mack_1979
1120 Views, 9 Replies

iLogic connection from part to part

 

Hello,
is there a way to connect parameters from part1 to part 2 using iLogic, without using an assembly.

 

Regards.

9 REPLIES 9
Message 2 of 10
cwhetten
in reply to: Mack_1979

It's possible using an explicit path and filename.  What are you trying to do?

 

-cwhetten

Message 3 of 10
Mack_1979
in reply to: cwhetten

I am trying to link parameter d0 from part1 to parameter d3 from part2. Both files are inside the same project. I want to understand the concept and to get the appropriate rules.

Message 4 of 10
cwhetten
in reply to: Mack_1979

This turned out to be trickier than I thought.  I have created and attached some example parts that show how to do this.

 

It basically involves opening the part in the background so you can get the value of the parameter.  There's some VBA-foo involved in getting this to work, but it's not too arcane.  Take a look at the iLogic rule in Part2.

 

The link between these parts is not live or automatic.  The only way they link up is when the iLogic rule runs.  The example parts are set up so that this is a manual process:

Step 1: Open Part1 and modify the d0 parameter.

Step 2: Close Part1.  Or don't.  It doesn't matter.

Step 3: Open Part2.  Manually run the iLogic rule (right-click on the rule and select Run).

Step 4: Watch the magic happen!

 

I'm sure there are things you could do to make this process more automatic, but I didn't get into that here.

 

I should have asked you before which version of Inventor you are using.  The parts I posted are version 2012, so hopefully you can open them.  If you can't, I can provide some screenshots or something.

 

Of course, in the iLogic code, you will have to change the file path to wherever your files are stored.  And if you are using parts named something other than Part1, you will have to change this in the code as well.

 

-cwhetten

Please click "Accept as Solution" if this response answers your question.

 

Message 5 of 10
Mack_1979
in reply to: cwhetten

This is exactly what I want.

I spend ours to find this code without success.

 

Thank you so much.

Message 6 of 10
VdVeek
in reply to: Mack_1979

Why not use the derive command? Open part1 select Derive on the model tab. Link to part2 and add the parameters you want to use in part1. In my example i linked Hoogte,Breedte,Diepte from my Radiator reference file to my "Part1".

Think this is a much easier way to link parameters.

Rob.

 

Derive.jpg

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 7 of 10
cwhetten
in reply to: VdVeek

That was going to be my next question.  Since the original post asked specifically about iLogic, I assumed that the poster knew about deriving, but determined that this approach wouldn't work.  But I realize that this is just an assumption.

 

I agree with Rob--deriving is the best way to go.  The iLogic link suffers from not being either live or automatic, but deriving would take care of this problem.

 

-cwhetten

Message 8 of 10
Mack_1979
in reply to: cwhetten

 

Cwhetten,

is there a chance to change the code so it search for the part1 in the active project. Part1 is a unique name.

 

Regards

Message 9 of 10
cwhetten
in reply to: Mack_1979

Yes, it is possible.  Of course, this only works if the filename is unique.

 

To do what you want, remove the following line:

 

    linkedDocPath = "D:\EgyptLand\TEMPORARY\"

 

Then, replace the following line:

 

    linkedDocPathAndName = linkedDocPath & linkedDocFilename

with the following two lines:

 

    oActiveProjectPath = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
    linkedDocPathAndName = ThisApplication.DesignProjectManager.ResolveFile(oActiveProjectPath, linkedDocFilename)

That should do it.

 

-cwhetten

Message 10 of 10
Mack_1979
in reply to: cwhetten

Yes this is it.
I can't find the words that explain how much I am grateful.

 

Thank you very much.

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

Post to forums  

Autodesk Design & Make Report