Page 1 of 1

Get Legend Item Values of a Diagram Element

PostPosted: Thu May 16, 2019 2:13 pm
I currently have a diagram which contains a bunch of parts, ports, and connections. I have a custom legend that I bring into the diagram, and I apply each Part with a particular legend item so that it changes its color to that Legend item (by right clicking->Legend Item->check the right item).
My question is, how to I get that Legend Item value from a selected Part element? For example, if I had a Legend with a list of colors mapped to vehicle types (e.g. Sedan, Truck, Van, etc.), and I have a Part in a diagram that had the "Truck" Legend Item applied to it, how do I grab that "Truck" value from the Part using the MD OpenAPI? I assumed there was some list of properties to look at when you grabbed the Part as a PresentationElement, but I haven't found where the Legend Item information is stored. Any help will be greatly appreciated. Thanks!