Coordinate label RHINO 6

Hello.

Is there a way to make a label which is bonded to a point. which shows coordinate x, y, z.
I can easily make it in grasshopper but after baking it the binding of course is gone.
Somthing like a dynamic block in A-CAD.


thanks.

Hi -

In Rhino 7, you can use the PointCoordinate text field.
-wim

thanks.

Sorry Rhino 6.

i got this, but it does it with text dots :expressionless: i’ll dig a little more but someone probably has a better script for your purposes

Option Explicit


Call CalloutDotXYZ()
Sub CalloutDotXYZ()
	Dim strObject, arrPointEnd, arrPointStart, strPointStart, intStyle, arrPline

	arrPline = Rhino.GetPolyline

	If IsArray(arrPline) Then

		strObject = Rhino.AddPolyline(arrPline) 
	Else Exit Sub

	End If
	
	'strCallout = Rhino.StringBox("Enter text for callout:",, "Callout Text.")
	
	If Rhino.IsCurve(strObject) Then
	
		arrPointEnd = Rhino.CurveEndPoint(strObject)
		arrPointStart = Rhino.CurveStartPoint(strObject)
		
		strPointStart = Rhino.Pt2Str(arrPointStart, 3)
		
		Rhino.AddTextDot strPointStart, arrPointEnd
		'Rhino.AddTextDot strCallout, arrPoint
			
	End If
	
	If Rhino.CurveArrows(strObject) <> 1 Then

		Rhino.CurveArrows strObject, 1

	End If
	
End Sub

this one is closer. i’m not that good at scripting so i’m not sure how to change it to have the equals sign.

Option Explicit
'Script written by <insert name>
'Script copyrighted by <insert company name>
'Script version Tuesday, March 2, 2021 12:29:50 PM
Call xyzLeader
Sub xyzLeader

	Dim arrPoint ,tokens ,token ,preView ,curView ,arrPlane ,preArrPlane, arrPoints

	preView = Rhino.CurrentView

	preArrPlane = Rhino.ViewCPlane(preView) 

	curView = Rhino.CurrentView

	arrPoints = Rhino.GetPoints(True, False, "Select leader point")

	If IsArray(arrPoints) Then

		arrPlane = Rhino.ViewCPlane(curView) 
		arrPlane(0) = arrPoints(0)
		Rhino.ViewCplane curView, arrPlane 

		tokens = Rhino.Strtok(Rhino.Pt2Str(arrPoints(0), Rhino.DimStyleLinearPrecision(Rhino.CurrentDimStyle)), ",")

		Rhino.AddLeader arrPoints, curView, "X " & tokens(0) & VbCrLf & "Y " & tokens(1) & VbCrLf & "Z " & tokens(2)

	End If

	Rhino.ViewCplane curView, preArrPlane

End Sub

i’ll even throw in my custom icon :wink:

XYZ LEADER

@kleerkoat - in case this helps -

Option Explicit

Call xyzLeader

Sub xyzLeader
	Dim id: id = Rhino.GetObject("Select the point object", 1, True, False)
	If isNull(id) Then Exit Sub
	Dim pc: pc = "W" & Rhino.Pt2Str(Rhino.PointCoordinates(id))

	Dim strText: strText = chr(34) & "%<PointCoordinate(" & chr(34) & id & chr(34) & "," & chr(34) & "XYZ" & chr(34) & ")>%" & chr(34)
	Rhino.Print strText
	
	Dim cmdStr: cmdStr = "#_-Leader " & pc & " MultiPause " & strText & " _Enter"
	rhino.Print cmdStr
	Rhino.Command(cmdStr)

End Sub

-Pascal

nice! thank you!

Thx, that’s great.