API, select parent of child that has many parents?

Discussion in 'SolidWorks' started by Sam, Apr 1, 2008.

  1. Sam

    Sam Guest

    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
     
    Sam, Apr 1, 2008
    #1
  2. Sam

    Tin Man Guest

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

    Ken
     
    Tin Man, Apr 2, 2008
    #2
  3. Sam

    Sam Guest

    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
     
    Sam, Apr 2, 2008
    #3
  4. Sam

    harry Guest

    You could do it easier through a PDM system like DBWorks
     
    harry, Apr 3, 2008
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.