@dani-perez wrote:
.... picking cant be automated, so I will have to pick one by one. ....
But picking can be greatly reduced from picking one by one in order:
(prompt "\nUse Fence selection across one-line-segment Polylines in sequence to")
(setq ss
(ssget ; provides its own "Select objects: " prompt
'(
(0 . "LWPOLYLINE")
(-4 . "<not") (-4 . "&=") (70 . 1) (-4 . "not>") ;; not-closed only
(-4 . "<not") (-4 . "<>") (42 . 0.0) (-4 . "not>") ;; no-bulge [i.e. line segment] only
(90 . 2) ;; single-segment only
); filter list
); ssget
); setq
You will need to type in the F to go into Fence selection, as instructed, but then you just draw a Fence through them along the appropriate path, and what that returns is a selection set of them in positional-sequence order, no matter what their drawn order. A single leg of that Fence path will often be able to pass through a whole bunch of the Polylines, sparing you the need to pick each one to determine the sequence. I haven't followed up with the further processing, stepping through that selection set to work with the Polylines to build the perimeter, but this should give you a big jump on the selection part.
EDIT:
It appears it's not even necessary to step through that selection set. With LOFTNORMALS set to 0 for straight edges instead of splined ones, all you need is to start a LOFT command, and give it ss as the selection, and get your Surface:
(command "_.loft" ss "" "")
and then go on with the Exploding of that into Regions, Unioning them, converting to a Polyline, as in Marko's routine.
There remains the "problem" that in any case, you need to Explode the Block to get the Polylines, but you could make a copy in-place, Explode that, do this with the results [the selection will ignore the underlying Block], and then delete the ss selection set, and your original Block will still be there.
Kent Cooper, AIA