I am still unable to get slide library images to view?

I am still unable to get slide library images to view?

DC-MWA
Collaborator Collaborator
3,338 Views
26 Replies
Message 1 of 27

I am still unable to get slide library images to view?

DC-MWA
Collaborator
Collaborator

Hello all,

I am back again with this routine. Despite my efforts and input from others I am still unable to get the slide library to display images. It's not the end of the world but having dozens of separate slide files to babysit is kind of a pain.

Wondering if I could get some more input from the gurus to assist me with this.

The lisp and the slide library file are attached. 

Thanks in advance for your assistance.

-DC

0 Likes
Accepted solutions (2)
3,339 Views
26 Replies
Replies (26)
Message 21 of 27

Moshe-A
Mentor
Mentor

@DC-MWA,

 

Ha now i'm getting you, 'repeat command \ repeat image' is all summed up as store the last selected item and retrieve it at start as default - Right?!

 

to store the selected item you can write it to registry immediately after selecting OK:

 

 

(defun save_registry_string (KEY value / reg-key)
  (setq reg-key (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Applications\\mwa\\walladd"))
  (vl-registry-write reg-key KEY value)
 )

usage:

(save_registry_string "selLst_item" selLst_item)

 

 

to retrieve registry value:

 

(defun restore_registry_string (KEY def / reg-key value)
  (setq reg-key (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Applications\\mwa\\walladd"))

  (if (setq value (vl-registry-read reg-key KEY))
   value
   (vl-registry-write reg-key KEY def)
  )
 )

if 'KEY' is not exist, it will be created with 'def' value.

 

 

usage:

(setq selLst_item (restore_registry_string "selLst_item" "0"))

 

 

so you call (restore_registry_string) before opening the dialog box, than inside (while) set tiles default value (that's include populate the list, show your logo, show the image, highlight list item and set the bottom message). when list item is selected\changed respond to it by showing the selected image plus set the bottom message. when OK picked, after you execute (command) call (save_registry_string).

 

Attached the modified lisp 😀

 

enjoy

moshe

 

0 Likes
Message 22 of 27

DC-MWA
Collaborator
Collaborator

Hi Moshe,

Dude... this is awesome!

For some reason it ignores the faster repeat command (command "-walladd") and always uses the long version (command "-walladd" "h" pause "st" (ret_list_item car selLst_item)).

 

Other than that this program is awesome, fast, easy to use.

-dc

0 Likes
Message 23 of 27

Moshe-A
Mentor
Mentor

@DC-MWA ,

 

hallelujah!!!

 

why do you call (command "-walladd") repeat command? isn't it a command to draw a wall?

anyway according the code below you will reach the short version only if no list item is selected $value=""

if you want something else you have to write the exact code. so what is the condition it should run the short version?

 

(if (eq selLst_item "")
 (command "-walladd")	
 (command "-walladd" "h" pause "st" (ret_list_item car selLst_item))
)

moshe

 

0 Likes
Message 24 of 27

DC-MWA
Collaborator
Collaborator

When the user hits ok or enter without selecting from list, it should run the short version.

When the user actually selects from the list it should run the long version.

0 Likes
Message 25 of 27

Moshe-A
Mentor
Mentor
Accepted solution

yes, but now what you have is default setting so there is no condition without selected item

 

if you want to deselect the highlight item call:

(set_tile "lst" "") 

 

 

0 Likes
Message 26 of 27

DC-MWA
Collaborator
Collaborator

With brief testing that seems to have done the trick.

Moshe... I have to say again... I truly appreciate your time and patience. I am going to fine tune my two other programs that are similar to this one using what I've learned here with you.

Thank you, thank you, thank you!!!!

-DC

0 Likes
Message 27 of 27

Moshe-A
Mentor
Mentor

@DC-MWA ,

 

You are most welcome 😀

i'm sure you learned a lot from this 'exercise' and you will take it ON and even teach other young Lispers in the short future.

 

Have nice Weekend

Moshe

0 Likes