我测试的时候是以单个文字为例,多个的时候可能需要改下代码,请您尝试右击GHpython电池的x并选择List Access, 然后将代码替换为以下代码:
import rhinoscriptsyntax as rs
import Rhino
text = []
location = []
for i in range(0,len(x),1):
obj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(x[i])
text.append(obj.DisplayText)
location.append(obj.Geometry.GetBoundingBox(0).Center)