Greetings all,
I've created a lisp routine to automatically repath an image that had already been inserted but where the path/filename was incorrect. It works fine but the problem is the image type isn't always the same, i.e. sometimes they are a .TIF and others they are a .CAL.
I included an IF NOT command where if it didn't find filename.CAL then go find filename.TIF. Seems to me I have the syntax correct but apparently not because if it doesn't find the .CAL it just quits. Likewise if I swap the CAL and TIF it will only find the TIF but not the CAL.
Any suggestions?
Thanks,
Keith
I've created a lisp routine to automatically repath an image that had already been inserted but where the path/filename was incorrect. It works fine but the problem is the image type isn't always the same, i.e. sometimes they are a .TIF and others they are a .CAL.
I included an IF NOT command where if it didn't find filename.CAL then go find filename.TIF. Seems to me I have the syntax correct but apparently not because if it doesn't find the .CAL it just quits. Likewise if I swap the CAL and TIF it will only find the TIF but not the CAL.
Any suggestions?
Thanks,
Keith
Code:
(setq imagename (getvar "dwgname"))
(setq imagename (substr imagename 1 (- (strlen imageName) 4)))
(setq filename (strcat (getvar "dwgprefix") imagename ".cal"))
(if (not filename)
(setq filename (strcat (getvar "dwgprefix") filename ".tif"))
)
(command "image" "p" imagename filename)