Jump to content

Get coordinates of points


anindya

Recommended Posts

Correct me if I am wrong but isn't this the third time you have posted basically the same question? I swear I've seen those two files, or something very similar, attached to another thread.

Link to comment
Share on other sites

i need the answer of that question.for that i never count how much i am trying.so if u have the reply give me .me using autocad 2007 i cant figure out that.help me pls.

Link to comment
Share on other sites

Try to show some patience please. Creating multiple threads with the same question can only lead to confusion when, and if, forum members start to reply as all replies may not be in a single thread. Do you understand?

 

Maybe this thread re: AutoCAD, points and VBA posted at the VBA Express Knowledge Base will be of some use to you.

 

http://www.vbaexpress.com/forum/showthread.php?18957-Solved-VBA-and-AutoCAD-reading-points-from-a-txt-file

Link to comment
Share on other sites

This will work make a CSV file from excel look at the date 2004 !

 

; SETOUTBOX.LSP draw setout details boxed co-ord list
                   ; 29/9/04 by alan h
(setvar "menuecho" 0)
(setvar "SNAPMODE" 0)
(SETQ OLDSNAP (GETVAR "OSMODE"))
(setvar "OSMODE" 0)
(defun xyz ()
 (setq ans "")
 (setq char_found "")
 (while (/= char_found ",")
   (setq char_found (substr new_line x 1))
   (setq x (+ x 1))
   (setq ans (strcat ans char_found))
 )                    ;end while
)                    ;end defun 
(setq setsc (/ (getreal "\nEnter Dwg scale 1: ") 1000.0))
(setq stpt (getpoint "\nPick top left point for details "))
(setq xyzfiles (getfiled "\nENTER CO-ORD File name  " "" "" 4))
(setq fopen (open xyzfiles "R"))
(command "zoom" "E")
(command "zoom" "c" stpt (* setsc 100.0))
(setq pt1 stpt)
(setq txtht (* 2.5 setsc))  ; 2.5mm HIGH LETTERING
(setq num 1)
(setq llen (* 84.0 setsc))
(setq ydiff (* 4.5 setsc))  ; 4.5mm line spacing
(setq stptx (car stpt))
(setq stpty (cadr stpt))

(setq txtpt (list (+ stptx (* 42.0 setsc)) (+ stpty (* 2.0 setsc))))
(command "text" "BC" txtpt txtht "" "xxxxx")

(setq txtpt (list (+ stptx (* 42.0 setsc)) (+ stpty (* 7.0 setsc))))
(command "text" "BC" txtpt txtht "" "%%uSETOUT DETAIL")
(setq pt2 (polar stpt 0.0 llen))
(command "line" stpt pt2 "")        ;draw horizontal line
(setq pt1 (polar stpt 4.7124 (* 5.75 setsc)))
(setq txtpt (polar pt1 0.0 (* 9.0 setsc)))
(command "text" "BC" txtpt (* 3.5 setsc) "" "POINT")
(setq txtpt (polar pt1 0.0 (* 34.0 setsc)))
(command "text" "BC" txtpt (* 3.5 setsc) "" "EASTING")
(setq txtpt (polar pt1 0.0 (* 67.0 setsc)))
(command "text" "BC" txtpt (* 3.5 setsc) "" " NORTHING ")
(setq pt1 (polar stpt 4.7124 (* 8.0 setsc)))
(setq pt2 (polar pt1 0.0 llen))
(command "line" pt1 pt2 "")        ;draw horizontal line
(setq pt1 (polar pt1 4.7124 (* 1.0 setsc)))
(setq pt2 (polar pt1 0.0 llen))
(command "line" pt1 pt2 "")        ;draw horizontal line below above
(setq pt1 (polar pt1 4.7124 (* 1.0 setsc)))
(setq pt2 (polar pt1 0.0 llen))
(command "line" pt1 pt2 "")        ;draw horizontal line below above

(setq pt3 pt1)                ; sets pt to last line position
;(setq pt5 (polar pt3 1.5708 (* 1.0 setsc)))      ; 1 mm above line
(setq pt5 pt3)                ; 0.5 mm above line
(SETQ XX 1)
(while (setq new_line (read-line fopen))
(PRINC XX)
 (setq x 1)
 (setq y 5)
 (xyz)
 (setq ptno ans)            ;pull ptno out
 (xyz)
 (setq easting ans)
 (xyz)
 (setq northing ans)

 (setq pt3 (polar pt3 4.7124 ydiff))
 (setq pt4 (polar pt3 0.0 llen))
 (command "line" pt3 pt4 "")
 (setq pt5 (polar pt5 4.7124 ydiff))
 (setq pt6 (polar pt5 0.0 (* 8.0 setsc)))
 (setq pt7 (polar pt5 0.0 (* 28.0 setsc)))
 (setq pt8 (polar pt5 0.0 (* 58.0 setsc)))
 (command "text" "BL" pt6 txtht "" ptno)
 (command "text" "BL" pt7 txtht "" EASTING)
 (command "text" "BL" pt8 txtht "" NORTHING)
(SETQ XX (+ XX 1))
)                    ; end while
(command "line" stpt pt3 "")
(setq pt3 (polar pt3 0.0 (* 18.0 setsc)))
(setq stpt (polar stpt 0.0 (* 18.0 setsc)))
(command "line" stpt pt3 "")
(setq pt3 (polar pt3 0.0 (* 33.0 setsc)))
(setq stpt (polar stpt 0.0 (* 33.0 setsc)))
(command "line" stpt pt3 "")
(setq pt3 (polar pt3 0.0 (* 33.0 setsc)))
(setq stpt (polar stpt 0.0 (* 33.0 setsc)))
(command "line" stpt pt3 "")
(princ setsc )
(setq pt1  nil
     pt2  nil
     pt3  nil
     pt4  nil
     pt5  nil
     pt6  nil
     pt7  nil
     pt8  nil
     stpt nil
     ans  nil
     SETSC NIL
)
(SETVAR "OSMODE" OLDSNAP)
(princ)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...