Lisp / DCL newbie question

Discussion in 'AutoCAD' started by Munch, Feb 25, 2004.

  1. Munch

    Munch Guest

    I have had some success in creating a setup routine with radio buttons which
    inserts information into the cad drawing. What I can't figure out, (which
    may be very easy), is....Can I access a different lisp/dcl command from a
    dcl?

    For example, In my setup routine, I have groups of layers listed where you
    select a group, click ok and those defined layers are inserted into the
    drawing. I am contemplating the idea of selecting a layer group, click
    okay, and then have another dialog box pop up with the individual layers
    list within that group, allowing the user to select individual layers to
    load instead of the entire group.

    I am teaching myself lisp and appreciate everyones input so far. If anyone
    can provide any pointers, It would be greatly appreciated.
     
    Munch, Feb 25, 2004
    #1
  2. Munch

    Rudy Tovar Guest

    Our 'Standard Layer Manager' does exactly that...

    Captures existing layers, import, exports or you create, and define it's
    properties.

    You can branch DCL boxes from one to another.
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Feb 25, 2004
    #2
  3. Munch

    Munch Guest

    Our 'Standard Layer Manager' does exactly that...

    too bad I can;t access your site to see it.......
     
    Munch, Feb 25, 2004
    #3
  4. Munch

    Rudy Tovar Guest

    I'll email you a copy.

     
    Rudy Tovar, Feb 25, 2004
    #4
  5. Munch

    Rudy Tovar Guest

    I'll need your real email address.
     
    Rudy Tovar, Feb 26, 2004
    #5
  6. Munch

    BillZ Guest

    Check out "Nesting dialog boxes" in the Autolisp reference help files.
    There are several sections that have valuable info there.

    Bill
     
    BillZ, Feb 26, 2004
    #6
  7. Munch

    Jason Guest

    I believe you control it all from the backend lisp and simply assign the OK
    or Next button to unload the current dialog and then load a new dialog. Use
    get_tile function calls to save the selected options from the first dialog
    so that you can setup the second dialog correctly.

    If the only purpose of this program is to insert layers, you might want to
    consider putting the branch options in a menu file and saving the lisp and
    DCL coding for the final layer selections. The menu file could be something
    like:

    Our Company
    -> Insert Layers
    -> Civil
    -> New Construction [lisp call]
    -> Existing to remain [lisp call]
    -> Existing to demo [lisp call]
    -> Arch
    -> New Construction [lisp call]
    -> Existing to remain [lisp call]
    -> Existing to demo [lisp call]
    ...

    The menu file is much easier to code and has a tree organization by its very
    nature.

    Jason

    "Munch" <bs2xsatmsndotcommie> wrote in message
    I have had some success in creating a setup routine with radio buttons which
    inserts information into the cad drawing. What I can't figure out, (which
    may be very easy), is....Can I access a different lisp/dcl command from a
    dcl?

    For example, In my setup routine, I have groups of layers listed where you
    select a group, click ok and those defined layers are inserted into the
    drawing. I am contemplating the idea of selecting a layer group, click
    okay, and then have another dialog box pop up with the individual layers
    list within that group, allowing the user to select individual layers to
    load instead of the entire group.

    I am teaching myself lisp and appreciate everyones input so far. If anyone
    can provide any pointers, It would be greatly appreciated.
     
    Jason, Feb 26, 2004
    #7
  8. Munch

    Munch Guest

    This is my real email address making obvious changes to 'dot' and 'at'<bs2xsatmsndotcom>
     
    Munch, Feb 26, 2004
    #8
  9. Munch

    Rudy Tovar Guest

    One more note on branching dialogs. Remember to give each call to individual
    dialogs a different name.
     
    Rudy Tovar, Feb 26, 2004
    #9
  10. Munch

    Munch Guest

    Rudy,

    I appreciate your responses although as I mentioned, I am just learning this
    stuff and so far, I am very confused. I modified and Lisp with DCL for my
    layer routine. It was originally created with radio buttons but wanted to
    change them to toggle/check boxes. What I am hoping is that the user can
    select more than one then somehow have the lisp create the layers. I have
    tested this with a radio button and it works! But now when I change them to
    Toggles, it doesn't do anything. I am searching around for information but
    have not found anything this specific yet.

    Example: In DCL I have a check box for a layer:

    : boxed_column {
    label = "Architectural Layers";
    : toggle {
    label = "A-Area";
    key = "rb001";
    }
    In Lisp I have this:
    (action_tile
    "rb001"
    "(setq setup \"A-Area\")"
    )

    and this:
    (if (eq "A-Area")
    (progn
    (command "-layer" "n" "A-Area" "c" "173" ""
    )
    )
    )

    Again. i am still learning.......

    (been checking my email)
     
    Munch, Feb 26, 2004
    #10
  11. Munch

    Mark Propst Guest

    you should be getting an error with that statement
    ; error: too few arguments

    maybe you mean (if (eq setup "A-Area") ???
     
    Mark Propst, Feb 26, 2004
    #11
  12. Munch

    BillZ Guest

    Remember to run "command" only after exiting from the dialog.

    You will also want to tell your program if "okay" or "cancel"
    has been pressed.

    So, If you have multiple toggles, you want to tell
    your program which toggles are "X"ed and which are not.

    Create a subr at the start of the lisp file before the main defun.
    ;;;
    (defun set_toggles ()
    (setq rb_001 (get_tile "rb001")
    rb_002 (get_tile "rb002") ;set a variable for each toggle.
    )
    (done_dialog 1) ;be sure this done_dialog is 1.
    );end subr defun
    ;;;

    Then in you main dialog program:

    (action_tile "accept" "(set_toggles)")
    (action_tile "cancel" "(done_dialog 0)")
    (setq do_what (start_dialog)) ;this sets do_what to done_dialog value.
    (unload_dialog dcl_id)

    (if (and (= do_what 1) ;if accept
    (= rb_001 "1") ;and toggle checked.
    )
    (command "-layer" "n" "A-Area" "c" "173" "")
    )
    (if (and (= do_what 1)
    (= rb_002 "1"))
    (command "-layer" "n" "B-Area" "c" "174" "") ;do an if for each toggle value in set_toggles.
    )

    ) ;end main program defun.
     
    BillZ, Feb 27, 2004
    #12
  13. Munch

    ECCAD Guest

    Munch,
    Just another suggestion.
    Make a 'list' of the layers. In the Dialog, do (2) lists. Place the layer list in Left list box. When user clicks on an item, append it to the second list, refresh 2nd list box. If user clicks on 2nd list box item, remove it from list and refresh. They can select as many as desired, or remove unwanted. When OK, do your layer operations on 2nd list items.

    Bob
     
    ECCAD, Feb 27, 2004
    #13
  14. Munch

    Munch Guest

    Bill - Thank you so much. I truly appreciate your help and information. I
    especially appreciate your instruction and teaching. As you may assume, I
    got it to work and thanks to you. If I had your number, I'd fax you a beer
    and a chili donut! Thanks again. You made my day!
     
    Munch, Feb 27, 2004
    #14
  15. Munch

    BillZ Guest

    Thanks for the reply.

    You're welcome.

    Many people have helped me on this forum.

    Makes my day when I can help and the helped appreciates it!


    Bill
     
    BillZ, Feb 27, 2004
    #15
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.