A pool of resources
Incremental Counter

    


A tool developed to expedite fabrication. Each click adds text which counts by a specified increment allowing for quick numbering, with your choice of prefixes.


platform: Rhino Script
function: Fabrication Aid

 


Option Explicit
'Script written by <David Mans>
'Script copyrighted by <Neoarchaic Design>
'Script version Thursday, June 26, 2008 9:54:36 PM

Call Main()
Sub Main()
	Call sequential()

End Sub
Function sequential()
	sequential = Null
	Dim pt
	Dim pre, strt, incr, i
	pre = Rhino.GetString("Enter Prefix","",array(""))
	If pre <> "" Then
		pre = pre & "_"
	End If

	strt = Rhino.GetReal("count from = ",0)
	If isNull(strt) Then Exit Function

	incr = Rhino.GetReal("increment = ",1)
	If isNull(incr) Then Exit Function

	i = strt
	Do
		pt = Rhino.GetPoint("press enter to finish")
		If isNull(pt) Then Exit Function
		Call Rhino.AddText(pre & i,pt)
		i = i+incr
	Loop
End Function


Reply