I am currently attempting to retrieve the name of an assembly part that I have extracted from a .step file. My method is inspired by a blog post found at , however, I am implementing it using javascript. I have managed to extract the TDataStd_Name attribute of the Labels, which contains a TCollection_ExtendedString object:
assembly.GetShapes(labels);
var freeShape = labels.First();
var components = new oc.TDF_LabelSequence_1();
oc.XCAFDoc_ShapeTool.GetComponents(freeShape, components, true);
var compLabel = components.First();
var name = new oc.Handle_TDF_Attribute_1();
compLabel.FindAttribute_1(oc.TDataStd_Name.GetID(), name);
var TCollection_ExtendedString = name.get().Get();
// this fails:
const nameString = TCollection_ExtendedString.ToExtString();
const nameChar =TCollection_ExtendedString.Value(0);
However, when attempting to access the information within the object through TCollection_ExtendedString.ToExtString(), I encounter a binding error: "Cannot call TCollection_ExtendedString.ToExtString due to unbound types: PKDs'" I have also tried accessing the string character by character using TCollection_ExtendedString.Value(), which resulted in another binding error. Does anyone have a solution or workaround for this issue? Thank you!