PickPoint() works as a script, but not a macro?

PickPoint() works as a script, but not a macro?

Orangetheripper
Explorer Explorer
602 Views
2 Replies
Message 1 of 3

PickPoint() works as a script, but not a macro?

Orangetheripper
Explorer
Explorer

Hey there. I have a very simple script which moves an object to my mouse location. 

 

$.pos = pickPoint()

 

 

However, when I try to make it a macro

 

macroScript objToMousePos
Category:"Custom"
toolTip:"Places selected object at mouse location"
buttonText:"objToMouse"

 

(

$.pos = pickPoint()

)

 

it hangs at the input section of pickPoint. Normally you just click to get the point and the object moves there. When a macro, it sits there waiting to get a point no matter how many times I click, and never actually gets the point - I have to esc out of the pickPoint mode and cannot get it to work. 

 

Any help would be much appreciated!

0 Likes
Accepted solutions (1)
603 Views
2 Replies
Replies (2)
Message 2 of 3

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

make the code clean... it helps

 

macroScript PickAndPin
	category:"Custom"
	buttonText:"PICK-N-PIN"
(
	local checked = off
	
	fn enabled = (selection.count > 0)
	on isEnabled do (enabled())
	on isChecked do enabled() and (checked)
	on execute do if enabled() do
	(
		checked = on
		if iskindof (pos = pickPoint()) Point3 do selection.pos = pos
		checked = off
	)
)
0 Likes
Message 3 of 3

Orangetheripper
Explorer
Explorer

Thank you so much!

0 Likes