Content Center Category

Content Center Category

JoAntt
Enthusiast Enthusiast
532 Views
6 Replies
Message 1 of 7

Content Center Category

JoAntt
Enthusiast
Enthusiast


From a ContentCenter Part i need to know witch category (in this case Bolts)
it belongs to.

 

Fasteners
        --> Bolts
Any ideas on how to do that?

 

' a couple of examples im working from.

ContentFamily = oContentCenter.GetContentObject("v3#" & propSet("FamilyId").Value & "#")
'------
oContentTableRow = oContentCenter.GetContentObject("v3#" & propSet("FamilyId").Value & "#" & propSet("MemberId").Value)
'----
Dim oContentNode As ContentTreeViewNode = oContentCenter.TreeViewTopNode
For Each oChild As ContentTreeViewNode In oContentNode.ChildNodes
    Debug.Print(oChild.DisplayName)
      For Each oChildd As ContentTreeViewNode In oChild.ChildNodes
        Debug.Print("CHild - " & oChildd.DisplayName)
      Next
Next

 

0 Likes
Accepted solutions (1)
533 Views
6 Replies
Replies (6)
Message 2 of 7

A.Acheson
Mentor
Mentor

You can retrieve the path from the tree node

using this found here.

Syntax

ContentTreeViewNode.FullTreeViewPath() As String

 

Alternatively  if you just wan the top level you will need to go in higher up an iterate down. This VBA sample here  shows how to place a part and shows how the structure is made up. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 7

JoAntt
Enthusiast
Enthusiast

Yes, and no.

I have no problem understanding the category structure, and getting all categorys from top and down.

The problem is that i dont know the category the part is in, it just a part from contentcenter and i have to

get its category structure from the part up.

 

 it dosnt help that i can get all categorys from top level as long as i dont have anything from the part to compare with.

in a perfect world it would look like this.

ThePartDoc.FullTreeViewPath

 

<

0 Likes
Message 4 of 7

jjstr8
Collaborator
Collaborator

There's an additional property set called "Content Library Component Properties", but it looks like you'll only get family information from there.  There's another property in "Design Tracking Properties" called "Categories" that contains member definition information.  It's in XML format, but the category path can be deciphered from it with some work.

0 Likes
Message 5 of 7

A.Acheson
Mentor
Mentor

@JoAntt 

Are you looking to replace an occurrence within an assembly or is there more to display information? I use a function to replace member based on a cell value  in the table if that helps you I can post it later. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 6 of 7

JoAntt
Enthusiast
Enthusiast
Accepted solution

Ok, this i how it is, it cant be done.

There is no way to backtrack a contentcenter part to its catregory without knowing more than just what the part can provide.

But thank you all anyway!

0 Likes
Message 7 of 7

jjstr8
Collaborator
Collaborator

Maybe I'm misunderstanding what you're looking for, but it seems like the information is there.  Here's the XML data cleaned up a bit in VS.

 

jjstr8_0-1643752951616.png

 

0 Likes