TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lee Mac on September 09, 2009, 08:29:50 AM

Title: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 08:29:50 AM
In my current project I would like to be able to double click on an item in a DCL list_box and have another dialog open with this action, however the only way I have found to have a double click is the "allow_accept" attribute.

But this would follow the action of the tile with the "accept" key. Therefore I considered having an arbitrary tile with the "accept" key to perform the actions I wanted, but this would mean a superfluous tile on the dialog (unless such things can be hidden?)

I am a bit stumped as to how to approach this one - but I do believe it to be possible, as I have seen a similar thing in action in MP's axprops.fas application (a very nice piece of work indeed).

Any help is appreciated,

Thanks,

Lee
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 09:26:12 AM
Hi Lee..

Maybe this can Help..

Not very elegant...but it work.
Code: [Select]
(defun c:test (/ mylist dcl_id)
  (createleemacdialog)
  (setq dcl_id (load_dialog (strcat (getvar "SAVEFILEPATH") "test.dcl")))
  (if (not (new_dialog "test" dcl_id))
    (exit)
  )
  (setq mylist (list "Electrical" "Structural" "Plumbing" "Foundation"))
  (start_list "LB1" 3)
  (mapcar 'add_list mylist)
  (end_list)
  (action_tile
    "LB1"
    "(setq readlist (get_tile \"LB1\"))
    (if (eq (nth (atoi readlist) myList) firstitem)
    (progn
    (alert (nth (atoi readlist) myList))
    (setq firstitem nil)
    )   
    (setq firstitem (nth (atoi readlist) myList))
    )"
  )
  ;;ACTION 
  (action_tile "accept" "(done_dialog) (setq userclick T)")
  (action_tile "cancel" "(done_dialog) (setq userclick nil)")
  (start_dialog)
  (unload_dialog dcl_id)
  (princ)
)




(defun createleemacdialog (/ dialf)
  (setq dialf (open (strcat (getvar "SAVEFILEPATH") "test.dcl") "w"))
  (write-line
    "test  : dialog {
          label = \"test double click\" ;

: column {
: spacer {}

: boxed_column {
: spacer {}

label = \"ListBox :\";
 

: list_box {
        key = \"LB1\";       
        }


}

: spacer {}

        : text {     
        label = \"For LeeMac Only ! ;-)\";
        }
        : row {
  children_alignment = top ;
 
      }


}
: spacer {}

        ok_cancel ;

 }

"   dialf
  )
  (close dialf)
)

Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 09:34:28 AM
Nice idea Andrea,

Thats a good substitute for the double click action - it doesn't emulate it exactly, as there can be an indefinite delay between the two clicks, but its pretty close  :-)

Thanks,

Lee
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 10:07:47 AM
maybe by adding this..

