AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Block Insertion point extraction

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
253 Views, 2 Replies

Block Insertion point extraction

I am trying to get the coordinates of the insertion point from a block. My results are to 1 decimal place. I need at least 3 dec places. I am using LISP routines (ENTGET, CAR, CDR, etc).

Thanks in advance,

Ricardo
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Presuming E is the entity name of the block insertion...
(setq P (cdr (assoc 10 (entget E)))) ; in WCS
(setq P (trans (cdr (assoc 10 (entget E))) 0 1)) ; in current UCS

P will be a list of three REALs.
To convert it to a list of strings with a specific precision...

(setq Prec 4) ; precision
(setq P$ (mapcar (function (lambda (x)(rtos x 2 prec))) P))

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711

"taisoft" wrote in message
news:f0d2c82.-1@WebX.maYIadrTaRb...
> I am trying to get the coordinates of the insertion point from a block. My
results are to 1 decimal place. I need at least 3 dec places. I am using
LISP routines (ENTGET, CAR, CDR, etc).
> Thanks in advance,
>
> Ricardo
>
Message 3 of 3
Anonymous
in reply to: Anonymous

HI,

For a non-lisp solution use the ATTEXT command.

It's designed for this very purpose and adds a range of other features as
well.

--


Laurie Comerford
CADApps
www.cadapps.com.au


"John Uhden" wrote in message
news:5D806172E09A9DCD73447162D7E80C38@in.WebX.maYIadrTaRb...
> Presuming E is the entity name of the block insertion...
> (setq P (cdr (assoc 10 (entget E)))) ; in WCS
> (setq P (trans (cdr (assoc 10 (entget E))) 0 1)) ; in current UCS
>
> P will be a list of three REALs.
> To convert it to a list of strings with a specific precision...
>
> (setq Prec 4) ; precision
> (setq P$ (mapcar (function (lambda (x)(rtos x 2 prec))) P))
>
> --
> John Uhden, Cadlantic/formerly CADvantage
> [ mailto:juhden@cadlantic.com ]
> [ http://www.cadlantic.com ]
> 2 Village Road
> Sea Girt, NJ 08750
> Tel. 732-974-1711
>
> "taisoft" wrote in message
> news:f0d2c82.-1@WebX.maYIadrTaRb...
> > I am trying to get the coordinates of the insertion point from a block.
My
> results are to 1 decimal place. I need at least 3 dec places. I am using
> LISP routines (ENTGET, CAR, CDR, etc).
> > Thanks in advance,
> >
> > Ricardo
> >
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report