problem with slideimage

Started by honkinberry, June 23, 2010, 05:09:18 PM

Previous topic - Next topic

honkinberry

I'm having problems with getting the SlideView_SlideImage to work.

I'm currently calling it from the form's OnInitialize event, passing a slide from a slide library to it.
What am I doing wrong?

Code (autolisp) Select

(setq imgwidth (dcl_Control_GetWidth proj_form_slidex)
imgheight (dcl_Control_GetHeight proj_form_slidex)
symx "DIM"
) ; setq
(dcl_SlideView_SlideImage proj_form_slidex
(list (list 0 0 imgwidth imgheight "myslib.slb" symx))
) ; slideimage
) ; foreach


owenwengerd

Your syntax looks correct. If you can upload a simple sample project that demonstrates the problem, I'll have a look under the debugger. Make sure you describe the steps and any error messages and/or what the problem is.

honkinberry

Here you go.
Symptoms pretty obvious, slide not displaying.
Thanks for looking at this!

--J

honkinberry

The problem seems to be from calling it from the OnInitialize.
When I later swap out the slide to a different one when the user clicks a button, that works fine.

--J

owenwengerd

Which version of the runtime are you using?

owenwengerd

I think I see the problem. SlideView_SlideImage paints a slide, which is only possible when the control is visible and there's something to paint on. The control is not yet visible during OnInitialize, so the call fails. See if SlideView_Load works better.

honkinberry


DW

Hi,
I'm having problems with dcl_SlideView_Load in 6.0.0.28.  It doesn't work as it did in 5.1.2.3 with slide library files but works fine when you load an individual slide.  It doesn't make a difference whether called from within the OnInitialize function or not.

Here is my slide loading function...

Code (autolisp) Select
(defun update_block-slides (start highlight / ct)
   (setq ct 0)
   ;;add slides to slide views
   (repeat 12
     (if (nth start blklist) ;if not at the end of the list
(if (not (dcl_SlideView_Load
  (vl-doc-ref (read (strcat "pm_blkins_s" (itoa ct))))
  (strcat p_path "\\plants\\" (vl-filename-base library) ".slb")
  (nth start blklist)
)
   )
 (dcl_SlideView_Load
   (vl-doc-ref (read (strcat "pm_blkins_s" (itoa ct))))
   (strcat p_path "\\plants\\" (nth start blklist) ".sld")
 );;try to load single slide if found
)
(dcl_SlideView_Clear ;else clear everything painted before
 (vl-doc-ref (read (strcat "pm_blkins_s" (itoa ct))))
)
     )
     ;;remove highlight from every slide
     (dcl_SlideView_SetHighLight
(vl-doc-ref (read (strcat "pm_blkins_s" (itoa ct))))
7
     )
     (setq ct  (1+ ct)
   start (1+ start)
     )
   )
   ;;highlight selected slide in red
   (dcl_SlideView_SetHighLight
     (vl-doc-ref
(setq lastclicked (read (strcat "pm_blkins_s" (itoa highlight))))
     )
     1
   )
 )


Thanks,
David

owenwengerd

What exactly is not working? Any error messages?

DW

No error messages at all - just a blank control when the dialog is loaded in 6.0.0.28. 

I've attached a cut down version of the code and dialog together with a slidelibrary demonstrating the problem.

owenwengerd

The problem is that the .slb file header does not exactly match the specification. How did you create the .slb file? I see that AutoCAD seems to ignore the incorrect file header and display the slides anyway, so I'm inclined to change the OpenDCL code to do the same. On the other hand, it's risky to blithely ignore errors and barge ahead anyway. It would be useful to know how prevalent the problem is.

DW

Thanks for identifying the problem, I've rebuilt the slide library using Slidelib.exe and it now displays in the 6.0.0.28 dialog correctly.  I had earlier used a program called Etecad Slide Manager and also tried a command line app. called Makeslb.exe - which also creates libraries which don't display.  So will stick to the AutoCAD utility in the future.   

jmaeding

wow, good catch on that Owen.  Slides are nice in that they are vector, so can be zoomed.
I did a block manager app that makes a slide for every dwg in a folder, much better than thumbnails so thanks for supporting them.

Oak3s

I am having a similar problem. I get a blank control.

Code (autolisp) Select
(dcl_SlideView_Load SA-Block-Insertion_Form1_SlideView1 "P:/SA-Drafting/Blocks/Slide_images/SA-Anchorbolt.sld")

AutoCAD2011
OpenDCL Runtime [6.0.0.28]



owenwengerd

Can you send me files to reproduce the problem?