BIGAL Posted January 26, 2021 Posted January 26, 2021 I am looking for the simplest way to display an image on the screen for say 2 seconds then close, no user interaction, the image is a 3d perspective. It is to display on 1st load of a lisp. I am trying to only use lisp. And not any external coding opendcl etc. Or a .Net solution this may be the only way though in the end. I tried making a slide and use vslide a simple method, ignoring slide making problems. Tried it as command mode and calling a script. I have it working on and off 1st time will work then just does the delay no image. I am not sure if its a graphics card problem, using NVIDIA GEOFORCE GTX 1050. vslide "D:/1W/abc def.sld" DELAY 5000 Regen Quote
jonathann3891 Posted January 26, 2021 Posted January 26, 2021 I know this is possible with OpenDCL Quote
dan20047 Posted January 26, 2021 Posted January 26, 2021 Probably not what you're looking for, but if you can recode your image as vectors then use grdraw? example for text - http://www.lee-mac.com/grtext.html Lee's remarks mentions help from Elpanov Evgeniy for the method of vector encoding. I assume that meant selected geometry was converted to a vector list. Check theswamp.org Quote
Lee Mac Posted January 26, 2021 Posted January 26, 2021 2 hours ago, dan20047 said: Lee's remarks mentions help from Elpanov Evgeniy for the method of vector encoding. I assume that meant selected geometry was converted to a vector list. Since the vectors were generated for a fixed-width font for which each character was 10px wide, the X & Y pixel coordinates were encoded as a single integer with the X coordinate value represented by the units, and the Y coordinate value represented by the tens & hundreds. Quote
rlx Posted January 26, 2021 Posted January 26, 2021 (defun Splash (s w / sn dcl-fn dcl-fp dcl-id x y) (vl-load-com) (cond ((not (= (type s) 'STR))(princ (strcat "\nInvalid slide name : " (vl-princ-to-string s)))) ((not (setq sn (findfile s))) (princ (strcat "\nSlide not found : " (vl-princ-to-string s)))) ((not (= (type w) 'INT))(princ (strcat "\nInvalid value for delay : " (vl-princ-to-string w)))) ((not (and (setq dcl-fn (vl-filename-mktemp ".dcl")) (setq dcl-fp (open dcl-fn "w")))) (princ "\nUnable to show slide")) (t (write-line (strcat "im:dialog{label=\"Bigal\";:image_button{key=\"im\";color=-2;width=100;" "aspect_ratio=1;allow_accept=true;is_default=true;}}") dcl-fp) (close dcl-fp)(gc)(setq dcl-id (load_dialog dcl-fn)) (new_dialog "im" dcl-id)(setq x (dimx_tile "im") y (dimy_tile "im"))(start_image "im")(slide_image 0 -15 x y sn)(end_image) (wait w)(term_dialog)(if dcl-id (unload_dialog dcl-id))(if (and dcl-fn (findfile dcl-fn))(vl-file-delete dcl-fn)) ) ) (princ) ) (defun wait (sec / stop) (setq stop (+ (getvar "DATE") (/ sec 86400.0))) (while (> stop (getvar "DATE")))) (Splash "d:/Temp/Lisp/Cad-tutor/Bigal/Furntable.sld" 5) Quote
ronjonp Posted January 26, 2021 Posted January 26, 2021 You could create an HTA script. Open using wscript and within the HTA have a timer set to close the widow after X milliseconds. I did this messing around about 10 years ago but unfortunately I can't give you an example. Quote
BIGAL Posted January 26, 2021 Author Posted January 26, 2021 (edited) Thank you Rlx the answer is the (term_dialog) something I did not know about as I have said before always learning and finding new commands. Thanks Also Ronjonp. The only issue I have now is it does not seem to like the size of the slide as I made a slide of an image its is quite large will play more with that side of things. I may have to sacrifice a shaded image. But it is working. Edited January 26, 2021 by BIGAL Quote
GLAVCVS Posted July 11, 2024 Posted July 11, 2024 Hi One day I came to this forum looking for an alternative to 'dos_splash'. But I didn't find a satisfactory solution for me. So I decided to write something that looked close enough. I leave the result here for whoever needs it. miSplash.lsp Quote
GLAVCVS Posted July 11, 2024 Posted July 11, 2024 1 hour ago, GLAVCVS said: Hi One day I came to this forum looking for an alternative to 'dos_splash'. But I didn't find a satisfactory solution for me. So I decided to write something that looked close enough. I leave the result here for whoever needs it. miSplash.lsp 6.36 kB · 1 download Of course: the image must be in one of the formats supported by AutoCAD Quote
GLAVCVS Posted July 12, 2024 Posted July 12, 2024 Hello again Someone told me that this code does not work well with the 2021 version. So it may not work with later versions. I have designed and tested the code in the 2015 version and it has worked well for me. I would appreciate it if anyone who has tried it and found any problems leaves a comment about it. I am reviewing the operation in the 2021 version and I have verified that: -registration key "ImageDetachMode" does not exist: it must be created -When deleting the image with 'vla-delete' it seems that it is also deleted in the dictionary (this is new, I think). -The image loads but cannot be displayed on the screen. It would be good if, knowing your experience, we could design code that works with all versions of AutoCAD. I await your comments Quote
marko_ribar Posted July 12, 2024 Posted July 12, 2024 (edited) It works for me in BricsCAD, but in AutoCAD 2022 not... I took some time to make the code more pretty, so I'll attach it here... miSplash.lsp Edited July 12, 2024 by marko_ribar Quote
GLAVCVS Posted July 12, 2024 Posted July 12, 2024 Thanks for that, Marko. I have found that in newer versions of AutoCAD, dynamic input makes it very difficult to regenerate graphics while the code is running. If you call the function from dynamic input it won't work. But if you put focus on the command line it will probably work. One way to disable dynamic input is to set 'DYNMODE' to 0. But if this is done from within the code, it will not work: it must be done BEFORE executing the code. Therefore it seems that the solution could be to transfer the focus, at run time, to the command line Quote
GLAVCVS Posted December 27, 2024 Posted December 27, 2024 Hello again Best wishes to everyone for this coming 2025. I think I found a definitive solution to emulate the 'dos_splash' function without having to resort to any external library. I'm leaving it here, in case it's useful to anyone. miSplash.lsp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.