sammyg Posted May 8, 2015 Posted May 8, 2015 hi i have a lisp that dose not attach the hyperliks to the block on first run it dos on the 2nd run evan after i deleat the blooks to start agen. the issue sems to be in the hyperlink comand and it is not finding the block at the location some help world be great:P (-hyperlink Enter an option [Remove/Insert] : i Enter hyperlink insert option [Area/Object] : o Select objects: 25722.21,65506.921,625.235 0 found Select objects: Error in selection.) my code (defun C:lmg() ;;;;;; READING CSV ;;;;;;;;;;;;;;; (setq gf (getfiled "Select CSV File" "" "csv" 16)) ;slect file (setq f (open gf "r")) ;open file for reading (while (setq row1 (read-line f)) ;reads next line of csv (foreach line data ;do to each line (princ "\n " )(prin1 line)"") ;grab next line ? ;;;;;; PONT ;;;;;;;;;;;;;;;;;;;;;;;; (setq pont1 (vl-string-position (ascii ",") row1 nil )) ;finds first (,) (print pont1) (setq pont2 (substr row1 pont1)) ;grabs evrythink in from first (,) to end (print pont2) (setq pont3 (substr pont2 3)) ;pont shift fix (print pont3) ;prints results ;;;;;; EASTING,NORTHING,HIGHT ;;;;;; (setq enz1 (vl-string-position (ascii ",") pont3 nil T)) ;finds last (,) (print enz1) (setq enz2 (substr pont3 1 enz1)) ;grabs evrythink in from last(,) to start (print enz2) ;prints results ;;;;;; PHOTO FILE ;;;;;;;;;;;;;;;;;; (setq file1 (vl-string-position (ascii ",") pont3 nil T)) ;finds last (,) (print file1) (setq file2 (substr pont3 file1)) ;grabs evrythink in from last (,) to end (print file2) (setq file3 (substr file2 3)) ;pont shift fix (print file3) ;prints results (setq file4 "photos/") ;set's "photos/" as a string (setq file5 (strcat file4""file3)) ;combinds string (file 4 & 3) (print file5) ;prints results (princ "\n") ;go to next line ;;;;;; HYPERLINK ;;;;;;;;;;;;;;;;;;; (COMMAND "_insert" "Photo Node" (strcat enz2) "1" "1" "0") ;inserts photo node (princ "\n") (command "regenall") ;go to next line (COMMAND "-hyperlink" "i" "o" (strcat enz2"") "" (strcat file5"") "" (strcat file3"")) ;add's hyperlinks photos ) ;close while (princ) ) ;close defun Book2.csv Quote
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.