took me a little bit but i finally got the code to work the way i wanted it to. Thanks for all your help it worked great for me.
Some Buddy
I had the code working using your suggestions and now it has started giving me this error: no function definition: SHOW_SLIDE1 when i push the radio buttons. I narrowed the problem to the code that i added to the action tile which looks like this:
(action_tile "rb1" "(setq rf \"0\")(show_slide1 $key1)")
the part that this calls out to looks like this:
(defun show_slide1(key1 / slide width height)
(if(= value "rb1")
(setq slide "AAA0001A3D0")
(setq slide "AAA0001A3D0"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A3D0")
(end_image)
So I dont know where i went wrong but if you could help again I would greatly appreciate it .
Thanks
DJ
>(show_slide1 $key1)
>
Retrieving a key or value is $key and $value.
Others are $data, $reason, $x and $y.
What is $key1?
>(if(= value "rb1")
>
What is "value"?
Should this read (if (= key1 "rb1")... ?
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Hi,
I think that you didn't really grasp the concept, so maybe you should read again my originl answer. As you can see there, there is no need to define a show_slide1 and a key1 because the same function is called no matter what radio button you select. The difference is made by the variable key, whose value change depending with $key, depending of what radio button is selected. If you select "rb1", then $key will pass the value "rb1" to the function show_slide, and if you select "rb2", then $key will pas the value "rb2", therefore there is no need to complicate things with show_slide1 and $key1, which as scot-65 says, doesn't even exist.
Regards
Hey
Ok so if i understand correctly the $key value tells show_slide what radio button was pushed and what slide to display. Meaning theres no need to put a show_slide 1 or show_slide 2 to match the radio button that you want the slide to display with.
Now if thats all right and defined properly why would it still give me this error: no function definition: SHOW_SLIDE.
I cant get past that error I got all the slides coming up with the proper radio buttons but if you dont push them in sequence(rb1, rb2, rb3.....etc) then i get the error above. Any ideas?
Thanks again in advance
Yep, you got it right, this is why there is only one show_slide function in my first post, because the same function performs the slides change, depending on what $key value is. This is a built in mechanism and I strongly suggest that you read a little more about action_tile callbacks and about $key, $value, $reason, $data and so on, although the most used are $key and $key and about functions, arguments local and global variables, it will make your (programming) life much easier 🙂
As for your error, I forgot to mention in my last post that the function you posted misses the closing bracket, the one after (end_image) in my original post. I don't know if it was lost in the copy-paste process or it is really missing in the code that you are testing, but just check on this. This error is generated because the show_slide function was not loaded correctly, thus being an unknown function for the LISP interpreter and most of the time this happens because of unbalanced brackets.
If this doesn't fix it, you will have to attach here the code you are testing, so that I can take a closer look.
And also, as Scot-65 mentions, there is a mistake in my initial code, so you better take this one, which I think is also more explicit:
(defun show_slide (selected_radio_button / slide width height)
(if (= selected_radio_button "rb1")
(setq slide "aaa0001i3d")
(setq slide "aaa0001a3d")
)
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 width height 0)
(slide_image 0 0 width height slide)
(end_image)
(princ)
)
As you can see, the argument selected_radio_button passes the name of the selection in both cases, be it with the $key solution,
or with the $value one, as explained in my first post.
HTH
I think to do this i need a full college course..... The missing bracket i missed in the copy and paste sorry about that. I made the changes to the code heres what i have
(action_tile "rb1" "(setq rf \"0\")(show_slide $key)")
;*store insert rotation factor
(action_tile "rb2" "(setq rf \"90\")(show_slide $key)")
;*store insert rotation factor
(action_tile "rb3" "(setq rf \"180\")(show_slide $key)")
;*store insert rotation factor
(action_tile "rb4" "(setq rf \"270\")(show_slide $key)")
;*store insert rotation factor
(action_tile "rb5" "(setq sv \"LEFT\")(show_slide $key)")
;*store selected view
(action_tile "rb6" "(setq sv \"RIGHT\")(show_slide $key)")
;*store selected view
(action_tile "rb7" "(setq sv \"TOP\")(show_slide $key)")
;*store selected view
(action_tile "rb8" "(setq sv \"BACK\")(show_slide $key)")
;*store selected view
(action_tile "rb9" "(setq sv \"FRONT\")(show_slide $key)")
;*store selected view
(action_tile "rb10" "(setq sv \"FRONT and BACK\")(show_slide $key)")
(action_tile "rb11" "(setq sv \"RIGHT and LEFT\")(show_slide $key)")
(action_tile "rb12" "(setq sv \"ALL\")(show_slide $key)")
(action_tile "rb13" "(setq sv \"3D\")(show_slide $key)")
)
(defun do_preview_1() ;;; theres a pull down tab that this is refering to
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb1")
(setq slide "AAA0001A3D0")
(setq slide "AAA0001A3D0"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A3D0")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb2")
(setq slide "AAA0001A3D90")
(setq slide "AAA0001A3D90"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A3D90")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb3")
(setq slide "AAA0001A3D180")
(setq slide "AAA0001A3D180"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A3D180")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb4")
(setq slide "AAA0001A3D270")
(setq slide "AAA0001A3D270"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A3D270")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb5")
(setq slide "AAA0001L")
(setq slide "AAA0001L"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001L")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb6")
(setq slide "AAA0001R")
(setq slide "AAA0001R"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001R")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb7")
(setq slide "AAA0001T")
(setq slide "AAA0001T"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001T")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb8")
(setq slide "AAA0001B")
(setq slide "AAA0001B"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001B")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb9")
(setq slide "AAA0001F")
(setq slide "AAA0001F"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001F")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb10")
(setq slide "AAA0001FB")
(setq slide "AAA0001FB"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001FB")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb11")
(setq slide "AAA0001LR")
(setq slide "AAA0001LR"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001LR")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb12")
(setq slide "AAA0001A")
(setq slide "AAA0001A"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001A")
(end_image)
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb13")
(setq slide "AAA0001I3d")
(setq slide "AAA0001I3d"))
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(SLIDE_IMAGE -20 -125 350 350 "AAA0001I3d")
(end_image)
))))))))))))))
let me know what you think
Thanks again
My friend,
You really need a DCL 101 class or something, because you miss a lot of concepts and understanding about how these work, and "playing by the ear" it doesn't help too much. There's a lot to correct and comment about your code and I don't even know how and where to start, so I'll be back a little later 🙂
I appreciate all your help and I dont want to take up too much of your time.If its too bad dont worry about it and I will try and get it. But I do appreciate all the help you have already given me.
Thanks again
DJ
You have little chance to mak it work the way you started it.
1) You do not need to define show_slide so many times, but only once.The difference from case to case is done by $key
2) You can not define functions in this iterative (nested) way that you are traying.
Basically what you are doing is something like:
(defun do_preview_1() (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;;;... (defun show_slide(selected_radio_button / slide width height) ;...
) ) ) ) ) ) ) ) ) ) ) ) )
while it should be something like:
(defun do_preview_1() (defun show_slide(selected_radio_button / slide width height) ;;;...
) )
3) You define the variable slide, but you don't use it, because you use the fixed (hard coded) name for the slide, so instead
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb13")
(setq slide "AAA0001I3d")
(setq slide "AAA0001I3d")
)
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(slide_image -20 -125 350 350 "AAA0001I3d");;; should use slide here
(end_image)
)
you should have something like:
(defun show_slide(selected_radio_button / slide width height)
(if(= selected_radio_button "rb13")
(setq slide "AAA0001I3d")
(setq slide "AAA0001I3d")
)
(setq width (dimx_tile "im1"))
(setq height (dimy_tile "im1"))
(start_image "im1")
(fill_image 0 0 x1 y1 0)
(slide_image -20 -125 350 350 slide)
(end_image)
)
otherwise the variable slide is useless !!!
Your code can be dramatically reduced and optimized, but I need all the LISP and the DCL code, if you don't mind. I am going to do the canges and let you to analyse and understand what, why and how.
Regards
When you answer a message, underneath the text windows there's a zone with a text saying Attachments and underneath this text, you have a [ Browse ] button to search for a file to be attached.
Once you attach one file, a second button becomes available and you can attach anoter file, and so on (most probably there is a limit of 5 files or something). After selecting the file to be attached, don't forget to click on the "Add Attachment" option.
Hi,
Your whole code is indeed huge and although I understand how it works, I didn't want to make the changes in the original file, because I considered that all that code will make it hard for you to follow how this mechanism works.
So I've built a simplified LISP function which uses the same DCL file, but in the DCL file I've defined a simplified second dialog box to work with this new LISP file.
The two files must be placed in th same folder, and you shouldn't be afraid to overwrite the DCL file, because the original dialog definition is still there, but you can make a safety backup if you want.
The name of the function is RBDEMO and this should bring the new dialog box on screen and let you play with the radio buttons. I've replaced the code for displaying the slides (because there is no image on my demo dialog) with an (alert ...) function using the same name of the slide that should be shown in the image tile, so I think it won't be a problem to implement this logic with your code and display the right slide.
This demo will seek for the slide exacly the same way you've started to assign the slides in your original code, depending of the selected radio button one at a time, but I'm affraid that the slides management should be a little bit more complicated and there should be some combinations, depending of both parameters, i.e. the view AND the rotation.
Anyway, try to play with these and if you have some other questions, just ask. In order to make it easier for you to understand how this is done, check all the comments in the new LSP file and check for SomeBuddy comments in the DCL file.
HTH