any suggestions how is can turn the string of a plane object into an actual plan object again?
import rhinoscriptsyntax as rs
objects = rs.GetObjects(message="Select polysurface ", filter=16, preselect=False, select=False,)
for obj in objects:
box = rs.BoundingBox(obj)
plane = rs.PlaneFromPoints(box[0], box[1], box[4])
rs.SetUserText(obj, "plane", plane)
for obj in objects:
string = rs.GetUserText(obj, "plane")
#What is the easiest way to turn the string into an actuall plane object?
Actually, I found a little issue in the code that results into strange planes. In some cases, the numbers in the plane will include mathematical notation with E. Since \d filters out all characters, the exponent will be returned as an independent number as well. I don’t really understand all the functions of the re library, so this is my solution for the problem for now:
Why dont you just define all the neccesary data of a plane as a JObject (Json) and then you dont have to ideal with the pain of trying to do what you are attemprting? Json syntax is very robust and used everywhere.