Code: [Select]
(defun c:test (/ mylist dcl_id)
  (createleemacdialog)
  (setq dcl_id (load_dialog (strcat (getvar "SAVEFILEPATH") "test.dcl")))
  (if (not (new_dialog "test" dcl_id))
    (exit)
  )
  (setq mylist (list "Electrical" "Structural" "Plumbing" "Foundation"))
  (start_list "LB1" 3)
  (mapcar 'add_list mylist)
  (end_list)
  (action_tile
    "LB1"
    "(setq readlist (get_tile \"LB1\"))
    (setq start# (getvar \"date\"))
    (if (and
        (eq (nth (atoi readlist) mylist) firstitem)
        (< (abs (read (rtos (- end# start#) 2 10))) 0.0000011667)
        )
       
      (progn (alert (nth (atoi readlist) mylist))
             (setq firstitem nil)
      )
      (progn
      (setq end# (getvar \"date\"))
      (setq firstitem (nth (atoi readlist) mylist))
      )
    )"
  )
  ;;ACTION 
  (action_tile "accept" "(done_dialog) (setq userclick T)")
  (action_tile "cancel" "(done_dialog) (setq userclick nil)")
  (start_dialog)
  (unload_dialog dcl_id)
  (princ)
)

(rtos (getvar  "date") 2 8)



(defun createleemacdialog (/ dialf)
  (setq dialf (open (strcat (getvar "SAVEFILEPATH") "test.dcl") "w"))
  (write-line
    "test  : dialog {
          label = \"test double click\" ;

: column {
: spacer {}

: boxed_column {
: spacer {}

label = \"ListBox :\";
 

: list_box {
        key = \"LB1\";       
        }


}

: spacer {}

        : text {     
        label = \"For LeeMac Only ! ;-)\";
        }
        : row {
  children_alignment = top ;
 
      }


}
: spacer {}

        ok_cancel ;

 }

"   dialf
  )
  (close dialf)
)


Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 10:14:41 AM
Haven't tried your most recent post yet - but I had a dabble with this:

Code: [Select]
(defun c:test (/ mylist dcl_id ptr acptr)
  (createleemacdialog)
  (setq dcl_id (load_dialog (strcat (getvar "SAVEFILEPATH") "test.dcl")))
  (if (not (new_dialog "test" dcl_id))
    (exit)
  )
  (setq mylist (list "Electrical" "Structural" "Plumbing" "Foundation"))
  (start_list "LB1" 3)
  (mapcar 'add_list mylist)
  (end_list)

  (action_tile "accept" "(or (and acPtr
                                  (not (alert (nth (atoi acPtr) mylist)))
                                  (not (setq acPtr nil)))
                             (done_dialog))")
  (action_tile "LB1"    "(or (and (eq ptr $value)
                                  (not (setq acPtr ptr ptr nil)))
                             (setq ptr $value))")
  (action_tile "cancel" "(done_dialog)")

  (start_dialog)
  (unload_dialog dcl_id)
  (princ)
)




(defun createleemacdialog (/ dialf)
  (setq dialf (open (strcat (getvar "SAVEFILEPATH") "test.dcl") "w"))
  (write-line
    "test  : dialog {
          label = \"test double click\" ;

: column {
: spacer {}

: boxed_column {
: spacer {}

label = \"ListBox :\";
 

: list_box {
        key = \"LB1\";
        allow_accept = true;
        }


}

: spacer {}

        : text {     
        label = \"For LeeMac + Andrea Only ! ;-)\";
        }
        : row {
  children_alignment = top ;
 
      }


}
: spacer {}

        ok_cancel ;

 }

"   dialf
  )
  (close dialf)
)

Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 10:16:29 AM
Very nice Andrea! - I like your thinking... when I said there was an indefinite about of time between clicks, you took this literally and put a cap on that time... nice thinking  8-)
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 10:22:24 AM
Very nice Andrea! - I like your thinking... when I said there was an indefinite about of time between clicks, you took this literally and put a cap on that time... nice thinking  8-)

Thanks !   :angel:
that way you will be able to set double-click delay. :ugly:
Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 10:31:49 AM
A slightly tider action statement:

Code: [Select]
(action_tile "LB1"
    "(setq start# (getvar \"date\"))
     (if (and (eq ptr $value)
              (< (abs (read (rtos (- end# start#) 2 10))) 0.0000011667))
             
      (progn
      (alert (nth (atoi ptr) mylist))
             (setq ptr nil))
             
      (setq end# (getvar \"date\") ptr $value))"
  )
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 10:41:39 AM
A slightly tider action statement:

Code: [Select]
(action_tile "LB1"
    "(setq start# (getvar \"date\"))
     (if (and (eq ptr $value)
              (< (abs (read (rtos (- end# start#) 2 10))) 0.0000011667))
             
      (progn
      (alert (nth (atoi ptr) mylist))
             (setq ptr nil))
             
      (setq end# (getvar \"date\") ptr $value))"
  )

not sure to understand...

why (eq ptr $value) ?
$value and ptr always = nil ?
Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 10:42:35 AM
$value is the value of the tile when the action_tile is triggered  :-)
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 10:48:21 AM
$value is the value of the tile when the action_tile is triggered  :-)

oh ! I see... :?

nice...!!  thanks !
Title: Re: Double Click in a List_Box
Post by: GDF on September 09, 2009, 12:16:22 PM
Code: [Select]
;;;double clicking on image tile
(defun ARCH:SET_X (a) (setq x a))
(defun ARCH:READ_X  (a)
  (if (= x a)
    (done_dialog)))

(action_tile
    "S1"
    "(ARCH:READ_X 1)(RESETNO-OFF)(ARCH:PLAY-SYM \"S1\" \"North\" \"Arrow\")(ARCH:SET_X 1)")


This is what I do for double clicking on button in a dialog box.

In the SYMS dialog box image below, a single click changes the image and a double click does the action.
The S1 image is in the upper left (north arrow) button.
Title: Re: Double Click in a List_Box
Post by: jbuzbee on September 09, 2009, 01:00:21 PM
. . . psst: OpenDCL.com

all the cool kids are doing it . . .  8-)
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 01:03:30 PM
. . . psst: OpenDCL.com

all the cool kids are doing it . . .  8-)

I prefer ObjectDCL.com   :pissed:
Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 01:13:19 PM
. . . psst: OpenDCL.com

all the cool kids are doing it . . .  8-)

I prefer ObjectDCL.com   :pissed:

I haven't tried either tbh...

Andrea, is ObjectDCL part of your company?

JBuz >  I have had a look at OpenDCL.com - may look into getting into it... not sure how easy it is to get to grips with though...   :|
Title: Re: Double Click in a List_Box
Post by: Andrea on September 09, 2009, 01:15:19 PM
Andrea, is ObjectDCL part of your company?

Yes,..OpenDCL is a derivate product of ObjectDCL (the original)
Title: Re: Double Click in a List_Box
Post by: jbuzbee on September 09, 2009, 01:32:14 PM
OpenDCL is very easy to learn.  Great support over at OpenDCL.com at the discussion forums and lots of tutorials and examples.  The team is dedicated to keeping it in continual development.  And it's free.  Do a search here - I've posted some stuff.  Defenitely check it out.

jb
Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 01:33:04 PM
Thanks mate,

Will definitely check it out.

I see quite a few downloads on the OpenDCL site, should I get:  OpenDCL.Runtime.6.0.0.3.msi?
Title: Re: Double Click in a List_Box
Post by: Crank on September 09, 2009, 01:57:56 PM
[...] should I get:  OpenDCL.Runtime.6.0.0.3.msi?
You need OpenDcl.Studio (http://sourceforge.net/projects/opendcl/)
Title: Re: Double Click in a List_Box
Post by: Lee Mac on September 09, 2009, 02:02:59 PM
Ahh... thanks Mr Crank  :-)
Title: Re: Double Click in a List_Box
Post by: johnson on May 04, 2011, 12:04:40 PM
Haven't tried your most recent post yet - but I had a dabble with this:

Code: [Select]
(defun c:test (/ mylist dcl_id ptr acptr)
  (createleemacdialog)
  (setq dcl_id (load_dialog (strcat (getvar "SAVEFILEPATH") "test.dcl")))
  (if (not (new_dialog "test" dcl_id))
    (exit)
  )
  (setq mylist (list "Electrical" "Structural" "Plumbing" "Foundation"))
  (start_list "LB1" 3)
  (mapcar 'add_list mylist)
  (end_list)

  (action_tile "accept" "(or (and acPtr
                                  (not (alert (nth (atoi acPtr) mylist)))
                                  (not (setq acPtr nil)))
                             (done_dialog))")
  (action_tile "LB1"    "(or (and (eq ptr $value)
                                  (not (setq acPtr ptr ptr nil)))
                             (setq ptr $value))")
  (action_tile "cancel" "(done_dialog)")

  (start_dialog)
  (unload_dialog dcl_id)
  (princ)
)




(defun createleemacdialog (/ dialf)
  (setq dialf (open (strcat (getvar "SAVEFILEPATH") "test.dcl") "w"))
  (write-line
    "test  : dialog {
          label = \"test double click\" ;

: column {
: spacer {}

: boxed_column {
: spacer {}

label = \"ListBox :\";
 

: list_box {
        key = \"LB1\";
        allow_accept = true;
        }


}

: spacer {}

        : text {     
        label = \"For LeeMac + Andrea Only ! ;-)\";
        }
        : row {
  children_alignment =
      }


}
: spacer {}

        ok_cancel ;

 }

"   dialf
  )
  (close dialf)
)


nice one.we can use command also?lee....like copy text(replaced by that "Electrical" "Structural" "Plumbing" "Foundation")  double click means copy commend should active.....possible?
Title: Re: Double Click in a List_Box
Post by: Lee Mac on May 04, 2011, 12:15:11 PM
nice one.we can use command also?lee....like copy text(replaced by that "Electrical" "Structural" "Plumbing" "Foundation")  double click means copy commend should active.....possible?

Many things are possible.  :-)
Title: Re: Double Click in a List_Box
Post by: johnson on May 04, 2011, 08:49:19 PM
nice one.we can use command also?lee....like copy text(replaced by that "Electrical" "Structural" "Plumbing" "Foundation")  double click means copy commend should active.....possible?

Many things are possible.  :-)

can you say for sample?i have tried with this.but this one autocad alert box.so command is not support.
Title: Re: Double Click in a List_Box
Post by: Stefan on May 05, 2011, 02:52:06 AM
Hi Lee
I just saw how old is original post... sorry if it is not actual anymore

Anyway, another method for double-click for your example

Code: [Select]
  (action_tile "accept" "(done_dialog)")
  (action_tile "LB1"    "(if (= $reason 4)
                               (alert (nth (atoi $value) mylist))
                               (setq ptr $value))")
  (action_tile "cancel" "(done_dialog)")

Note that is working no matter how allow_accept is set..

Title: Re: Double Click in a List_Box
Post by: Lee Mac on May 05, 2011, 08:02:40 AM
Code: [Select]
(= $reason 4)

How could I have missed that all this time... (http://www.theswamp.org/screens/leemac/facepalm.gif)

Thanks phanaem, appreciated.
Title: Re: Double Click in a List_Box
Post by: Lee Mac on May 05, 2011, 08:29:17 AM
nice one.we can use command also?lee....like copy text(replaced by that "Electrical" "Structural" "Plumbing" "Foundation")  double click means copy commend should active.....possible?

Many things are possible.  :-)

can you say for sample?i have tried with this.but this one autocad alert box.so command is not support.

The functionality you are looking for could probably be achieved using the allow_accept attribute, since the command would be started using the same action as the accept tile.

Example:
Code: [Select]
([color=BLUE]defun[/color] c:test ( [color=BLUE]/[/color] *error* coms dch file ok tmp )
 
  [color=GREEN];;----------------------------------------------;;[/color]
  [color=GREEN];; Example by Lee Mac 2011  -  www.lee-mac.com  ;;[/color]
  [color=GREEN];;----------------------------------------------;;[/color]

  ([color=BLUE]defun[/color] *error* ( msg )
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] dch ([color=BLUE]<[/color] 0 dch)) ([color=BLUE]unload_dialog[/color] dch))
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] tmp ([color=BLUE]setq[/color] tmp ([color=BLUE]findfile[/color] tmp))) ([color=BLUE]vl-file-delete[/color] tmp))   
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] msg ([color=BLUE]not[/color] ([color=BLUE]wcmatch[/color] ([color=BLUE]strcase[/color] msg) [color=MAROON]"*BREAK,*CANCEL*,*EXIT*"[/color])))
      ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\n** Error: "[/color] msg [color=MAROON]" **"[/color]))
    )
    ([color=BLUE]princ[/color])
  )

  ([color=BLUE]setq[/color] coms
   '(
      [color=MAROON]"LINE"[/color]
      [color=MAROON]"CIRCLE"[/color]
      [color=MAROON]"ELLIPSE"[/color]
      [color=MAROON]"XLINE"[/color]
      [color=MAROON]"PLINE"[/color]
      [color=MAROON]"POLYGON"[/color]
      [color=MAROON]"ARC"[/color]
      [color=MAROON]"POINT"[/color]
    )
  )

  ([color=BLUE]cond[/color]
    (
      ([color=BLUE]not[/color]
        ([color=BLUE]and[/color] ([color=BLUE]setq[/color] file ([color=BLUE]open[/color] ([color=BLUE]setq[/color] tmp ([color=BLUE]vl-filename-mktemp[/color] [color=BLUE]nil[/color] [color=BLUE]nil[/color] [color=MAROON]".dcl"[/color])) [color=MAROON]"w"[/color]))
          ([color=BLUE]progn[/color]
            ([color=BLUE]write-line[/color]
              ([color=BLUE]strcat[/color]
                [color=MAROON]"com : dialog { label = \"Commands\"; spacer; "[/color]
                [color=MAROON]"  : list_box { key = \"lst\"; alignment = centered; allow_accept = true; } ok_cancel; }"[/color]
              )
              file
            )
            ([color=BLUE]<[/color] 0 ([color=BLUE]setq[/color] file ([color=BLUE]close[/color] file) dch ([color=BLUE]load_dialog[/color] tmp)))
          )
          ([color=BLUE]new_dialog[/color] [color=MAROON]"com"[/color] dch)
        )
      )
      ([color=BLUE]princ[/color] [color=MAROON]"\n--> Error Loading Dialog."[/color])
    )
    ([color=BLUE]t[/color]
      ([color=BLUE]start_list[/color] [color=MAROON]"lst"[/color])
      ([color=BLUE]mapcar[/color] '[color=BLUE]add_list[/color] ([color=BLUE]setq[/color] coms ([color=BLUE]acad_strlsort[/color] coms))) ([color=BLUE]end_list[/color])

      ([color=BLUE]setq[/color] *com ([color=BLUE]set_tile[/color] [color=MAROON]"lst"[/color] ([color=BLUE]cond[/color] ( *com ) ( [color=MAROON]"0"[/color] ))))
      ([color=BLUE]action_tile[/color] [color=MAROON]"lst"[/color] [color=MAROON]"(setq *com $value)"[/color])

      ([color=BLUE]setq[/color] ok ([color=BLUE]start_dialog[/color]))
    )
  )

  (*error* [color=BLUE]nil[/color])
  ([color=BLUE]if[/color] ([color=BLUE]=[/color] 1 ok) ([color=BLUE]command[/color] ([color=BLUE]strcat[/color] [color=MAROON]"_."[/color] ([color=BLUE]nth[/color] ([color=BLUE]atoi[/color] *com) coms))))
  ([color=BLUE]princ[/color])
)
Title: Re: Double Click in a List_Box
Post by: johnson on May 05, 2011, 11:02:32 AM
nice one.we can use command also?lee....like copy text(replaced by that "Electrical" "Structural" "Plumbing" "Foundation")  double click means copy commend should active.....possible?

Many things are possible.  :-)

