Help with slide library

Help with slide library

DC-MWA
Collaborator Collaborator
2,387 Views
20 Replies
Message 1 of 21

Help with slide library

DC-MWA
Collaborator
Collaborator

I've got my preogram working great... previews work including previous selection preview...

I'm having trouble getting it to read from a slide library in leau of separate .sld files.

Here are the lines needing modification...

 

(slide "sld" (strcat (nth (atoi $value) lst) ".sld"))

(slide "sld" (strcat (nth (atoi (set_tile "lst" "0")) lst) ".sld"))

 

The slide library name is "MWA-WALLADD.slb"

Thanks!

 

0 Likes
2,388 Views
20 Replies
Replies (20)
Message 2 of 21

john.uhden
Mentor
Mentor

It's just a matter of adding the slide name in parentheses to the slide library file name without extension.

So, if your slide file is named "MWA-WALLADD.slb" as in:

(setq slb (findfile "MWA-WALLADD.slb"))

then...

(setq slb (substr slb 1 (- (strlen slb) 4)))

then...

   ;;-----------------------------
   ;; Function to display |slide:
   ;;
   (defun @do_slide (tile / slide x y)
      (setq slide (strcat slb "(" tile ")"))
      (setq x (dimx_tile tile)
            y (dimy_tile tile)
      )
      (start_image tile)
      (slide_image 0 0 x y slide)
      (end_image)
   )

Note that in this example I have treated the name of the slide the same as the name of the image tile to be filled, well, except that the slide name is the concatenation of the slide library name (without extension) and the slide name within it.

 

John F. Uhden

0 Likes
Message 3 of 21

DC-MWA
Collaborator
Collaborator

Hello,

Thanks for the response...

The slide images are not static, there is one preview window and the user selection changes the preview image.

See attched lisp.

 

0 Likes
Message 4 of 21

john.uhden
Mentor
Mentor

That may be one of the most verbose functions I have ever seen, but we can work on that gradually.  Anyway, if it works, who cares what it looks like.

The import of what I said in my previous response dealt only with the loading of a slide file from within a slide library.  The points being that:

1.  the .SLB file must be found

2.  the extension must be removed

3.  the slide name must be added in parentheses, all in the same string.

 

For example, if the slide file is named "MySlides.slb" and it is found in "C:/ACAD/Support" and the slide you want to load is named "A123," then...

all of that must become "C:/ACAD/Support/MySlides(A123)"

John F. Uhden

0 Likes
Message 5 of 21

DC-MWA
Collaborator
Collaborator

Yes...
My programming knowledge is limited. I like to call it "Franken-Lisp".   🙂

I can't figure out how to feed the .slb info into the program because the sld path is constantly changing when user selects or its "remembering" the last selection.

I apologize for my sloppy lisping and my lack of knowledge. I am an architect, I have been thrust into this "cad manager" position and have been making programs to forcefuly enforce the way we do things in order to stop new staff from going rogue.

The bulk of my programming (as you can see) is through cut and paste and internet research.

This lisp is way out of my league. I'm amazed I've got this far. It works well, it's fast. I've tested it all day yesterday on two large commercial projects without issue. It's network worthy.

I appreciate any assistance received.

0 Likes
Message 6 of 21

john.uhden
Mentor
Mentor

You yourself will have to overcome the existence of multiple slide files.

Let's say for kicks they are separate because of discipline, but they are each named the same. Like maybe your company is named 4Q2 Enterprises.

So you might keep each .SLB in a separate folder, as in

P:/Custom/Arch/4Q2Slides.slb

P:/Custom/Civil/4Q2Slides.slb

P:/Custom/Elect/4Q2Slides.slb

P:/Custom/Mech/4Q2Slides.slb

 

In this case you add code to determine the correct path.

You could do it with a DCL dialogue containing either a list_box for the discipline choice or radio buttons.  Or you could use getkword...

(initget "Arch Civil Elect Mech")
(setq disc (getkword "\nEnter discipline, <Arch>/Civil/Elect/Mech: "))
(if (not disc)(setq disc "Arch"))
(setq slb (strcat "P:/Custom/" disc "/4Q2Slides.slb"))

John F. Uhden

0 Likes
Message 7 of 21

DC-MWA
Collaborator
Collaborator

First... thanks for your time on this...

I do not know how to coordinate the .slb with the slide "sld"

this:

(defun slide ( key file );;;;;;;;can i put slide library here? <slidelibrary(slidename)> but the slide name changes????
(if (setq file (findfile file))
(progn
(start_image key)
(fill_image 0 0 (dimx_tile key) (dimy_tile key) 0)
(slide_image 1 1 (- (dimx_tile key) 2) (- (dimy_tile key) 2) file)
(end_image)
);end progn
);end if
);end defun

 

to this:

(slide "sld" (strcat (nth (atoi $value) lst) ".sld"))

 

and these:

