Message 1 of 15
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I am trying to georeference tiff images with a lisp, I found this lisp
; ####################################################################### ; ; Inserta una imagen TIFF georreferenciada ; ; Autor: Francisco Navarrete Mandly ; Noviembre 2001 ; ; ####################################################################### (defun C:INSIMG (/ fichtif fichtfw fp ex ey rx ry x0 y0 ent info dimx dimy) ; Pide ficheros (if (not (setq fichtif (getfiled "Imagen a Insertar" "*" "tif" 2))) (exit)) (setq fichtfw (strcat (substr fichtif 1 (- (strlen fichtif) 2)) "fw")) ; Lee parametros (setq fp (open fichtfw "r")) (setq ex (atof (read-line fp))) (setq rx (read-line fp)) (setq ry (read-line fp)) (setq ey (atof (read-line fp))) (setq x0 (atof (read-line fp))) (setq y0 (atof (read-line fp))) (close fp) (setq ey (* ey -1)) ; Inserta imagen (command "._-IMAGE" "" fichtif (list x0 y0) 1.0 0.0) ; Modifica posicion (setq ent (entlast)) (setq info (entget ent)) (setq nx (cadr (assoc 13 info)) ny (caddr (assoc 13 info))) (setq dimx (* nx ex) dimy (* ny ey)) (setq y0 (- y0 dimy)) (setq info (subst (list 10 x0 y0 0.0) (assoc 10 info) info)) ; Modifica tamaño (setq info (subst (list 11 ex 0.0 0.0) (assoc 11 info) info)) (setq info (subst (list 12 0.0 ey 0.0) (assoc 12 info) info)) (entmod info) (princ) )
But when I am trying to insert a tiff image I get an error: "Stringp nil"
I have been trying to fix the code but I don't know
Thanks all.
Solved! Go to Solution.