The sample file
You need to spell out more specific criteria. If I take your left example in the sample drawing, and change the non-rectified presumed "before" to green to distinguish the difference, and position them over the rectified white presumed "after" based at the upper right corner of the L-shaped outlines, I get this:
What determines the different leg lengths of the L shape [one leg is shorter, the other is longer]? What determines the increase in width of the L legs? What determines the different sizes of the rectangles [the left one is larger in both directions in the "after," but the right one is smaller horizontally but larger vertically]? Why and/or how are the double outlines in the "before" reduced to single outlines in the "after"? Should the "after" be a modification of the inner or the outer of the double outlines?
What's more, none of your "after" edges that I checked are accurately at 0 / 45 / 90 / etc. angles, but at angles like 0°7'40.59" and 89°52'19.41" and 45°7'40.59". Etc., etc.
I have a routine that can force Polyline vertices to be at clean multiples of round-number X & Y coordinate values, but your "after" Polylines are not like that -- they're at nowhere-in-particular locations. And the routine can result in segments lengths that are clean multiples of the specified increment, if the segment directions end up at good angles, but the lengths of your "after" segments and Lines are not clean multiples of anything, so apparently that's not a criterion.
And I have a routine that can force Lines to run in the direction that is the closest multiple of a specified angle [in your case 45°), but it works only with Line objects, not Polyline line segments.
Agree with @Kent1Cooper why not draw correct in 1st place if you think about concrete tilt panels you pick a shape and then just enter values and its drawn all square. Shape on an angle could be added by rotating final result.
Use RECTANG D and enter the sizes get a perfect rectang.
Obvious is rectang, "L" left or right side, up or down, 4 choices, U.
You can use a pop menu or a custom dcl for shape choice.
Sir, Sorry , It should be one polygon only not double like that:
I want to make the rectangular/polygon like that nearly/no any increase leg length of the original object just like the previous post (Revcloud to Polygon and Revcloud to Rectangular) (Lineweight and linetype not the consideration, it only only the outcome look like).
Below item is also the target object:
[For the rectangular ones, when orthogonal, there's the DBB command in DrawBoundingBox.lsp, >here<. But that won't do those at the 45°-multiple angles, nor the L- and/or Z-shaped ones.]
Thank you very much, but can the lisp delete/erase the original one?
For the rectangs on angle if you pick a segment then rotate object to ortho angle 0.0 etc then can get a bounding box then rotate back, for the L's or multi segment not sure. Maybe something similar. It looks like a field survey of buildings where they can be out of square and corner measurement introduces small XY errors.
L Shape can not work...
That is correct the bounding box only works for 4 point rectang style shape. Just an idea is find longest line and use that to align the shape, then introduce 90 corners.
@skchui6159 wrote:
... can the lisp delete/erase the original one?
For the DBB command [individual boxes around each object in a multiple selection], add this line:
....
); command
(entdel (ssname ss n))
); repeat
....
For the DBBM command [one box around multiple objects' overall extents], change this line:
(command "_.rectangle" "_none" (trans LL 0 1) "_none" (trans UR 0 1))
to this:
(command
"_.rectangle" "_none" (trans LL 0 1) "_none" (trans UR 0 1)
"_.erase" ss ""
); command
Thank you very much!
Just a comment, this was drawn using a pline and using the .X & .Y option picking the mid point of the shape with ortho on. So averaging the line direction to ortho. With some manual overides.
I can not see any easy way to determine how to move a point there is just to much which point to move. In top corner I redid the fillet.
Having worked with survey plans for too many years I know our surveyors used various methods to get corner building points as close as possible to true. When looking at a plan would not know they were not correct, so I would suggest look at survey technique, our guys used 25mm prism targets rather than the big 75mm ones for corners.