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.
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.
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
By the way it seems to be my day for questions.
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
That might be what pete was getting at. The extra info is appreciated it will make the work a bit easier.
Corey
Paul, not Pete.
It makes sense when you see it.
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__ .
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__ .
Don't forget to search the archives in this group before asking a question. This topic has been discussed ealier. You'll even find some useful code... Have a look at
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.
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
I just put my finger on some interesting behavior of folders.
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.