API: Find "Where used"

Discussion in 'SolidWorks' started by TV, Dec 21, 2004.

  1. TV

    TV Guest

    I need to make a "clean up" routine, that finds all components NOT
    used by a particular assembly. I plan to traverse through a folder
    (and subfolders) and for each part or assembly detect if it is used by
    my main assembly. But I need some API like the Where Used in
    SW-Explorer or mayby a direct call to the SW-Explorer objects.
    Alternatively I can traverse through my main assembly but I am out of
    luck when some components are suppressed. It would be OK if I just
    could list ALL components in the feature tree.
    Any idea? I hope I make my self clear.

    Thanks in advance.

    Thomas
     
    TV, Dec 21, 2004
    #1
  2. TV

    CS Guest

    Ok I thought that a few months back on the API help for 2004 I saw some new
    tools that gave you Windows Explorer like capabilities. Including Where
    Used. After looking, and being frustrated that I can't find it again. I
    only found that there are 2 functions one is Sldworks::SaveAs and it allows
    you to update a list of files with the new file name I can't remember what
    the other was but it was similar. I swear that there was another tool that
    you needed to use in conjunction with it to find out what files needed to be
    updated, but for the life of me I can't find it. Sorry! Anyone else know
    where to look in the help to find this function.

    Corey
     
    CS, Dec 23, 2004
    #2
  3. Were you thinking of SWAPP.ReplaceReferencedDocument? I use it a bunch to
    point a file to a new file.

    Evan
     
    Evan T. Basalik, Dec 27, 2004
    #3
  4. TV

    Mark Reimer Guest

    I am using ModelDoc2.GetDependencies2 for just this purpose. It will give
    you all depencencies including suppressed components in the assembly. Refer
    to the "Remarks" area in the help page for this command to see how
    suppressed componsnts are handled.

    --Mark
     
    Mark Reimer, Dec 28, 2004
    #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.