Hi all,
This maybe quite basic however I don’t know how to achieve it in Python:
I have done a script which can add dimension from a point to a surface(closest distance from point to surface).
In rhino, when you try to add dimension you always have to defined a plane first, then the dimension will be on the plane however the AddAlignedDimension method in Python doesn’t seems require a plane. Is there any other method can add a dimension on a defined plane?
Or there is something missing in my script?
Here is my code:
import rhinoscriptsyntax as rs
pt_01 = rs.GetPoint(“Pick the Plane Origin”)
pt_02 = rs.GetPoint(“Pick the Plane X”)
pt_00 = (pt_01, pt_01)
srf = rs.GetObject(“Pick a Srf to pull”,8)
pt_03 = rs.PullPoints(srf, pt_00)
pt_03 = pt_03[0]
ln = rs.AddLine(pt_01,pt_03)
midPt = rs.EvaluateCurve(ln,0.5)
rs.DeleteObject(ln)
pln = rs.PlaneFromPoints(pt_01,pt_02,pt_03) #I wish it can dimension on this plane however it doesn’t
#rs.ViewCPlane(None, pln)
Dim = rs.AddAlignedDimension(pt_01,pt_03,midPt)
pt_01 = rs.AddPoint(pt_01)
pt_03 = rs.AddPoint(pt_03)
groupName = rs.AddGroup()
ids = (pt_01,pt_03,Dim)
rs.AddObjectsToGroup(ids,groupName)
Thank you in advance.
Jack