can you say for sample?i have tried with this.but this one autocad alert box.so command is not support.

The functionality you are looking for could probably be achieved using the allow_accept attribute, since the command would be started using the same action as the accept tile.

Example:
Code: [Select]
([color=BLUE]defun[/color] c:test ( [color=BLUE]/[/color] *error* coms dch file ok tmp )
 
  [color=GREEN];;----------------------------------------------;;[/color]
  [color=GREEN];; Example by Lee Mac 2011  -  www.lee-mac.com  ;;[/color]
  [color=GREEN];;----------------------------------------------;;[/color]

  ([color=BLUE]defun[/color] *error* ( msg )
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] dch ([color=BLUE]<[/color] 0 dch)) ([color=BLUE]unload_dialog[/color] dch))
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] tmp ([color=BLUE]setq[/color] tmp ([color=BLUE]findfile[/color] tmp))) ([color=BLUE]vl-file-delete[/color] tmp))   
    ([color=BLUE]if[/color] ([color=BLUE]and[/color] msg ([color=BLUE]not[/color] ([color=BLUE]wcmatch[/color] ([color=BLUE]strcase[/color] msg) [color=MAROON]"*BREAK,*CANCEL*,*EXIT*"[/color])))
      ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\n** Error: "[/color] msg [color=MAROON]" **"[/color]))
    )
    ([color=BLUE]princ[/color])
  )

  ([color=BLUE]setq[/color] coms
   '(
      [color=MAROON]"LINE"[/color]
      [color=MAROON]"CIRCLE"[/color]
      [color=MAROON]"ELLIPSE"[/color]
      [color=MAROON]"XLINE"[/color]
      [color=MAROON]"PLINE"[/color]
      [color=MAROON]"POLYGON"[/color]
      [color=MAROON]"ARC"[/color]
      [color=MAROON]"POINT"[/color]
    )
  )

  ([color=BLUE]cond[/color]
    (
      ([color=BLUE]not[/color]
        ([color=BLUE]and[/color] ([color=BLUE]setq[/color] file ([color=BLUE]open[/color] ([color=BLUE]setq[/color] tmp ([color=BLUE]vl-filename-mktemp[/color] [color=BLUE]nil[/color] [color=BLUE]nil[/color] [color=MAROON]".dcl"[/color])) [color=MAROON]"w"[/color]))
          ([color=BLUE]progn[/color]
            ([color=BLUE]write-line[/color]
              ([color=BLUE]strcat[/color]
                [color=MAROON]"com : dialog { label = \"Commands\"; spacer; "[/color]
                [color=MAROON]"  : list_box { key = \"lst\"; alignment = centered; allow_accept = true; } ok_cancel; }"[/color]
              )
              file
            )
            ([color=BLUE]<[/color] 0 ([color=BLUE]setq[/color] file ([color=BLUE]close[/color] file) dch ([color=BLUE]load_dialog[/color] tmp)))
          )
          ([color=BLUE]new_dialog[/color] [color=MAROON]"com"[/color] dch)
        )
      )
      ([color=BLUE]princ[/color] [color=MAROON]"\n--> Error Loading Dialog."[/color])
    )
    ([color=BLUE]t[/color]
      ([color=BLUE]start_list[/color] [color=MAROON]"lst"[/color])
      ([color=BLUE]mapcar[/color] '[color=BLUE]add_list[/color] ([color=BLUE]setq[/color] coms ([color=BLUE]acad_strlsort[/color] coms))) ([color=BLUE]end_list[/color])

      ([color=BLUE]setq[/color] *com ([color=BLUE]set_tile[/color] [color=MAROON]"lst"[/color] ([color=BLUE]cond[/color] ( *com ) ( [color=MAROON]"0"[/color] ))))
      ([color=BLUE]action_tile[/color] [color=MAROON]"lst"[/color] [color=MAROON]"(setq *com $value)"[/color])

      ([color=BLUE]setq[/color] ok ([color=BLUE]start_dialog[/color]))
    )
  )

  (*error* [color=BLUE]nil[/color])
  ([color=BLUE]if[/color] ([color=BLUE]=[/color] 1 ok) ([color=BLUE]command[/color] ([color=BLUE]strcat[/color] [color=MAROON]"_."[/color] ([color=BLUE]nth[/color] ([color=BLUE]atoi[/color] *com) coms))))
  ([color=BLUE]princ[/color])
)



