Get The Names of Folders in the Design Tree with SW Document Manager or Quick View?

Hi, everyone?
Is it possible to extract folder names in Large Design Review with Solidworks api? or can it be done with document manager api?
I want to open the assembly without resolve it(review mode)

1 Like

With the API, it looks like traversing the feature tree gets the names of the objects, but it doesn’t return the actual object itself with the TreeControlItem. Without that, there’s not a way I can see to get the feature’s TypeName. I’m not sure it’s possible with methods I can think of.

Additionally, with the Document Manager, I don’t see any methods to get feature tree information but I’m new to working with the Doc Manager API it so take that with a grain of salt

I take only the main level features of the assembly and do it in quick view. I also need to get the main level folder contents. I don’t want to access the in-depth feature tree, that slows it down too much.

I think you have missed this:

And this

The objects might be null because the model might be not entirely loaded in memory.

Unfortunately, when loaded in Large Design Review mode, the TreeControlItem object that is returned is null. It doesn’t seem to load it into memory until the assembly is resolved further. See below for the output of the same code run on both Large Design Review and Resolved

LDR Mode:


Yup. That’s what I thought. I also think that you need to get a new instance of TreeControlItem. The old instance might be completely useless.

A lot of API objects do not implement dependency properties (properties that self-update). Most of them are constructed through some sort of factory pattern.

I could be wrong but definitely worth verifying. I know this is a fact for the position of annotations.

I also tried with selectionmanager. I said that the ones that cannot be selected in treenodeitem are parts or non-assembly elements, but it is very slow and the element remains outside the folder.

I would be very very surprised if you could actually read the tree exactly as it shows up in the FeatureTree in SOLIDWORKS via the document manager.

That’s probably too proprietary to share via the document manager.

Hi @AmenJlili, thanks for post.
Maybe there is no way, but I need to keep researching and trying a little more.

1 Like

Always a good idea to reach out to for confirmation.

1 Like