TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Cawaugh on August 29, 2007, 03:07:34 PM

Title: image command not working from lisp
Post by: Cawaugh on August 29, 2007, 03:07:34 PM
Maybe someone can explain why I can type in the commands in the code below but when I try to run the code,
it tells me that it cannot fine command image.

(command "-image" "Attach" "C:/Steves_Tiffs/somefilename.tiff" "0.00,0.00" "1" "0")

This is driving me nuts.  :ugly:
All I want to do is attach a tiff file for each of my drawings in a list.
I using AutoCAD 2006.

Any help would be appreciated.  :-)
Title: Re: image command not working from lisp
Post by: ronjonp on August 29, 2007, 03:35:43 PM
I tried it here and it worked.
Title: Re: image command not working from lisp
Post by: CAB on August 29, 2007, 03:45:50 PM
Worked for me too.
What is returned when you enter this at the command line?
Code: [Select]
(findfile "C:/Steves_Tiffs/somefilename.tiff")
Title: Re: image command not working from lisp
Post by: CAB on August 29, 2007, 03:46:45 PM
OK, the tiff should be tif :-o
Title: Re: image command not working from lisp
Post by: Cawaugh on August 29, 2007, 09:43:11 PM
OK, the tiff should be tif :-o

The file name in windows is marked .tiff. Anyway, for some reason it does find the file in a "find" but it still cannot recognize the "image" command from lisp.

Time to let it go and try tomorrow.

Thanks!
Title: Re: image command not working from lisp
Post by: Strucmad on August 29, 2007, 09:58:24 PM
Someone else had this problem, .tif file & Acad2006 said the error was 'not supported file type' he had to resave the .tif file as a .gif
I guess the question is - Can you attach this .tif file manually, if not then problem with .tif, if yes then problem with Lisp?

sorry I couldn't be more help :-)
Title: Re: image command not working from lisp
Post by: Strucmad on August 29, 2007, 10:02:23 PM
And yes I'm aware that .tif & .tiff are supposed to be supported :-D
Title: Re: image command not working from lisp
Post by: Cawaugh on August 30, 2007, 07:14:06 AM
The goofy thing is, it works just fine with the tiff's I have IF I manually enter each command.
If I try it in a script or in lisp, no go. It's almost as if I need to first initialize "Raster" then I can run my program.
Maybe something will popup today. Thanks!
Title: Re: image command not working from lisp
Post by: Guest on August 30, 2007, 08:33:00 AM
Maybe someone can explain why I can type in the commands in the code below but when I try to run the code,
it tells me that it cannot fine command image.

Close AutoCAD and restart??!?
Title: Re: image command not working from lisp
Post by: Cawaugh on August 30, 2007, 09:22:31 AM
Close AutoCAD and restart??!?
[/quote]

I'm afraid that doesn't help. I am trying to run a batch of dwgs and adding tif's to them.
When the "image" or "-image" command is run from the code in the original post, it gives me
the error "Command: -image Unknown command "-IMAGE".  Press F1 for help."
But if I type it at the sommad line, it works.
Command: -image
?/Detach/Path/Reload/Unload/<Attach>:

Why would there be a difference?
Frustrating it is! :|
Title: Re: image command not working from lisp
Post by: Guest on August 30, 2007, 09:27:38 AM
What about setting FILEDIA to 0 and trying IMAGEATTACH?  Does that work?

Disregard that.  Looks like the dialog box ALWAYS pops up when using IMAGEATTACH; even when filedia and cmddia are set to 0.


Just a shot in the dark, but what if you try _.-image instead of just -image?
Title: Re: image command not working from lisp
Post by: Cawaugh on August 30, 2007, 02:50:43 PM
Same result. I'm going to check whether I need to initialize Raster fisrt before running the command.
It didn't seem to matter when I did it manually but I'm going to search it out anyway.

Later!
Title: Re: image command not working from lisp
Post by: Guest on August 30, 2007, 02:51:21 PM
Worst case scenario?? - REPAIR
Title: Re: image command not working from lisp
Post by: Cawaugh on August 12, 2008, 10:01:08 AM
 :-DI ended up figuring it out. We had the image command undefined and redefined to run another program.
Just for my situation, I redefined it again so I could run what I need and set it back to the previous setting before closing. Just wanted to close this out with a solution. Thanks everyone! :-)
Title: Re: image command not working from lisp
Post by: ronjonp on August 12, 2008, 10:12:30 AM
This would have fixed it then  :) .-image
Title: Re: image command not working from lisp
Post by: CAB on August 12, 2008, 11:04:01 AM
Note the Red Dot!  .-image

It was hard to see with these old eyes :oops: