PDA

View Full Version : Modeler example



skarloc
09-16-2012, 10:19 AM
Hello to you all.

I've been able to do stuff in Layout no problem. But I'd like to do simple stuff in modeler, and I haven't a clue where to start. I've search various examples and I can't seem to work out how to do the simplest of things : I'd like to move all selected points 3.2mm up in the Y axis. Should be easy. I can't work out what the command is, how to access the selected points/polygons nor how to tell them how to move 3.2 mm up (if you've seen my vidoes or done similar stuff, you'll know why).

Any chances of a simple script for this ?

Thanks.

Markc
09-16-2012, 10:30 AM
Press N to bring up Numeric Panel, select points you want to move, either right click lasso or hold shift while selecting points.
Select Move (t) from Modify Tab, in Numeric Panel Type 3.2mm in Y channel (and Apply), voila :)

skarloc
09-16-2012, 11:14 AM
LOL - yeah, I'm a bit fed up of doing that - I've been doing that for about 2 years, now - I couldn't calculate how many times I've used the numeric panel to do just that.

I want to assign a hot-key to a 3.2mm move upwards (for example, ctrl-shift-up). One key instead of 6 and a mouse click (t n <Tab> 3 . 2 + mouse click). Note that my units are mm.

xchrisx
09-16-2012, 12:14 PM
Its actually pretty easy to do in Lscript:


@warnings
@version 2.2
@script modeler
@name MoveY3.2mm // this is optional
main
{
selmode(USER);
move(0,.0032,0);
}


to get the value you have to make it in terms of meters.

to do this in python I dont think it would be that much more difficult but you can use the code above as a starting point.

skarloc
09-18-2012, 12:29 PM
Agreed - thanks. I'll just have to find time to play with this as a start. Otherwise, I'll do it as LWScript.

Anyone know if there's a way to pass parameters to a python script that come from the hot-key definition ? I can't see any way, but it would be helpful...

jeric_synergy
09-18-2012, 03:52 PM
If it's a hotkey, why not just hardcode it?

skarloc
09-18-2012, 05:58 PM
I could, but it's also the basics into getting into larger things. I'll learn how to do that, and then other things more.