not really… because it places the dimension always on the cplane and also i need to rotate cplane in order to use z values, as “z-datum” doe not exist.
I would like to evaluatePT any 3d point and drawing a label just showing absolute Z-value
in order to draw the leader and its text, a plane (or CPlane) would be required. I´m wondering if it would help you to have a command which asks for a point, then gets the Z-Coordinate from it and lets you draw a line. At the end of the line it would then draw a TextDot which you can freely move around and convert to text. (The content would remain static while you move it) ?
thanks for your suggestion!
below is the output from revit which I am trying to mimic.
so I thought a leader would be a good idea, although the text would always be in the line not above. Using a dim-style leaves some flexibility concerning later output adjustments.
I get you idea and it would basically do the right thing, although a function that “pastes” the z.coordinate into a leader text-field automatically would be even better I believe.
The good thing is that it then uses the text size and plane from the leader. Below script takes the z-value of the leader tip coordinate and pastes it in the text field.
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def leader_filter(rhino_object, geometry, component_index):
return isinstance(geometry, Rhino.Geometry.Leader)
def LeaderTextToZ(digits=3):
leader_id = rs.GetObject("select a leader", 0, True, False, leader_filter)
if not leader_id: return
leader = rs.coercerhinoobject(leader_id, True, True)
plane = leader.Geometry.Plane.Origin
value = round(plane.Z, digits)
leader.Geometry.Text = str(value)
leader.CommitChanges()
scriptcontext.doc.Views.Redraw()
if __name__=="__main__":
LeaderTextToZ(digits=3)
you can set the number of digits after the decimal point in the last line if the script.
I am also quite interested in this function. But I have no idea how to get this to work in Rhino. Is it perhaps possible to explain a little bit more? Do I make a textfile? Where do I save it and etc. I have no clue of Pyton or what so ever. Lets say alittle bit more plugandplay
To use the python script that Clement posted, save the py file to your disk somewhere, create a leader, use the RunPythonScript command and pick the file that you saved, then select the leader that you created.
-wim