(cond ((= sel1temp 0) (slide "sld" (strcat (nth (atoi (set_tile "lst" "0")) lst) ".sld")))
((= sel1temp 1) (slide "sld" (strcat (nth (atoi (set_tile "lst" "1")) lst) ".sld")))
((= sel1temp 2) (slide "sld" (strcat (nth (atoi (set_tile "lst" "2")) lst) ".sld")))
((= sel1temp 3) (slide "sld" (strcat (nth (atoi (set_tile "lst" "3")) lst) ".sld")))
((= sel1temp 4) (slide "sld" (strcat (nth (atoi (set_tile "lst" "4")) lst) ".sld")))
((= sel1temp 5) (slide "sld" (strcat (nth (atoi (set_tile "lst" "5")) lst) ".sld")))
((= sel1temp 6) (slide "sld" (strcat (nth (atoi (set_tile "lst" "6")) lst) ".sld")))
((= sel1temp 7) (slide "sld" (strcat (nth (atoi (set_tile "lst" "7")) lst) ".sld")))
((= sel1temp 8) (slide "sld" (strcat (nth (atoi (set_tile "lst" "8")) lst) ".sld")))
((= sel1temp 9) (slide "sld" (strcat (nth (atoi (set_tile "lst" "9")) lst) ".sld")))
((= sel1temp 10) (slide "sld" (strcat (nth (atoi (set_tile "lst" "10")) lst) ".sld")))
((= sel1temp 11) (slide "sld" (strcat (nth (atoi (set_tile "lst" "11")) lst) ".sld")))
((= sel1temp 12) (slide "sld" (strcat (nth (atoi (set_tile "lst" "12")) lst) ".sld")))
((= sel1temp 13) (slide "sld" (strcat (nth (atoi (set_tile "lst" "13")) lst) ".sld")))
((= sel1temp 14) (slide "sld" (strcat (nth (atoi (set_tile "lst" "14")) lst) ".sld")))
((= sel1temp 15) (slide "sld" (strcat (nth (atoi (set_tile "lst" "15")) lst) ".sld")))
((= sel1temp 16) (slide "sld" (strcat (nth (atoi (set_tile "lst" "16")) lst) ".sld")))
((= sel1temp 17) (slide "sld" (strcat (nth (atoi (set_tile "lst" "17")) lst) ".sld")))
((= sel1temp 18) (slide "sld" (strcat (nth (atoi (set_tile "lst" "18")) lst) ".sld")))
((= sel1temp 19) (slide "sld" (strcat (nth (atoi (set_tile "lst" "19")) lst) ".sld")))
((= sel1temp 20) (slide "sld" (strcat (nth (atoi (set_tile "lst" "20")) lst) ".sld")))
((= sel1temp 21) (slide "sld" (strcat (nth (atoi (set_tile "lst" "21")) lst) ".sld")))
);end cond

 

I have done dcl where the images act like buttons and each have there own action tile... but this is beyond me.

 

 

0 Likes
Message 8 of 21

john.uhden
Mentor
Mentor

BTW, we all admire your ambition and effort to learn the language yourself.  Much much much better than those who treat this place like a freeware drive-thru.  For all of us who know anything (that way I can include myself), it has taken years of practice, with all the bumps and bruises and skinned knees that go with it.

John F. Uhden

0 Likes
Message 9 of 21

john.uhden
Mentor
Mentor

Please go back and rereread my previous responses.  I think it's all there.

John F. Uhden

0 Likes
Message 10 of 21

DC-MWA
Collaborator
Collaborator

Well than you. I have the utmost respect for you guys and am continuely impressed by your skills and knowledge. In the past 4 months I have been able to do amazing things and have leaned much. I could not have done any of it without all of your support and asistance.

Thanks for your time.

0 Likes
Message 11 of 21

john.uhden
Mentor
Mentor

continuely continually

We can teach a lot of things around here if we can thunk of it.

John F. Uhden

0 Likes
Message 12 of 21

john.uhden
Mentor
Mentor

I just looked and see that you are in Arroyo Grande, CA.

Almost every week my wife and I cancel off places to where to move.  Though only a mile from the Atlantic Ocean, hurricanes are no big deal to us.  But the idea of wildfires, mudslides, earthquakes, tornadoes, and floods are way beyond our limits.  Here's praying for your well being.

John F. Uhden

0 Likes
Message 13 of 21

DC-MWA
Collaborator
Collaborator

I am still stumped...

I went back to the beginning:

 

1.  the .SLB file must be found

2.  the extension must be removed

3.  the slide name must be added in parentheses, all in the same string.

 

I'm still not getting any results???

0 Likes
Message 14 of 21

DC-MWA
Collaborator
Collaborator

Luckily I live right on the coast. We are located right smack in the middle of all the fires. Couple hundred miles north, and couple hours south.

Crazy.

Where I live in Nipomo it's 70-75 degree range almost every day, even christmas. We need more rain but, it's beautiful. Beaches, lakes, skiing within a couple hour drive. Can't beat it!

 

0 Likes
Message 15 of 21

john.uhden
Mentor
Mentor

Any sailing clubs?  One design only, like 420s or M Scows or E Scows or Sandpipers?

John F. Uhden

0 Likes
Message 16 of 21

DC-MWA
Collaborator
Collaborator

Sorry for delay.

Sailing clubs. I do not know.

Have a great week!

0 Likes
Message 17 of 21

DC-MWA
Collaborator
Collaborator

Still Stuck on this. For now Im living with a cluttered folder full of slides.

0 Likes
Message 18 of 21

john.uhden
Mentor
Mentor
"a cluttered folder full of slides?"
I thought you had well-organized .SLBs and we showed you how to load them.
What happened? Did my son come along and rearrange everything as he did in
my garage? I'll probably never find my paint can opener again. But that's
alright; at least I know where my finely sharpened chisels are . I
think they are still on top of my belt sander under the lawn mower behind
my stack of fence scraps blocking the side door.

John F. Uhden

0 Likes
Message 19 of 21

DC-MWA
Collaborator
Collaborator

LOL

Sorry for delay. Schedules been crazy!

Yes I'm still at a loss on how to get this routine to read from a slide library.

See attched text file describing my issue and attempts.

 

0 Likes
Message 20 of 21

john.uhden
Mentor
Mentor
Instead of:
(slide "sld" (strcat slb "(" (nth (atoi $value) lst) ".sld" ")"));;;revised to show <libname(slidename)>

How about just:
(slide "sld" (strcat slb "(" (nth (atoi $value) lst) ")"));;;revised to show <libname(slidename)>?

John F. Uhden

0 Likes