Author Topic: Showing a slide file from a dcl button?  (Read 8152 times)

0 Members and 1 Guest are viewing this topic.

Brick_top

  • Guest
Showing a slide file from a dcl button?
« on: November 07, 2014, 04:21:30 AM »
Does anyone know if it is possible?

I'm calling the vslide command from a dcl button. I would like the dcl menu to stay visible while the slide is active.

thanks

edit - I can prepare a sample code and files but I just wanted to know if anyone knows if this is possible.
If the files and code is needed I will post it.

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #1 on: November 07, 2014, 04:59:23 AM »
ok I prepared some test files

Here is the content of the zip file and what to do

test.lsp -> put this file in the autocad search path or else the dcl file it creates won't work

Lar Pias_18_08_2014.dwg
Slides - Folder with the slides I want to see from the dcl

put the dwg file and the slides folder next to it. (just as it unzips)

open the dwg file and load the test.lsp

type test to run the command. Only the First "Slide 1" button has the code I thought could work, so only click on that. In my computer autocad freezes.

thanks


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Showing a slide file from a dcl button?
« Reply #2 on: November 07, 2014, 05:08:11 AM »
Why don't you use an image tile inside the dialog to display the slide?

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #3 on: November 07, 2014, 05:09:53 AM »
Never thought about it.

the slides I want to see are the size of the autocad model screen. Will they be visible inside a menu?

the number of slides I want to see are variable and the buttons are created according to that number.

I'm hoping this isn't a problem


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Showing a slide file from a dcl button?
« Reply #4 on: November 07, 2014, 06:46:14 AM »
I'm hoping this isn't a problem
No. Just look at the slide_image function.

hermanm

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #5 on: November 07, 2014, 09:55:33 AM »
Yes, this is possible.

Example here:

http://www.tktn.com/utilities/tkutil.htm

NJUSTIFY.ZIP

Note:

It is also possible to do this with OpenDCL.

http://opendcl.com/wordpress/

d2010

  • Bull Frog
  • Posts: 326
Re: Showing a slide file from a dcl button?
« Reply #6 on: November 08, 2014, 09:32:10 AM »
Does anyone know if it is possible?

YOU TRY , MY HAPPY SUDOKU-vlx (OR DCL GAMES) -ONLY  acad->exe
YOU ENTER THE COMMAND  Q2<ETER>
you click  any cell  on grid 9x9  with  mouse.
IF YOU NEED , the  programe-fas or des
 for other  platforms (BrisCAD,NnoCAD),  THEN 
you contact  user-admin..


Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #7 on: November 10, 2014, 05:02:44 AM »
Sorry I didn't have access to a computer during the weekend.

I'll try these options you guys showed me! thanks

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #8 on: November 10, 2014, 05:10:32 AM »
Yes, this is possible.

Example here:

http://www.tktn.com/utilities/tkutil.htm

NJUSTIFY.ZIP

Note:

It is also possible to do this with OpenDCL.

http://opendcl.com/wordpress/

Hi herman, I tried your routine but I think I didn't explain myself very well.

What I want to do is to show slide files in the modelspace when pressing buttons on a dialog.

but with what I have currently autocad freezes. I uploaded some test files up there if anyone wants to check.

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #9 on: November 10, 2014, 05:39:25 AM »
Does anyone know if it is possible?

YOU TRY , MY HAPPY SUDOKU-vlx (OR DCL GAMES) -ONLY  acad->exe
YOU ENTER THE COMMAND  Q2<ETER>
you click  any cell  on grid 9x9  with  mouse.
IF YOU NEED , the  programe-fas or des
 for other  platforms (BrisCAD,NnoCAD),  THEN 
you contact  user-admin..

Very cool game! I see the slides changing at least its confirmation that it works inside a dcl dialog! thank you

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Showing a slide file from a dcl button?
« Reply #10 on: November 10, 2014, 06:20:32 AM »

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #11 on: November 11, 2014, 06:39:41 AM »
Wow Elpanov that is absolutely amazing to me :o

but pardon my ignorance as I don't understand what does it do.


Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #12 on: November 12, 2014, 06:24:10 AM »
Hi,

