Notifications
Clear all

[Closed] Textplus

Please, I need to program in Maxscript the distance between two points with Textplus.

Please help me

3 Replies

i would do it with a float_script controller:

disableRefMsgs()
delete objects
enableRefMsgs()

(
	global txt = textplus name:#test pos:[0,0,30] dir:-y_axis alignment:0 isselected:on wirecolor:red
	scr = point name:#source pos:[0,0,0] wirecolor:green	
	trg = point name:#target pos:[100,0,0] wirecolor:yellow	

	title = "Distance(m) : "
	txt.setPlaintextString title
	txt.setvalueastext -1 "Distance" #script #whole 0 0 true

	ss = txt.baseobject[#Distance].controller = float_script()
	ss.addnode "source" scr
	ss.addnode "target" trg
	ss.setexpression "distance source target"
	
	txt
)

PS… “(m)” – miter units is an example. of course you have to use your own (or scene current)

Thanks Dennis