[C API] How to get the curve's name/label

Hi experts,

I’d like to know if I could find API to get curve’s name/label.

Refering to component, I could get component name by SUComponentDefinitionGetName(), so are there any APIs to get name for curve?

Curve (and therefore ArcCurve) objects do not have a name property.

You could wrap the curve up in a group and get it’s name if it has one assigned.

Be aware that definition name property is separate then any of it’s instance name properties.

Or you could attach an attribute dictionary to the curve object, and give the dictionary a “name” attribute with some text value. (Just make sure that your dictionary itself has a unique name. Usually a combination of your company namespace and the name of the plugin.)

We’ve covered attribute dictionaries with the C API in other topics here …

Get dynamic component attribute from SUGroup - #6 by DanRathbun


C API Docs …

1 Like

Thank you very much, it is clear to me now.

You have a model with a Text label pointing to a Curve?

You can use SUTextGetPoint to get an SUInstancePathRef and see if it refer to an edge in a curve.