Jump to content

Recommended Posts

Posted

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

 

 

 

 

Posted

I know this is possible with OpenDCL

Posted

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 

Posted
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.

Posted


(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)

Posted

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.

Posted (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 by BIGAL
  • 3 years later...
Posted

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

Posted
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

 

Posted

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

Posted (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 by marko_ribar
Posted

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

  • 5 months later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...