Search the Community
Showing results for tags 'lm:directoryfiles'.
-
Incorrect Data Type? Using "LM:directoryfiles" function
Ross Dunkley posted a topic in AutoLISP, Visual LISP & DCL
Hi, I am running into problems with my program when I try to use the output from the "LM:directoryfiles" function. If I try to use the output from the "LM:directoryfiles" function (findjgw) I am getting the following error... error: bad argument type: (or stringp symbolp): ("L:\\DESIGN\\2018\\2018-290 Atkinson Crescent, ALDINGA BEACH\\Work in Progress CAD\\References CAD\\2018-290 Image\\2018-290 Image.jgw") (findjgw) returns the following "L:\\DESIGN\\2018\\2018-290 Atkinson Crescent, ALDINGA BEACH\\Work in Progress CAD\\References CAD\\2018-290 Image\\2018-290 Image.jgw" and if I enter this actual text string in my code it works, but it wont when referring to the variable (findjgw). Is it because I am trying to use a list as a string? If I only use the first element of a list are they not the same thing? Snippet that seems to be thew problem... ; Search Project "References CAD" Folder for ".jgw" files and Count how many... (setq rcpath (strcat sfpath "Work in Progress CAD\\References CAD\\")) (setq findjgw (LM:directoryfiles rcpath "*.jgw" T)) (setq countjgw (length findjgw)) (cond ( (= countjgw 1) (princ "\nOnly 1 Georeferenced Aerial Image exists in 'References CAD folder'") (setq jpgname (vl-string-subst "jpg" "jgw" findjgw)) (setq intFileDia (getvar "filedia")) (setvar "filedia" 0) (command "mapiinsert" jpgname "") (command "zoom" "e") (setvar "filedia" intFileDia) (princ "\nGeoreferenced Aerial Imagery Inserted...") ) ( (> countjgw 1) (alert "More than 1 Georeferenced Aerial Image exists in 'References CAD folder'...\nPlease select file to insert...") (command "mapiinsert") (princ) ) (t nil) );End Cond I will attach the full copy also. Regards, Ross. ONK Mapiinsert 4.lsp- 3 replies
-
- lm:directoryfiles
- incorrect data type
- (and 3 more)