API: Component is in Folder?

Discussion in 'SolidWorks' started by CS, Feb 17, 2005.

  1. CS

    CS Guest

    OK I tried the help but can't locate anything on determining if a component
    is in a folder or what components a folder contains. I tried to get the
    children of the folder but no luck.

    Corey.
     
    CS, Feb 17, 2005
    #1
  2. CS

    P. Guest

    Cory,

    If you do the API help traverse feature tree program you can see how
    folders are handled. There is a marker in the FMT you have to look for.
    Unfortunately there isn't a:

    b_ret = ModelDoc.IsInFolder
     
    P., Feb 17, 2005
    #2
  3. CS

    CS Guest

    By the way it seems to be my day for questions.
     
    CS, Feb 17, 2005
    #3
  4. One of the API sessions I sat in at SWW might offer a clue - I haven't
    checked it out. Earl said that when traversing the stuff, you will find a
    folder feature at the top & bottom of the stuff in the folder. So, I think
    that means to you that if you get to a folder feature before you get to your
    part, then it's in the folder. If not, then no. Maybe??

    WT
     
    Wayne Tiffany, Feb 17, 2005
    #4
  5. CS

    CS Guest

    That might be what pete was getting at. The extra info is appreciated it
    will make the work a bit easier.

    Corey
     
    CS, Feb 17, 2005
    #5
  6. CS

    P. Guest

    Paul, not Pete.

    It makes sense when you see it.
     
    P., Feb 17, 2005
    #6
  7. CS

    P. Guest

    Cory,

    Have a look at
    "Traversing Assembly at Component and Feature Levels Example (VB)" in
    the API help.

    When you run this against an assembly with a folder called Jacks you
    will get:

    Jacks [FtrFolder]
    Jack-1 [Reference]
    Jack-2 [Reference]
    Jack-3 [Reference]
    Jack-4 [Reference]
    Folder1___EndTag___ [FtrFolder]

    It should be obvious where the beginning and end of the folder are. So
    the only way to tell is to go through the list and see what is between
    the tags. It would be nice if the end tag refered to the start tag like
    Jack__EndTag__ .
     
    P., Feb 18, 2005
    #7
  8. CS

    P. Guest

    Cory,

    Have a look at
    "Traversing Assembly at Component and Feature Levels Example (VB)" in
    the API help.

    When you run this against an assembly with a folder called Jacks you
    will get:

    Jacks [FtrFolder]
    Jack-1 [Reference]
    Jack-2 [Reference]
    Jack-3 [Reference]
    Jack-4 [Reference]
    Folder1___EndTag___ [FtrFolder]

    It should be obvious where the beginning and end of the folder are. So
    the only way to tell is to go through the list and see what is between
    the tags. It would be nice if the end tag refered to the start tag like
    Jack__EndTag__ .
     
    P., Feb 18, 2005
    #8
  9. CS

    P. Guest

    And guess who asked the question originally. I sort of remembered that,
    but I didn't remember the detailed answers that you and Heikko gave.
    Thanks.
     
    P., Feb 20, 2005
    #9
  10. CS

    CS Guest

    Thanks guys. Sorry Philippe I normally follow most of the API threads and
    didn't recall that one. I guess I was being a bit lazy though it would have
    actually saved me a bit of time if I had been a good ngp and searched
    google.

    Corey
     
    CS, Feb 21, 2005
    #10
  11. CS

    P. Guest

    I just put my finger on some interesting behavior of folders.

    1. To get something into a folder you can have the folder open and just
    drag the feature up under the last feature in the folder.

    2. To automatically add parts to a folder on creation, open the folder
    and roll back to the last feature. New features will end up in the
    folder. This implies that rolling back to the last feature in a folder
    goes just past the end of folder marker suppressing it.
     
    P., Feb 21, 2005
    #11
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.