How is the point data being imported into AutoCAD?
-David
Registered forum members do not see this ad.
I am completely new to autolisp. I am simply trying to figure out how to write a lisp that will use existing point numbers to draw a poly line to. for example, if i bring in point numbers into a drawing always numbered 1-10, no matter what coordinates they contain when they are inserted into the drawing, i would like the lisp to draw a poly line from point # 1, to 2, to 3.... etc. I know there is a macro built in to LDD that allows you to draw a line from # to # but i would like the lisp to customize myself. I also do not want to have to physically pick the points i want, i want the lisp to find the points by number. thanks in advance for any help at all.
How is the point data being imported into AutoCAD?
-David
R12 (Dos) - A2K
I am importing them using a .csv file PNEZD
point #, northing, easting, elevation, description
You may want to post a sample of the data to ensure what are REAL numbers and what are STRings
I would assume:
- Point# to be an INTeger
- northing, easting and elevations to be REAL numbers
- Description to be a STRing
-David
R12 (Dos) - A2K
I'm not at my computer but yes you can assume exactly that.
1, 200.44, 300.56, 256.43, Edge
2, 212.32... Etc
This does absolutely no error checking, data checking, nada thing
Code:(defun c:pt23dpl (/ file rf nl i cl pl) (while (not file) (setq file (getfiled "CSV Point Data File" "" "csv" 8))) (setq rf (open file "r")) (while (setq nl (read-line rf)) (setq i 1 cl nil) (repeat (strlen nl) (if (= "," (substr nl i 1)) (setq cl (cons i cl))) (setq i (1+ i))) (setq cl (reverse cl)) (setq pl (cons (list (atof (substr nl (1+ (nth 1 cl)) (- (nth 2 cl) (nth 1 cl) 1))) (atof (substr nl (1+ (nth 0 cl)) (- (nth 1 cl) (nth 0 cl) 1))) (atof (substr nl (1+ (nth 2 cl)) (- (nth 3 cl) (nth 2 cl) 1)))) pl))) (close rf) (command "_.3DPOLY") (apply 'command (reverse pl)) (command "") (prin1))
The data must be in the exact order as described and without any blank lines. AS IS!
Have fun! -David
R12 (Dos) - A2K
INCREDIBLE! i appreciate all of the help, i realize how time consuming that must have been. i will play with it and come back with questions. thank you thank you!




Throw your csv into excel and make a script 1st pass is insert points 2nd pass join lines 3rd pass insert blocks on certain points. this is known as stringing and their are commercial packages available.
A man who never made mistakes never made anything




Registered forum members do not see this ad.
Using excel could be done here is a snap shot of how to just copy column to command line
Excel stringer.png
A man who never made mistakes never made anything
Bookmarks