@Kent1Cooper wrote:
There's a peculiarity about how entity data for 2D Solids is stored that comes out in a strange way for those not in or parallel to the WCS, different from the way [for example] other-UCS Polyline data is stored. I haven't yet found a way to account for it reliably except by forcing it to start in the WCS, and shift UCS from there for each Solid. I tried a variety of (trans)-based approaches, etc., but haven't hit the right one yet to avoid shifting to the WCS first -- if/when I figure that out, it will avoid the saving/restoring/deleting of a dedicated UCS name that's part of this routine. But in the meantime, this seems to work in limited testing. See comments at the top of the file.
Both SOLID and LWPOLYLINE are 2d entities which coordinates are defined in the entity OCS.
You can use the entity ename or the entity 210 group code value with the trans function.
;; get the dxf data of a SOLID
(setq elst (entget solid))
;; transform the first vertex to WCS coordinates
(trans (cdr (assoc 10 elst)) solid 0)
;; transform the second vertex to current UCS coordinates
(trans (cdr (assoc 11 elst)) (cdr (assoc 210 elst)) 1)
With LWPOLYLINE entities, you have to pay attention to the elevation of the polyline because coordinates are 2d only.
;; get the dxf data of a LWPOLYLINE
(setq elst (entget pline)
vertex (cdr (assoc 10 elst))
elevation (cdr (assoc 38 elst))
)
;; transform the first vertex to WCS coordinates
(trans (list (car vertex) (cadr vertex) elevation) pline 0)