Rhino Script

Hi Hakan,
I am not sure I follow - so you want to have the _Section command run and instantly run the script on all resulting section curves?

Like this:

Option Explicit

Call Main()
Sub Main()

	Call Rhino.Command("_Section _MultiPause")
	If Rhino.LastCommandResult() = 0 Then
		'change this for different rounding 
		Dim intRound:  intRound = 2
		Dim arrC : arrC = Rhino.SelectedObjects()
		If isnull(arrC) Then Exit Sub
		Dim i
		Rhino.EnableRedraw False
		For i=0 To Ubound(arrC)
			If Rhino.IsCurve(arrC(i)) Then
				Call Rhino.AddTextDot(Round(Rhino.CurveLength(arrC(i)), intRound), Rhino.CurveMidPoint(arrC(i)))
				Call Rhino.CurveArrows(arrC(i), 3)
			End If
		Rhino.EnableRedraw True
	End If
End Sub
1 Like

Hi Jarek,
When you get a section, make an arrow + measure + write the measurement result with dot.
Sorry my english is very bad.

Yeeees. Thank you so muck Jarek.

This script works so well for me. I am very happy for that. I have one more question regarding this. For example, I want 123, not 123.23. So it should not show beyond the point. What changes should be made in the code?

hi Hakan,

if you look at the script code, there is this section:

'change this for different rounding 
		Dim intRound:  intRound = 2

#2 is the # of decimal places for rounding. Simply change this to 0 in the script text and you should get only whole numbers. Does it help ?

Thank you very much dear Jarek.
How can I learn about macro, scripting? I am learning Python. But I don’t know how to use it with Rhino.
Where should I start?
Can you give me the source?

hi Hakan,

Python is definitely a way to go with Rhino these days. We discussed it before, I listed some reasources in this very post…
I would start with the 101 Primer of Python for Rhino and then just ask away in this forum - a lot of people should be able to help. The hardest part is to get started.