Are you running from a registered command handler?
If so, can you show the CommandMethod attribute for it?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5555077@discussion.autodesk.com...
I have written a command that retrieves an image from http://terraserver.microsoft.com/ and inserts it into a drawing. I would like my code to check if an image has already been inserted, and if so, remove the image, then retrieve an updated image. So far I have been unsuccessful in removing the image.
I have tried 3 different ways to remove the image:
SendStringToExecute didn't work because the command doesn't execute until after my command competes.
I tried a library from Tony Tanzillo (http://www.caddzone.com/CommandLine.cs), I called it like this:
ret = CommandLine.Command(".-IMAGE", "Detach", shortImageName);
Finally, I tried calling a Lisp function that is a wrapper for (command "-IMAGE" "D" imageKey)
If I enter the commands on the command line the image detaches, but I'm left with a box where the image was. When the commands are run by my C# code, the image stays attached.
How can I completely remove an image from my drawing in C#?
Thanks,
Frank