Fill_image alternative

Discussion in 'AutoCAD' started by iwafb, Feb 22, 2005.

  1. iwafb

    iwafb Guest

    Hi all,

    Is there a way to partially remove images from a dialogue box? I am writing a program to place cold rolled members in a model. The program relies on a series of questions based on connection details at each end, insertion points etc.

    In order to make the program as user friendly as possible, I am using toggles to load up the relevant image based on the current options selected. Because of the number of combinations (50+), I was trying to "overlap" the images. For example:

    - One image showing member in elevation to be displayed at all times.
    - As the user selects a particular option (say left end connection type), the image gets loaded on top of the original image.

    This works until the user changes his mind and wants to select another connection option, after which two image slides appear at the left end...

    I know you can use fill_image, but this wipes the whole image. Is there a "unload_slide" type function to enable a variable slide configuration?

    Thanks
    John
     
    iwafb, Feb 22, 2005
    #1
  2. iwafb

    BillZ Guest

    Is there a "unload_slide" type function <<<

    Not that I'm aware of.

    If you could keep a list of images selected, you could manipulate the list and re-dispaly the images as needed:

    (setq sldlst (list "C:/program files/autocad r14/help/chroma"
    "G:/Autolisp/lisp slides/logowatc" "G:/Autolisp/lisp slides/50stars"))

    ("C:/program files/autocad r14/help/chroma" "G:/Autolisp/lisp slides/logowatc"
    "G:/Autolisp/lisp slides/50stars")

    (start_image "my_image")
    (fill_image 0 0 (dimx_tile "my_image")(dimy_tile "my_image") -15)
    (mapcar '(lambda (x)(slide_image 0 0 (dimx_tile "my_image")(dimy_tile "my_image") x)) sldlst)
    (end_image)

    Bill
     
    BillZ, Feb 22, 2005
    #2
  3. iwafb

    iwafb Guest

    Thanks Bill,

    I have ended up doing something similar. There are 13 cases with 12 different combinations each, instead of creating a slide for each combination, I created a slide for each case. I then actioned all 13 buttons to execute an "image toggle". The toggle then wipes the image in the dialogue and goes through all 13 images and loads them or ignores them based on the selected options. What I end up with is the relevant images loaded on top of each other appearing like a single picture.

    This is probably not the best way to go about it, but it works. Downfall is that dialogue has a small "lag" on upload (about 0.5 to 1 sec) due to all the processing.


    (defun purimagetog ()
    (set_tile "pd_3dcpurlinslide" "")
    (setq x (dimx_tile "pd_3dcpurlinslide")
    y (dimy_tile "pd_3dcpurlinslide"))
    (start_image "pd_3dcpurlinslide")
    (fill_image 0 0 (1- (dimx_tile "pd_3dcpurlinslide")) (1- (dimy_tile "pd_3dcpurlinslide")) -2)
    (slide_image 0 -50 x y "pur")
    (if (= hookvalue 0)
    (progn
    (if (or (= placevalue 0) (= lenvalue 0)) (slide_image 0 -50 x y "purltopendins") (slide_image 0 -50 x y "purltopctrins"))
    (if (or (= placevalue 0) (= renvalue 0)) (slide_image 0 -50 x y "purrtopendins") (slide_image 0 -50 x y "purrtopctrins"))
    )
    )
    (if (= hookvalue 1)
    (progn
    (if (or (= placevalue 0) (= lenvalue 0)) (slide_image 0 -50 x y "purlmidendins") (slide_image 0 -50 x y "purlmidctrins"))
    (if (or (= placevalue 0) (= renvalue 0)) (slide_image 0 -50 x y "purrmidendins") (slide_image 0 -50 x y "purrmidctrins"))
    )
    )
    (if (= hookvalue 2)
    (progn
    (if (or (= placevalue 0) (= lenvalue 0)) (slide_image 0 -50 x y "purlbotendins") (slide_image 0 -50 x y "purlbotctrins"))
    (if (or (= placevalue 0) (= renvalue 0)) (slide_image 0 -50 x y "purrbotendins") (slide_image 0 -50 x y "purrbotctrins"))
    )
    )
    (if (= flgvalue 0) (slide_image 0 -50 x y "purflgtowards") (slide_image 0 -50 x y "purflgaway"))
    (if (= lenvalue 2) (slide_image 0 -50 x y "purlapleft"))
    (if (= lenvalue 1) (slide_image 0 -50 x y "pursinleft"))
    (if (= renvalue 2) (slide_image 0 -50 x y "purlapright"))
    (if (= renvalue 1) (slide_image 0 -50 x y "pursinright"))
    (if (= value "1") (slide_image 0 -50 x y "purbridge"))
    (end_image)
    )
     
    iwafb, Feb 23, 2005
    #3
  4. iwafb

    BillZ Guest

    Glad you got it to work.

    Bill
     
    BillZ, Feb 28, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.