I couldn't get it to work with the regular vslide command issued from the dcl button.

So I now have the slides in the dialog and I'm happier because I can zoom and move.

thanks for all your help guys

d2010

  • Bull Frog
  • Posts: 326
Re: Showing a slide file from a dcl button?
« Reply #13 on: November 12, 2014, 03:35:47 PM »
Hi,
So I now have the slides in the dialog and I'm happier because I can zoom and move.

thanks for all your help guys

You  view my movies youtube-clone-html;:
http://www.puiubrat.3x.ro/carto3A/bya_topoltopt.files/lspfn_ddvslide.html
If you need  the  source.. then you found  url-s..

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #14 on: November 13, 2014, 04:22:29 AM »
ei d2010 that is much nicer than what I have, I'm doing it with buttons!

I have to search how to do it with those sliders.

very cool!

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #15 on: November 13, 2014, 04:45:00 AM »
If you could show me the source for the sliders would be cool

the way you handle the z is much better than mine...

mine just zooms "anchored" from the top left corner :(
« Last Edit: November 13, 2014, 04:50:11 AM by Brick_top »

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #16 on: November 13, 2014, 05:22:54 AM »
I think I'm almost there.

I'm going to do the zoom part to see if I have any problems

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #17 on: November 13, 2014, 05:56:29 AM »
hum...

I have the X and Y figured out but can't do the zooming part

does it have to do with changing the width and height of the slide_image function?

how can I make it zoom based on the center of the slide?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Showing a slide file from a dcl button?
« Reply #18 on: November 13, 2014, 10:08:53 AM »
Maybe this can help you:
Code - Auto/Visual Lisp: [Select]
  1. (defun KGA_Dcl_Image_FillSlide (tile slide scaleFactor lineColor backColor / xSize xSizeScaled ySize ySizeScaled)
  2.   (setq xSize (dimx_tile tile))
  3.   (setq ySize (dimy_tile tile))
  4.   (setq xSizeScaled (fix (* (- xSize 4) scaleFactor)))
  5.   (setq ySizeScaled (fix (* (- ySize 4) scaleFactor)))
  6.   (set_tile tile "") ; Remove text.
  7.   (start_image tile)
  8.   (fill_image 0 0 xSize ySize lineColor)
  9.   (fill_image 1 1 (- xSize 2) (- ySize 2) backColor)
  10.   (if slide
  11.     (slide_image (/ (- xSize xSizeScaled) 2) (/ (- ySize ySizeScaled) 2) xSizeScaled ySizeScaled slide)
  12.   )
  13. )

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #19 on: November 13, 2014, 11:01:48 AM »
cool thanks! I don't have more time today but I will look into it tomorrow

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Showing a slide file from a dcl button?
« Reply #20 on: November 13, 2014, 12:05:41 PM »
Note: I only use the function with a scale factor set to 1 or smaller.

d2010

  • Bull Frog
  • Posts: 326
Re: Showing a slide file from a dcl button?
« Reply #21 on: November 13, 2014, 12:51:54 PM »
cool thanks! I don't have more time today but I will look into it tomorrow

SldView exists minimum  five ways:
a)you  use the  great opendcl.arx  for blocks
b)you load image sld from external  file on disk
c) you convert  "SLD file" to autolisp-script-source
     The  autolisp-script-source draw SLD-content in DCL-dialog boxes
         www.youtube.com/watch?v=91_DFjN6ucs
d)you convert  "SLD file" to autolisp-source-grdraw
         www.youtube.com/watch?v=91_DFjN6ucs
e) convert SLD to MsWord.Doc. MsWord.exe draw SLD file inside .DOC
    www.youtube.com/watch?v=91_DFjN6ucs
f)you use  the command / classic mode
    (command "_.VSLIDE"  "filename-on-disk.sld")
    (command  "_.REDRAW")   ;; clear the screen
    //    Note the syntax on the VSLIDE command. You specify the library
    //    name, then the slide name in parenthesis.
    //                 example: "ACAD(ANSI31)"
    (command "_.MSLIDE" )  ;; you make the file .SLD from current-screen
