Linking Virtual component iProperties to a real Parts iProperties

Linking Virtual component iProperties to a real Parts iProperties

will_roe
Enthusiast Enthusiast
913 Views
5 Replies
Message 1 of 6

Linking Virtual component iProperties to a real Parts iProperties

will_roe
Enthusiast
Enthusiast

Hi,

 

Due to complicated workflow I'm wondering if it's possible to have a virtual component to use the iProperties of real part and keep them linked so if the real parts iProperties change the virtual component will update?  Preferably with ilogic or maybe a linking parameter work around?

 

Cheers,

 

Will

0 Likes
Accepted solutions (2)
914 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

 

You can use the ilogic snippet with the occurrence name.

 

iProperties.Value(virtOcc.Name, "Project", "Part Number")=

iProperties.Value(PartOcc.Name, "Project", "Part Number")

 

 

 

https://forums.autodesk.com/t5/inventor-customization/ilogic-custom-iproperties-amp-virtual-componen...


or use the API if you need more access. .

https://forums.autodesk.com/t5/inventor-customization/vb-net-plugin-how-to-change-iproperties-for-vi...

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

will_roe
Enthusiast
Enthusiast

I tried working through the below defining everything but couldn't get it work . I'm not sure if this would solve my problem either, because I need it to update every time the actual part updates. I think the easiest approach would be to get it to equal a linked parameter-

 

Sort of like this-

 

Properties.Value(Test:1, "Project", "Part Number")= P_N

 

But how do I get it to find "Test:1"?

 

Cheers.

0 Likes
Message 4 of 6

A.Acheson
Mentor
Mentor
Accepted solution

The iproperty should work and you can have thus rule in the part and have an on iproperty change event trigger. This way if the iproperty changes the rule runs and  does the update. You can test it on a string value to ensure it works first and then bring in the parameters etc.

When you say get it to find “Test:1” What do you mean by that? This is the occurence name you have given to the part in the assembly correct? If you put the occurrence name in it should work. I can run this tomorrow to check. If it doesn’t work for you, post the screenshot of the browser and the code also. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 6

A.Acheson
Mentor
Mentor
Accepted solution

The event trigger on iproperty change will not help much in this case as this references the assembly document the rule is run from and not the part where the change has happened. I have used the on save event trigger as you will likely save your work and at this point the  part iproperties will equal virtual iproperties. See attached image. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 6 of 6

will_roe
Enthusiast
Enthusiast

Sorry for the late reply Alan, I finally made my way back around to this.

 

Thank you for your help

 

 I built a proper test model. Tried it and it runs perfectly now - no idea why it was working originally.

 

Just for some context the attached is what I was trying to achieve. It's a weird work flow but seems like the best option for keeping everything linked.

 

iProperties.Value("VIRT TEST - VIRT BOLT KIT:1", "Project", "Part Number") = iProperties.Value("VIRT TEST - BOLT KIT:1", "Project", "Part Number")

iProperties.Value("VIRT TEST - VIRT BOLT KIT:1", "Project", "Stock Number") = iProperties.Value("VIRT TEST - BOLT KIT:1", "Project", "Stock Number")

 

 

0 Likes