Jump to content

connection between listbox and slides


wesleyaqua

Recommended Posts

Although I have no means to check it, if your blocks are saved in a version

prior to 2013, it should work.

 

For example your test library seems to be saved in an older version

cause it works for me.

 

ymg

 

 

ymg

 

I just found a bug.

when you are in the list en you select the image name just at the other screen (that would be on the previous page as last)

he doesn't go back to the page before (he doesn't "select" an image at that time")

 

Welsey

Link to comment
Share on other sites

  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

  • ymg3

    24

  • wesleyaqua

    24

  • Snownut

    12

  • AIberto

    6

Top Posters In This Topic

Posted Images

wesleyaqua,

 

Indeed there is a bug there. Do the following change i the action_tile:

 

(action_tile "blocknameslist" "(setq idx (+ (atoi $value) 1))
                                  (mode_tile (strcat \"sld\" (itoa (- (atoi (substr SlideRef$ 4))(* Pg_No# 20)))) 4)
                                  (setq SlideRef$ (strcat \"sld\" (itoa idx)) Pick t)
                                  (cond
                                     ((> idx (+ (* Pg_No# 20) 20)) (done_dialog 4))
                                     ((< idx (* Pg_No# 21)) (done_dialog 3))
                                     (t (setq idx (- idx (* Pg_No# 20)))
                                        (mode_tile (strcat \"sld\" (itoa idx)) 4))
                                  )")  

 

In the second clause of the cond we should compare (

we need 21 instead of 20.

 

ymg

Link to comment
Share on other sites

hi bigal.

wel we already uses the mnu way but we are going to revisted the whole library.

and with this lsp its easy to update the library. also we made the icons a bit bigger and the text space also.

thx for the info anyway

 

(My $0.02)

Edit the acad.dcl and add width = 25; or another value that satisfies.

 

 

before:

 

478.jpg

 

 

after:

 

479.jpg

 

 

 

....................
....................
.................... 
acad_icon: dialog {
       key = "label";
       initial_focus               = "listbox";
       : row {
           : list_box {
               width               = 20;
               height              = 21;
               fixed_height        = true;
               key                 = "listbox";
               allow_accept        = true;
           }
           : column {
               : row {
                   : icon_image {
                       key         = "icon1";
                       [b][color=red]width = 25;[/color][/b]                    }
                   : icon_image {
                       key         = "icon2";
                       [b][color=red]width = 25;[/color][/b]
                   }
                   : icon_image {
                       key         = "icon3";
                       [b][color=red]width = 25;[/color][/b]

                   ....................
                   ....................
                   ....................
                   ....................
                   ....................

                   : icon_image {
                       key         = "icon18";
                       [b][color=red]width = 25;[/color][/b]
                   }
                   : icon_image {
                       key         = "icon19";
                       [b][color=red]width = 25;[/color][/b]
                   }
                   : icon_image {
                       key         = "icon20";
                       [b][color=red]width = 25;[/color][/b]
                   }
               }
/*
*              : row {
*                  : icon_image {
*                      key         = "icon21";
*                  }
*                  : icon_image {
*                      key         = "icon22";
*                  } 
....................
....................
....................

Link to comment
Share on other sites

As I have mentioned my first ignored post by you , here is a sample test of what I indicated to .

 

NOTE : Don not forget to add two slide images with their path .

(defun c:Test (/ f d id)
 ;;    Tharwat 02. Apr. 2014        ;;
   ...

 

Be very careful with this code - Your code will generate a new DCL file for every single use!

Check your AppData\\Local\\Temp folder - you will probably see quite a few $VL~~001.dcl files...

Link to comment
Share on other sites

hi Lee mac and gp

 

nice to know but now it already works:).

but can be useful in the future.

can i also adjust like the lineweight of flatshot so its not 0,0 but default instead ?

Link to comment
Share on other sites

  • 1 year later...

@Snownut

Sir, nice job !:thumbsup:

 

Many masters to involve in it ! Great! :thumbsup:

 

The Block lib ,Many people need it.

 

Looking forward to the perfect final version .

Link to comment
Share on other sites

Here is a final working version.....l, since all code does not fit in one post I just attached the file.[ATTACH]53986[/ATTACH]

 

 

Dear Snownut .Thanks a lot .

Two questions , 1. Every time start ,must select library directory? 2.In dialog, the block does not preview ?

Link to comment
Share on other sites

Alberto,

 

To correct question #1 replace line #319 in the code with this ;

 

 (setq dirtxt (if $userblocks $userblocks (setq $userblocks (vl-filename-directory (getfiled "Select Library Directory:" "C:" "dwg" 16))))

 

This will set the $userblocks variable to the chosen folder, you will not be able to update/change the userblock folder until you either set the variable to nil or close the drawing and reopen.

You could also use this line in the acad.lsp file to set the folder location when ACAD starts;

 

setq $userblocks "c:\\enter directory location here"

Link to comment
Share on other sites

Alberto,

 

To correct question #1 replace line #319 in the code with this ;

 

 (setq dirtxt (if $userblocks $userblocks (setq $userblocks (vl-filename-directory (getfiled "Select Library Directory:" "C:" "dwg" 16))))

 

This will set the $userblocks variable to the chosen folder, you will not be able to update/change the userblock folder until you either set the variable to nil or close the drawing and reopen.

You could also use this line in the acad.lsp file to set the folder location when ACAD starts;

 

setq $userblocks "c:\\enter directory location here"

 

Dear Snownut . Thank you again.

What about question 2 ?

 

No preview

 

2015-4-26 23-48-21.jpg

Link to comment
Share on other sites

wesleyaqua,

 

be aware that the method of reading the drawing to get the thumbnail

work only up to release 2013. Up to there the preview image was stored

as a bmp image.

 

From 2013 the png format is used, and szmaicy's code does not handle it.

 

ymg

 

It would appear that the last time the drawings where saved was with a newer version of ACAD, I opened and saved with 2004 and all worked fine.

Link to comment
Share on other sites

Although it may be very odd, but I had the same problem not showing previews of dwgs... However I've tried to initialize VLIDE beforehand and to my surprise it worked... So maybe try this modified version... I've also formatted it better and change little end of code as also error handler and added automatic initialization of VLIDE... Strange, but on my A2009 it doesn't work with this trick... So try it with newer releases of ACAD software...

 

HTH, M.R.

USERBLOCK.LSP

Link to comment
Share on other sites

Although it may be very odd, but I had the same problem not showing previews of dwgs... However I've tried to initialize VLIDE beforehand and to my surprise it worked... So maybe try this modified version... I've also formatted it better and change little end of code as also error handler and added automatic initialization of VLIDE... Strange, but on my A2009 it doesn't work with this trick... So try it with newer releases of ACAD software...

 

HTH, M.R.

 

Thanks marko! :thumbsup:

Link to comment
Share on other sites

Although it may be very odd, but I had the same problem not showing previews of dwgs... However I've tried to initialize VLIDE beforehand and to my surprise it worked... So maybe try this modified version... I've also formatted it better and change little end of code as also error handler and added automatic initialization of VLIDE... Strange, but on my A2009 it doesn't work with this trick... So try it with newer releases of ACAD software...

 

HTH, M.R.

 

Hi marko , I test with "acad2007, 2010, 2013 " , It's still can't preview.

 

Just only pop up "vlide" when "userblock" start .

Link to comment
Share on other sites

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