View Full Version : Loading image into a DCL file
dfuehrer
2005-10-19, 08:36 PM
Hello all,
I am having a bit of trouble getting a slide to load in the dialog box I am creating. Here is the code I am using to load from the DCL file:
: image {
key = "sld";
height = 4;
width = 20;
color = -15;
}
and here is how I am trying to load it from the lisp:
(setq mySlideName "c:/acad/Xxxx.sld")
(setq myKey "sld")
(defun upDateImage (sldName key)
(upDateImage mySlideName myKey)
(setq width (dimx_tile key))
(setq height (dimy_tile key))
(start_image key)
(fill_image 0 0 width height 0)
(slide_image 0 0 width height sldName)
(end_image)
)
Are there any DCL programmers out there willing to show me the error of my ways?
Thanks in advance,
Don
Hi Don,
While I know next to nothing about DCL, I do know that the code below in red needs to be modified.....
(setq mySlideName "c:/acad/Xxxx.sld")
(setq myKey "sld")
(defun upDateImage (sldName key)
(upDateImage mySlideName myKey);;move this line
(setq width (dimx_tile key))
(setq height (dimy_tile key))
(start_image key)
(fill_image 0 0 width height 0)
(slide_image 0 0 width height sldName)
(end_image)
)
TO HERE
Don
HTH,
Jeff
dfuehrer
2005-10-19, 08:59 PM
Jeff,
I moved the line per your suggestion, it makes no difference. Image still won't display. What benifit does moving that line have anyway?
Don
Jeff,
I moved the line per your suggestion, it makes no difference. Image still won't display. What benifit does moving that line have anyway?
Don
The line was in the definition of the subroutine upDateImage. You were essentially telling the routine to go into a recursive loop that had no exit. When you would run the command, it would continue to repeatedly run the same command.
Don, Looking through the help files I don't see anything that says you can use a color of -15. Could that be the problem?
dfuehrer
2005-10-19, 10:08 PM
it was my understanding that color -15 was the system default color, however I found a better call for it in the DCL code:
color = dialog_background;
this replaces
color = -15;
Even then, still no image. Something is getting lost. I think it is in the lisp. The DCL is pretty straight forward...
Don
Could you repost both working files? I can't even get the dialog to show up with the ones you originally posted.
dfuehrer
2005-10-19, 10:32 PM
OK, but I warn you... The lisp file is long and "fat" at this time. Still working on it. The DCL stuff is at the top of the file under (defun FD(). You will see it.
Please don't laugh too much whaen you see what I am attempting to do here. It all runs on our drawings here at Mayo, although not as I would like it to!
Don
dfuehrer
2005-10-19, 10:39 PM
Oh yeah! FD starts the dialog box!
OK, to get the image to show, albeit not quite right (but you can play with that) move that pesky line:
(upDateImage mySlideName myKey)
to just after this line:
(action_tile "cancel" "(setq ddiag 0)(done_dialog)")
This worked for me. Now you just need to get the thing to display correctly..... ;-)
dfuehrer
2005-10-20, 08:50 PM
miff (sorry I don't know your real name),
Thank you, thank you, thank you!!
That was it.
Took a little fiddling around to get the slide to display properly (like you said), but by gum, it works! We have it loading from a common folder on our network drive. The only thing to make sure of is the have that folder's path set on each work station.
Again, thank you!
Don
PS: any ideas as to keep the background color of the slide from changing from black to white, depending on if lisp is run from model space or paper space??
You're welcome! I'm glad I was able to help, especially since I don't normally fiddle with DCL.....
As for the background color, I don't know. It stays black for me in both MS & PS.....
Jeff
dfuehrer
2005-10-20, 09:39 PM
I think I may have found the solution for that now....
In the lisp portion, the line reads: (fill_image 0 0 width height 0)
I changed it to read: (fill_image 0 0 width height -15) and it seems to work. More testing is required though!
I think the -15 color tells AutoCAD to use the system color for the background, rather than the black/white thing...
Don
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.