View Full Version : point selection question
wingwalker
10-30-2006, 02:10 PM
im sorry if this is a stupid question, but is there a command to select points on or in a particular axis?
I want to select all the points that have a -y axis value.
I am still using LW7.5
Thanks
Rob T
evenflcw
10-30-2006, 07:25 PM
You could use one of the volume select modes as parameter together with values for a bounding box for selpoint(). If you are unsure, look for a mirror/unmirror script. Most of them should be using this.
wingwalker
10-31-2006, 01:29 PM
Hi
Thanks, I will look into that....isnt there some command that goes:
if point coordinate on the Y axis is a minus value = true
if true then selectpoint and move to next point
if false then move to next point
?
evenflcw
10-31-2006, 02:11 PM
If you want exactly that you have every possibility to code it that way yourself (check sections on MeshDataEdit mode), but it would be slow as you would have to check each point individually, even those that aren't within that area. There is no premade function (other than bounding box selection*) that does this.
It's much faster then to first get the bounding box of the layer(s) (so you know the boundaries of the geometry); split the bounding box in half (so you only get -Y section); then make a selection using that bounding box. *LWs bounding box selections probably works the way you want internally, but it does it in compiled code, which runs much faster than lscript, especially so when it comes to selections.
evenflcw
10-31-2006, 02:18 PM
If you would like to see some code examples I'd be happy to provide them so you get more than just words to consider. Just say exactly what you would like to see and I'll try to whip something together.
wingwalker
10-31-2006, 02:30 PM
Hi
Thanks for the replys
what im trying to do is make kitchen units with out all the fuss of having to make them myself (there being 100+ units per range) my plan is to make a quater of a door and then get LScript to make all the door sizes and units and save them out. There are also 80 door styles so i realy dont want to have to make all these units manualy.
my script is going to be something like this (i have made a quarter door which the bottom righthand corner will be positioned at 0,0,0)
select all points on the -x axis and move N
deselect
select all points on the +y axis and move N
deselect
mirror and merge on x and on y
etc. etc.
evenflcw
11-01-2006, 03:54 PM
I'm not sure I fully understand but here's something that should be simular atleast. Try it on the included object to see how it's suppose to work. With some extra math and an interface it could be alot more convenient.
Uncomment 'debug();' to see what each step does. Use F10 to step.
wingwalker
11-03-2006, 01:28 PM
Thanks Mate,
Thats what im after, to be honest ive never bothered with the volume selection mode so it wasnt something that i concidered.
thank you again for all your help, *starman*
Rob T
evenflcw
11-03-2006, 02:02 PM
Volume selections are very good to know about, especially when it comes to lscripting. The reason is that arbitrary selections are otherwise really slow to execute (using for example PNTNDX or PNTID arguments). Glad I could help, hopefully you got an opportunity to modify the script atleast alittle just for the learning experience ;)
Dodgy
11-03-2006, 05:09 PM
Hopefully the new 9.2 will speed up point selection for us lscripters as well as just in the UI.
evenflcw
11-03-2006, 08:32 PM
Indeed. I took note of that part in the newsletter too. However I'm trying to move over to sdk now though. It's tricky but I'll just do what I did to learn lscript - throw in some random functions and variables, hope it works, then try to make sense of it.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.