TEXTPLUS

TEXTPLUS

richardvillagaray
Participant Participant
1,839 Views
6 Replies
Message 1 of 7

TEXTPLUS

richardvillagaray
Participant
Participant

I don't know how to program TextPlus to measure the distance between two points. I want to do it with Maxscript because I have to do it several times.

 

 
 

 

0 Likes
Accepted solutions (1)
1,840 Views
6 Replies
Replies (6)
Message 2 of 7

denisT.MaxDoctor
Advisor
Advisor
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
)
0 Likes
Message 3 of 7

richardvillagaray
Participant
Participant

Dear Dennis:

I thank you in advance for your support in resolving this matter. I have 3ds Max 2020, and the code does not run.
Appears the next message.

 

richardvillagaray_0-1601997547590.png

 

0 Likes
Message 4 of 7

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

it needs SP2 for 2020

0 Likes
Message 5 of 7

richardvillagaray
Participant
Participant

Yes.

 

It work fine.

 

A lot of thanks !!

 

 

0 Likes
Message 6 of 7

denisT.MaxDoctor
Advisor
Advisor

deleted

0 Likes
Message 7 of 7

richardvillagaray
Participant
Participant

Hi Dennis

I want to put a "FACTOR", TO CHANGE the units of distance (pass meter to ft, or another). Please can you help me ??

 

I want to "concatenate text" to the value of textplus.

 

 

Please, help me.

0 Likes