What kind of objects are these blocks-3dsolids?
Registered forum members do not see this ad.
I have a cube made up of 27 blocks, 3x3x3. I need to write a script or lsp which will select all the blocks on the middle layer. They all have the same base point X value. Nothing else but this cube is in the drawing.
How would do this?
-thanks




What kind of objects are these blocks-3dsolids?
Look at the ssget function.
I assume the layer name is "middle".
Code:(setq ss (ssget "_X" '((8 . "middle"))))
The objects are blocks. After the middle layer is selected I will be rotateing it. The selecting all the "blocks" with the same user selected Y value and rotating them. The "ceter layer blocks" have a X base point value of 14. From what Ive found I think i'm looking for something along the lines of selecting everthinging and then filtering out with
(ssget "x" ' ((0. "INSERT") (10. 14)))
-Smik




Looks like you're trying to animate a rubic's cube
Yes your syntax is pretty close, but need a space afer some codes.
You can use:
(setq MidSet (ssget "x" '((0 . "INSERT")(10 . 14.0))))
to select those blocks, then in a rotate command use "MidSet" for the selection set.
Thanks CarlB. I'll give it a try. Correct about the ruiks cube. My brothers son wants to be able to do it on the computer. I came up with
(setq s4 (ssget "_X" '((10 14.0 25.0 30.0)))) to select one block but couldnt get wildcards for the Y Z
-Smik




I think you've got it right with your filter, and yes the "group 10" data does need to include at least x & y values for the coordinate.
I'm not aware of a selection filter on a part of the insert coordinates. You may need to select every block, step through each, examine the coodinates, and create a new selection set of those that match desired x value.
Registered forum members do not see this ad.
your help has saved me alot of time. I was just hoping for a 1 line of code that would be like the quick select> block ref > Position x,y or z. I guess I might have to figure out how to put in a couple loops. thanks again.
-Smik
Bookmarks