Jump to content

Importing xyz coords from excel into autocad2007


Recommended Posts

Posted

Hi everyone, hope someone can help me, I wish to import an Excel spreadsheet (values X,Y,Z) into Autocad 2007 and I would like to plot them. I would also like to display the z value next to the relative point. I have only really started using Autocad so if possible please describe the procedure in simple terms.

Many thanks.

Posted

Theres various programs out there to read excel direct but the simplest is to use excel create a column which is x,y,z =CONCATENATE(A1,",",B1,",",C1)

 

Just type POINT then paste the column of xyz points to the command line all done.

 

This question has been posted a few times before a good idea for newbies is to do a search first often the answer is already there, I still do searches all the time.

Posted

Did this post seperate straight after above search for "excel" 9th post down importing points from excel and labelling them. Search works

 

Yes it would have been easy for me to paste link. But makes the point about search.

Posted

BIGAL tried a search but I am not getting anywhere I feel. Not experienced enough. just wondering if you could expand on it in simple terms, step by step really if possible. Really struggling.

Many thanks.

Posted

Re search top right little box put excel click little to right looked down list its a couple more down now found "import points with label"

  • 4 weeks later...
Posted

Many thanks BIGAL for your help been away for a bit. Found what you said will give it a go

  • 1 month later...
Posted

Hi mate

Here i am posting codes to import your data to CAD

But before u have to prepare a .Prn file to import How:1.Open Your Data in excel file select all columns and change width to 20 and save it as "formatted Text(space delimited)(*.prn) file format

Serial No Easting Nothing Elevation Remarks

1 5000 4000 100 some

2 4000 3000 101 some2

 

[color="blue"](defun c:plt [/color](/	 cmh	 blip	snp clay x1	 y1	gfl dls
dlg cnos dldis	dlang dldts qty	 lt	lt1 tlt1
lt2 tlt2 lt3	tlt3 lt4 tlt4 lt5	tlt5 slno
lv1 cor	 ftxt	x y	 east north
)

(setq cmh (getvar "cmdecho"))
(setq blip (getvar "blipmode"))
(setq snp (getvar "osmode"))
(setq clay (getvar "clayer"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setvar "blipmode" 0)
(setq x1 0)
(setq y1 0)
;Main Function........
(setq gfl (getfiled "Select the data file" "d:" "prn" 4))
(if (= gfl nil)
(exit)
)
(setq dls (open gfl "r"))
(setq dlg (read-line dls))
(setq cnos (list (substr dlg 1 20)))
(setq dldis (list (atof (substr dlg 21 20))))
(setq dlang (list (atof (substr dlg 41 20))))
(setq dldts (list (substr dlg 61 20)))
(setq qty (list (substr dlg 81 10)))
(while (/= dlg nil)
(setq dlg (read-line dls))
(if	(/= dlg nil)
(progn
(setq cnos (cons (substr dlg 1 20) cnos))
(setq dldis (cons (atof (substr dlg 21 20)) dldis))
(setq dlang (cons (atof (substr dlg 41 20)) dlang))
(setq dldts (cons (substr dlg 61 20) dldts))
(setq qty (cons (substr dlg 81 5) qty))

)
)

)
(setq lt (- (length dldis) 1))
(while (/= lt -1)
(setq lt1 (list 'nth))
(setq lt1 (append lt1 (list lt)))
(setq lt1 (append lt1 (list 'cnos)))
(setq tlt1 (nth lt cnos))
(setq lt2 (list 'nth))
(setq lt2 (append lt2 (list lt)))
(setq lt2 (append lt2 (list 'dldis)))
(setq tlt2 (nth lt dldis))
(setq lt3 (list 'nth))
(setq lt3 (append lt4 (list lt)))
(setq lt3 (append lt4 (list 'dlang)))
(setq tlt3 (nth lt dlang))
(setq lt4 (list 'nth))
(setq lt4 (append lt4 (list lt)))
(setq lt4 (append lt4 (list 'dldts)))
(setq tlt4 (nth lt dldts))
(setq lt5 (list 'nth))
(setq lt5 (append lt4 (list lt)))
(setq lt5 (append lt4 (list 'qty)))
(setq tlt5 (nth lt qty))
(setq slno (atoi tlt1))
(setq lvl (atof tlt4))
(setq lv1 (rtos lvl 2 3))
(setq cor (list tlt2 tlt3))	 ;for points
(setq ftxt (- tlt3 1))
(setq ftxt (list tlt2 ftxt))

(setq xx (car cor))
(setq yy (cadr cor))
(setq east (strcat "Easting = " (rtos xx 2 3)))
(setq north (strcat "Northing = " (rtos yy 2 3)))

(setq ssno1 (car cor))
(setq ssno2 (cadr cor))
(setq ssno3 (+ ssno2 0.7))
(setq ssno4 (list ssno1 ssno3))
(setq elev1 (car cor))
(setq elev2 (cadr cor))
(setq elev3 (- elev2 0.7))
(setq elev4 (list elev1 elev3))
(setq co1 (car cor))
(setq co2 (cadr cor))
(setq co3 (- co2 1.5))
(setq co4 (list co1 co3))
;;Place Elevation ,Codes And Serial No Text
(command "layer" "make" "Points" "c" "4" "" "")
(command "point" cor)
(command "layer" "make" "Sl.No" "c" "1" "" "")
(command "Text" "j" "mc" ssno4 "0.5" "0" slno)
(command "layer" "make" "Remarks" "c" "6" "" "")
(command "text" "j" "mc" elev4 "0.5" "0" tlt5)
(command "layer" "make" "Elevation" "c" "2" "" "")
(command "text" "j" "mc" cor "0.5" "0" lv1)
(command "layer" "make" "Circle" "c" "3" "" "")
(command "Circle" cor "d" "1.5")
(setq lt (1- lt))
(setvar "cmdecho" cmh)
(setvar "osmode" snp)
(setvar "clayer" clay)

)

(command "ZOOM" "E")
(princ)
)

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...