Notifications
Clear all

[Closed] what is making this program stall?

 em3

if I change “format” to “print” it prints the values. Format is hanging it up for some reason?

Max 2013 Update 4


function getoffset p o a=
(
		if o.position[a] < p.position[a] then
			(
				local objaxis = (p.position[a] - o.position[a])*-1
			)
			else
			(
				local objaxis = o.position[a] - p.position[a]
			)
	objaxis
)

rollout PolyformTarget "Crane Target"
	(
		group "thegroup"
		(

							pickbutton choosePT_obj "Select Position Object" width:150
							pickbutton chooseTO_obj "Select Target Object" width:150
							pickbutton chooseOFF_obj "Select Offset Object" width:150
							button btn_doit "Go"
		)
		
	on choosePT_obj picked pt do
				(
							choosePT_obj.text = pt.name
				)
	on chooseTO_obj picked targo do
				(
							chooseTO_obj.text = targo.name
				)
	on chooseOFF_obj picked objoff do
				(
							chooseOFF_obj.text = objoff.name
				)

	on btn_doit pressed do
				(

						local theparent = getnodebyname choosePT_obj.text
						local thetarget = getnodebyname chooseTO_obj.text
						local theoffset = getnodebyname chooseOFF_obj.text
						local xdiff = getoffset theparent theoffset 1
						local ydiff = getoffset theparent theoffset 2
						local zdiff = getoffset theparent theoffset 3
						format "% % %" xdiff ydiff zdiff
						
				)
	)
							
	
try(destroyDialog PolyformTarget)catch()
createDialog PolyformTarget width:200

2 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

 
 						format "% % %
" xdiff ydiff zdiff
 

for this reason.

 em3

thank you Denis. I thought the
was to create a new line if there were multiple. Looks like it works like a “commit”. I wonder if would work the same way.

From the help file: “format does not automatically append a line break to the output stream, so you can build up a line from several format calls and generally control layout better. An explicit ’
’ newline escape character sequence is needed to place a line break in the output stream.”