james jr Posted September 2, 2023 Share Posted September 2, 2023 I have done cad for surveying for a long time...using R14 TO todays......ive always only had 5000 5000 coord, or angles distances. now i have to have the coordinates with the labels and numbers on them. i have looked at the youtubes for excel.....txt.......lisp, i have never used a lisp, and have no clue what it is...i did download lee mac's lisp and uploaded it, but don't even know what that means. lol Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 2, 2023 Share Posted September 2, 2023 LISP is a programming language. Lisp routines help automate a series of commands making life easier for the CAD technician. Which Lee Mac lisp routine did you download? Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 2, 2023 Share Posted September 2, 2023 It would help if you could post examples of what you have and what you need. Read Lee Mac's page for loading and running a LISP routine. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 2, 2023 Share Posted September 2, 2023 (edited) This was supplied last night via PM. Tested on data supplied. (defun c:james ( / csv lst fname pt) ; rename to something else ; lisp program by lee-mac ; it looks for the comma its character 44 in the ascci key codes space is 32 A is 65 (defun csv->lst ( str / pos ) (if (setq pos (vl-string-position 44 str)) ; 44 is comma returns the postion of "," like 9. (cons (substr str 1 pos) (csv->lst (substr str (+ pos 2)))) ; cons build a LIST of the variables at every "," (list str) ) ) (setq csv (getfiled "Select CSV File" "" "csv" 16)) ; as name implies get a file (setq lst '()) ; create a blank sleection set to add more to (setq fname (open csv "R")) ; open the file to read its contents (while (setq newline (read-line fname)) ; while you can read a line form the the file it stops when no more lines (setq lst (cons (csv->lst newline) lst)) ; make a list of each line read in pt X Y Z description ) (setvar "textstyle" "Standard") ; set text to Standard (setq lst (reverse lst)) ; reverse the list as it has 1st entry as last line (setvar 'pdmode 34) ; sets the "POINT" style (setvar 'pdsize 2) ; sets the point style (foreach pt lst ; a loop to go through each line pulls each line out (command "point" (list (atof (nth 1 pt))(atof (nth 2 pt))(atof (nth 3 pt)))) ; the nth looks at each item in the line starts at item 0 not 1 (command "TEXT" (list (atof (nth 1 pt))(atof (nth 2 pt))) 2.5 0.0 (nth 4 pt)) ; draw text ; could do add pt number here ) (princ) ) (c:james) ; run the program remove if want to run manually load program then type james Edited September 2, 2023 by BIGAL Quote Link to comment Share on other sites More sharing options...
CyberAngel Posted September 5, 2023 Share Posted September 5, 2023 If your coordinate information is in Excel, you can export (Save As) that data to a CSV file. The LISP function Big Al gave you should let you import the CSV data as points and text. For more help, give us more information about what you're trying to do. Welcome to the forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.