API, select parent of child that has many parents?

I am trying to write a program that will allow the user to write some custom property data to an assembly document when the user graphically selects a component. The problem is that when the user selects the component they have of course selected the component not the assembly that the component resides in. And to further complicate the matter the component will have multiple parents.

Consider a standard desk and we have 50 of these desks with different people sitting at each desk. We would want to create 50 desk assemblies all referencing the same desk part file (so single child with 50 parents), the user while in sw will pick the desk, launch the program and input data that they want recorded to that particular desk assembly but I am not sure how via the API we can get a very specific parent for a child that has many parents.

Anyone have any suggesstions?

Thanks

Reply to
Sam
Loading thread data ...

Did you try the "Get Parent Component Example (VB)" in the SW API Help?

Ken

Reply to
Tin Man

Thanks Ken, I will take a look at that.

In the mean time I think I found another solution, our program is going allow the user to input some data and most of that data will be stored in custom properties and two pieces of that data will also populate some sketch annotations that reside in the assembly. If the user is trained to select the visible sketch annotation (which resides at the assembly level and which when selected means that the user has the assembly selected not the part file) then launch the program the program can just be coded to write the data directly to the selected component, which should be the assembly.

I wish I could find more of a "fail safe" way of doing this that is not dependent on the user. If the user selects the part file rather than the sketch there will be a problem.

Thanks

Reply to
Sam

You could do it easier through a PDM system like DBWorks

Reply to
harry

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.