Hello,
is there a way to connect parameters from part1 to part 2 using iLogic, without using an assembly.
Regards.
Solved! Go to Solution.
Solved by cwhetten. Go to Solution.
Solved by cwhetten. Go to Solution.
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.
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.
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.
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
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
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