How to access the actual string in a TCollection_ExtendedString #214
Unanswered
felix673123
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everybody
I am trying to access the name of an assembly part that I have parsed from a .step file. I am using the same approach as shown in this blog entry: https://dev.opencascade.org/content/finding-name-assembly-part-step-file-using-xde. I am able to extract the TDataStd_Name attribute of the Labels, which contain a TCollection_ExtendedString object. When I try to access the information contained in the object by calling TCollection_ExtendedString.ToExtString() I run into a binding error: "Cannot call TCollection_ExtendedString.ToExtString due to unbound types: PKDs'"
I have also tried to access the string character by character using TCollection_ExtendedString.Value(), which also gives me a binding error.
Does anyone know a workaround for this problem ?
Thank you !
Here is a part of my code:
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);
Beta Was this translation helpful? Give feedback.
All reactions