Toggle problems

Discussion in 'AutoCAD' started by Rabbit, Aug 6, 2004.

  1. Rabbit

    Rabbit Guest

    Okay, I've searched and searched and spent 3 hours trying different things.
    What do I need to make this work?

    Lisp part:
    <other lisp stuff>
    (set_tile "hvac_curb" "0")
    (set_tile "hvac_econ" "0")
    ......
    ......
    (action_tile
    "accept"
    (strcat
    "(if (equal \"1\" (get_tile \"hvac_curb\")) (setq UnitCurb 1) (setq
    UnitCurb 0))"
    "(if (equal \"1\" (get_tile \"hvac_econ\")) (setq UnitEconomizer 1)
    (setq UnitEconomizer 0))"
    "(done_dialog)(setq userclick T))"
    )

    DCL part:
    <other DCL stuff>
    : column {
    key = "hvac_options";
    label = "Options";
    : toggle {key = "hvac_curb"; label = "&Curb"; }
    : toggle {key = "hvac_econ"; label = "Economi&zer"; }
    }
     
    Rabbit, Aug 6, 2004
    #1
  2. An easier method to find problems might be -
    (defun Accept_function ()
    (setq hvac_curb (get_tile "hvac_curb"))
    (if (equal hvac_curb "1")
    (setq UnitCurb 1)
    (setq UnitCurb 0)
    )
    (setq hvac_econ (get_tile "hvac_econ"))
    (if (equal hvac_econ "1")
    (setq UnitEconomizer 1)
    (setq UnitEconomizer 0)
    )
    (done_dialog)
    (setq userclick T)
    )

    (action_tile "accept" "(Accept_function)")
     
    Alan Henderson @ A'cad Solutions, Aug 6, 2004
    #2
  3. Rabbit

    T.Willey Guest

    What exactly is going wrong? What is the error, or what is it not doing that you think or want it to do?

    (set_tile "hvac_curb" "0") <-- here you need a number not a string
    (set_tile "hvac_econ" "0") <-- here you need a number not a string
    try
    (set_tile "hvac_curb" 0)
    (set_tile "hvac_econ" 0)
    or here try
    : toggle {key = "hvac_curb"; label = "&Curb"; value="0";}

    Hope that helps,
    Tim
     
    T.Willey, Aug 6, 2004
    #3
  4. Rabbit

    Rabbit Guest

    That worked great! I never thought about making all of that in to a
    function. Thanks!!!!
     
    Rabbit, Aug 6, 2004
    #4
  5. Rabbit

    Rabbit Guest

    And now I see what I was doing wrong in the first place. I thought that it
    had to be in string form, not a number. So, I guess that I was on the right
    track, just the wrong train. Thanks for the info.
     
    Rabbit, Aug 6, 2004
    #5
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.