thank you.......
   
« Last Edit: November 13, 2014, 01:20:38 PM by d2010 »

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #22 on: November 14, 2014, 04:27:59 AM »
Note: I only use the function with a scale factor set to 1 or smaller.

thanks a lot I have it working now.

its not possible to reduce the zoom is it? it only accepts integers right?


Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #23 on: November 14, 2014, 04:44:23 AM »
Note: I only use the function with a scale factor set to 1 or smaller.

Hi I have a slider to control the scale factor, but I also have other two sliders to control x and y positions.

for which I use this function

Code: [Select]
(defun upDateImage_sldv (key);direita
  (start_image key) ;iniciar a imagem
  (fill_image 0 0 width height 250) ;width and height already defined
  (slide_image (atoi slideh) (atoi slidev) width height alslide) ;slideh slidev values from sliders, alslide already defined
  (end_image)
  );defun

I also have modified your function

Code: [Select]
  (defun KGA_Dcl_Image_FillSlide (key /  xSizeScaled ySizeScaled)
  (setq xSizeScaled (fix (* (- width 4) (atoi zoomsld)))); zoomsld value from slider
  (setq ySizeScaled (fix (* (- height 4) (atoi zoomsld))))
  (start_image key)
  (fill_image 0 0 width height 250)
  (if alslide ; alslide already defined when dialog starts
    (slide_image (/ (- width xSizeScaled) 2) (/ (- height ySizeScaled) 2) xSizeScaled ySizeScaled alslide)
  )
  (end_image)
  )

the problem I'm having now is that when I use my other function for the x and y the image resets to starting position. I understand I need to incorporate the two functions right? I'm going to try to do it.. if you could give me a hint..
« Last Edit: November 14, 2014, 05:33:09 AM by Brick_top »

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #24 on: November 14, 2014, 05:15:04 AM »
I think it is working now

I changed my function and yours to this

Code: [Select]
(defun upDateImage (sldName key)
  (setq width (+ (dimx_tile key) (atoi slideh))) ;largura da imagem
  (setq height (+ (dimy_tile key) (atoi slidev))) ;altura da imagem
  (start_image key) ;iniciar a imagem
  (fill_image 0 0 width height 250) ;limpar o fundo
  (slide_image (atoi slideh) (atoi slidev) width height sldName) ;apresentar a imagem
  (end_image)
  );defun

(defun KGA_Dcl_Image_FillSlide (key / xSize xSizeScaled ySize ySizeScaled)
  (setq xSizeScaled (fix (* (- width 4) (atoi zoomsld))))
  (setq ySizeScaled (fix (* (- height 4) (atoi zoomsld)))) 
  (start_image key)
  (fill_image 0 0 width height 250)
  (if alslide
    (slide_image
      (/ (- (+ width (atoi slideh)) xSizeScaled) 2)
      (/ (- (+ height (atoi slidev)) ySizeScaled) 2)
     xSizeScaled ySizeScaled alslide)
  )
  (end_image)
  )

And I just called your function from all the sliders, X, Y, and zoom

Seems to be working as I wanted it to


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Showing a slide file from a dcl button?
« Reply #25 on: November 16, 2014, 05:10:34 AM »
Your version of KGA_Dcl_Image_FillSlide uses variables (width, height, zoomsld, slideh, slidev and alslide) that are defined in another function. You have turned a library function in to a function that is specific to your application. This is not a problem, just something to bear in mind.

It seems possible create a single function instead of upDateImage and KGA_Dcl_Image_FillSlide.

Brick_top

  • Guest
Re: Showing a slide file from a dcl button?
« Reply #26 on: November 17, 2014, 03:37:52 AM »
Your version of KGA_Dcl_Image_FillSlide uses variables (width, height, zoomsld, slideh, slidev and alslide) that are defined in another function. You have turned a library function in to a function that is specific to your application. This is not a problem, just something to bear in mind.

yes, thank you I understand this.

Quote
It seems possible create a single function instead of upDateImage and KGA_Dcl_Image_FillSlide.

It probably is, but what I have now is working, I'm allways in this place asking questions...

thanks a lot for your help