lee our lisp commands is not supporting here!!???its supporting only cad commands.why?
Title: Re: Double Click in a List_Box
Post by: Lee Mac on May 05, 2011, 12:49:11 PM
lee our lisp commands is not supporting here!!???its supporting only cad commands.why?

Because the code was designed for AutoCAD commands, not LISP functions.
Title: Re: Double Click in a List_Box
Post by: johnson on May 05, 2011, 08:55:11 PM
lee our lisp commands is not supporting here!!???its supporting only cad commands.why?

Because the code was designed for AutoCAD commands, not LISP functions.

how can modify this for lsp commands lee
Title: Re: Double Click in a List_Box
Post by: Lee Mac on May 06, 2011, 06:39:03 AM
lee our lisp commands is not supporting here!!???its supporting only cad commands.why?

Because the code was designed for AutoCAD commands, not LISP functions.

how can modify this for lsp commands lee

You would have to change the line:

Code: [Select]
  (if (= 1 ok) (command (strcat "_." (nth (atoi *com) coms))))
To call the LISP function instead, something like:

Code: [Select]
  (if (= 1 ok) (eval (read (strcat "(c:" (nth (atoi *com) coms) ")"))))
Title: Re: Double Click in a List_Box
Post by: andrew_nao on May 06, 2011, 10:46:44 AM
JBuz >  I have had a look at OpenDCL.com - may look into getting into it... not sure how easy it is to get to grips with though...   :|

Lee, If i can whiz around in this you absolutely will be able to
it is very easy to learn in a days time