In SpaceClaim, how can I extract the length of an edge and export this information to an external file?
The following code can be adapted. The first edge of the first body in the tree is measured and the value is saved in a dictionary. This dictionary is then dumped to a json file.
import os import io import json filePath = os.path.join(r"D:\Test","demo_export.json") bodies = GetRootPart().GetAllBodies() my_body = bodies[0] my_edge = my_body.Edges[0] my_length = my_edge.Shape.Length my_dict = { "my edge length" : my_length } with io.open(filePath, "w", encoding="utf8") as json_file: json.dump(my_dict, json_file, ensure_ascii=False)