Every time the routine is run you get a different result. Has anyone an idea why a LWPOLYLINE behaves like this?
Created in a non world UCS?
Running osnap?
Perhaps --
(command "_.move" SS "" "_non" '(0 0 1e99) "" "_.move" "_p" "" "_non" '(0 0 -1e99) "")-------------------------------------------------------------------------------------------------------------------Just a quick note of acknowledgement -- afaik Randy Richardson was the first to publicise the use of
(command "_.move" SS "" '(0 0 1e99) "" "_.move" "_p" "" '(0 0 -1e99) "")as a quick flattener of sorts.
-------------------------------------------------------------------------------------------------------------------Myself I've penned many many flatteners over the years, at one point it was a major career activity. This is a very simple / less ambitious one (I have penned some that go tho whole 9 yards, de-xref, de-paperspace, remove hidden lines, retain original layering yada ...) from sometime 1999/2000:
(defun c:Splat ( / _children _splat ss i )
(defun _children ( ename / data result )
(if (assoc 66 (entget ename))
(reverse
(while
(/= "SEQEND"
(cdr
(assoc 0
(setq data
(entget
(setq ename
(entnext ename)
)
)
)
)
)
)
(setq result (cons ename result))
)
)
)
)
(defun _splat ( ename )
(foreach ename (cons ename (_children ename))
(entmod
(mapcar
'(lambda ( lst / key )
(cond
( (member
(setq key (car lst))
'(10 11 12 13)
)
(cons
(car lst)
(mapcar '* '(1.0 1.0 0.0) (cdr lst))
)
)
( (eq 38 key) '(38 . 0.0))
( t lst )
)
)
(entget ename)
)
)
)
(entupd ename)
)
(if (setq ss (ssget))
(repeat (setq i (sslength ss))
(_splat
(ssname ss
(setq i (1- i))
)
)
)
)
(princ)
)
Doesn't do 3dsolids, but does do attributes, polyline vertices etc., honours locked layers.