Transfer Stock Number from Base to Derived Part

Transfer Stock Number from Base to Derived Part

Anonymous
Not applicable
336 Views
1 Reply
Message 1 of 2

Transfer Stock Number from Base to Derived Part

Anonymous
Not applicable

(Re-post from Inventor General Discussion)

 

Good day,

I am trying to model a process where we buy a flanged tank head, cut it in two, and form the cut edge. I need two models to do this: one that specifies the type of head we need (makes a print which goes to vendor), and another to show our shop's modification. I want to be able to reference the "blank" head in the modified version by transfering the Stock Number field from the base to the derived part. There is a thread on here that uses iLogic to tranfer properties from a derived part to the base, but I want to go the other way. My style of programming is basically cherry-picking and tweaking code to get a frankenstein of a rule that does what I want -- so I need help.

 

Text parameters will not get tranferred from the base.

I have been unable to link text paramters, probably different way of trying the above.

I have tried to extract the file name of the base and access the parameters that way. There just seems to be no back door!

 

Given the number of Google searches I have performed, I am reasonably certain that this is a unique topic. PLEASE send me to it if I'm wrong.

 

Ultimately what I want to do is paste a rule into a derived part which reaches down into the base, pulls out the Stock Number, and places it into the derived part. I have a feeling it is three simple lines of code that I just can't figure out. I am using Autodesk Inventor Professional 2015.

 

Best Regards,

Giordanik

0 Likes
337 Views
1 Reply
Reply (1)
Message 2 of 2

NSBowser
Advocate
Advocate

I give you major credit for knowing this is only 3 lines of code!

 

 

    oDoc = ThisApplication.ActiveDocument
    oRefDoc = oDoc.ReferencedDocuments.Item(1)
    iProperties.Value("Project", "Stock Number") = _
iProperties.Value(oRefDoc.DisplayName, "Project", "Stock Number")

 

There are a number of assumptions here (doesn't check for document type, assumes only referenced document of derived part is base, etc.) but it works given those assuptions are true, if they arn't some additional logic may be required.


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.