@BB8x wrote:
Checked few times and works good.
Can you please add deleting base 3d poly?
(defun C:3DPRE2E ; = 3DPolyline Rectangle End {to} End
(/ ss wid n 3dpl end1 end2 ang)
(if
(and
(setq ss (ssget '((0 . "POLYLINE") (-4 . "&") (70 . 8))))
(setq wid (getdist "\nWidth of 3DPolyline rectangles from starts to ends: "))
); and
(repeat (setq n (sslength ss)); then
(setq
3dpl (ssname ss (setq n (1- n)))
end1 (vlax-curve-getStartPoint 3dpl)
end2 (vlax-curve-getEndPoint 3dpl)
ang (angle end1 end2); in XY plane
); setq
(command "_.3dpoly"
"_non" (polar end1 (+ ang (/ pi 2)) (/ wid 2))
"_non" (polar end1 (- ang (/ pi 2)) (/ wid 2))
"_non" (polar end2 (- ang (/ pi 2)) (/ wid 2))
"_non" (polar end2 (+ ang (/ pi 2)) (/ wid 2))
"_close"
); command
(entdel 3dpl)
); repeat
); if
(princ)
); defun
Or it could be done with an Erase command inside that already-running (command) function:
....
"_non" (polar end2 (+ ang (/ pi 2)) (/ wid 2))
"_close"
"_.erase" 3dpl ""
); command
); repeat
....
With a huge enough number of them, you might possibly notice a small increase in the time it takes to do it that way [because (command) operations can take a hair longer than other ways of doing things], but maybe not if the (command) is already going. And in any case, the difference would be in something like a few milliseconds per Polyline, so it would need to be a lot before you'd notice.
Kent Cooper, AIA