Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting a text listing of block coordinates

Status
Not open for further replies.

kristof79

Mechanical
Apr 1, 2003
2
0
0
DE
This is a bit of a hard question really - does anyone know how to generate a list of coordinates of the conveyor blocks on a layout?
 
Replies continue below

Recommended for you

Here is something I whipped up...

(defun WRITECOORDS ()
(setq TXTFILE
(open "C:\\CONVLIST.txt" "W")
CNT 0
)
(setq BLKNAME (getstring "\n Enter Block name? "))
(setq BLKSS (ssget "X" (list (cons 2 BLKNAME))))
(if BLKSS
(while (< CNT (sslength BLKSS))
(setq COORD (cdr (assoc 10 (entget (ssname BLKSS CNT))))
XPT (rtos (car COORD) 2 3)
YPT (rtos (cadr COORD) 2 3)
ZPT (rtos (caddr COORD) 2 3)
COORD (strcat XPT &quot;,&quot; YPT &quot;,&quot; ZPT)
)
(write-line COORD TXTFILE)
(setq CNT (1+ CNT))
)
)
(close TXTFILE)
)
 
kristof79,

If you are familiar with ATTEXT command,you will be able to extract the block insertion point coordinates by adding BL:x and BL:y into your extraction text. You should add a unique attribute i.e. CONVEYORNUMBER so other block coordinates will not be extracted.

You can format the resulting text file in EXCEL.

209larry
 
209larry - sorry, I don't know much about AutoCAD, I'm trying to extract these for use with another program - how would I do that - could you provide slightly more detail
 

kristof79,

If you can send me a drawing of the block or the drawing
you want processed, I'll take a look at it and give you
a solution. Email to grevark@aol.com.
 
Status
Not open for further replies.
Back
Top