is there a lisp to arrange blocks by selection order, (see attached image).
e.g.: the example below shows at the left some randomly distributed blocks where we need to rearrange them by "selection order" from 1 to 6 as shown on the right image.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
@atawk wrote:
.... the order is still matter what i meant is when i select an object using window it doesn't sort out at end with the blocks arrangement.
Then don't select an object using a window. That's exactly why my first routine limits selection methods to only those that put things into the selection set in the order selected as originally requested, but adding the Fence option to the individual-pick method in your description. Maybe mine could be altered to allow selection of a single object in any of those ways, and put it into the selection order, but not allow multiple objects. Is that what you want to do? But why select a single object in a window rather than just picking on it?
If you want to be able to select multiple objects in a window, and you want the positional order to be as it was within such a selection, maybe the routine linked by @pendean at Message 13 will do. When you select multiple objects at one time by Window or Crossing or Lasso, they go into the selection set in -- I forget which -- either drawn order or reverse drawn order. A routine could be made to determine relative left-to-right positions, and put them into a regular row accordingly, but all sorts of questionable possibilities arise. For example, which of these two Circles is farther to the left?
The big one because it extends farther leftward, or the small one because its center is farther left? Blocks with varying insertion point locations relative to their drawn content present similar issues. And what about things that are vertically aligned? Does the order among those matter? Etc., etc.
Thanks for your lisp. If you please update this lisp new function: arrange object selected (text, block, rectang...) with x , y distance with dialog input value
Making such as: 03 rows, 5 colum.... Thanks
Someone requested a version that asks the User for the gap size, rather than having it built in, and remembers that to offer as default on subsequent use. See the attached. It's still of the variety that requires individual-pick or Fence selection only, to define the order in the resulting row.
Making such as: 03 rows, 5 column. Should only be one say columns so rows are made automatically.
Re a dcl yes this will do it.
(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Hor gap " 5 4 "5000" "Ver gap " 5 4 "1500" "Columns" 5 4 "3" )))
(setq L1 (atof (nth 0 ans)) L2 (atof (nth 1 ans)) L3 (atof (nth 2 ans)))
No code for arranging will leave that to you.
Can't find what you're looking for? Ask the community or share your knowledge.