Author Topic: help me user known command  (Read 2546 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
help me user known command
« on: August 05, 2010, 06:16:54 AM »
Dear All
I’m created xyz.vlx file so many file in combine in xyz.vlx
How can help me user known command
It’s possible create another auotlisp help file  

Example :

Command          Description
Co              Copy
M              Move
Ano              Automatic Numbering
Dr              Door
Ww              Window
Acal              Area Calulation   
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: help me user known command
« Reply #1 on: August 05, 2010, 06:32:07 AM »
see
AutoLISP Reference Guide > AutoLISP Functions > H Functions >help

Code: [Select]
(help [helpfile [topic [command]]])
(help "achelp.chm" "mycommand")

Sam

  • Bull Frog
  • Posts: 201
Re: help me user known command
« Reply #2 on: August 05, 2010, 07:08:57 AM »
see
AutoLISP Reference Guide > AutoLISP Functions > H Functions >help

Code: [Select]
(help [helpfile [topic [command]]])
(help "achelp.chm" "mycommand")
dear sir
thx for reply
see the link
i want this type utility
http://www.krupacadd.com/Acad/Main/Kcs_Acad_Options.htm#Status
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Re: help me user known command
« Reply #3 on: August 05, 2010, 08:48:33 AM »
How is this?
Code: [Select]
(defun C:BigBoard ( / userclick dlgname dcl_id  big-board-list _make-dialog)
  ;; bigboard
  (defun _make-dialog ( / fn f dcl )
    (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
          f (open fn "w")
          dcl
          '(
            "board : dialog {"
            ": list_box {"
            "key = \"selections\";"
            "multiple_select = true;"
            "height = 19;"
            "allow_accept = true;"
            "}"
            "ok_cancel;"
            "}"
            )
          )
    (mapcar
      (function
        (lambda ( x )
          (princ x f)
          (princ "\n" f)
          )
        )
      dcl
      )
    (close f)
    fn
    )
  (defun setItems (val lst / ret)
    (foreach n (mapcar (function (lambda (n) (- n 48)))
                       (vl-remove 32 (vl-string->list val))
                       )
             (setq ret (cons (nth n lst) ret))
             )
    (reverse ret)
    )
  (setq big-board-list '("Command           Description"
                         "-----------------------------------------------------------"
                         "Co                      Copy"
                         "M                       Move"
                         "Ano                    Automatic Numbering"
                         "Dr                      Door"
                         "Ww                    Window"
                         "Acal                   Area Calulation")
        )
  (setq dcl_id
        (load_dialog
          (setq dlgname (_make-dialog))))
  (if (not (new_dialog "board" dcl_id))(exit))
  (start_list "selections")
  (mapcar 'add_list big-board-list)
  (end_list)
  (setq userclick (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dlgname)
 (princ)
)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Sam

  • Bull Frog
  • Posts: 201
Re: help me user known command
« Reply #4 on: August 05, 2010, 12:02:00 PM »
How is this?
Code: [Select]
(defun C:BigBoard ( / userclick dlgname dcl_id  big-board-list _make-dialog)
  ;; bigboard
  (defun _make-dialog ( / fn f dcl )
    (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
          f (open fn "w")
          dcl
          '(
            "board : dialog {"
            ": list_box {"
            "key = \"selections\";"
            "multiple_select = true;"
            "height = 19;"
            "allow_accept = true;"
            "}"
            "ok_cancel;"
            "}"
            )
          )
    (mapcar
      (function
        (lambda ( x )
          (princ x f)
          (princ "\n" f)
          )
        )
      dcl
      )
    (close f)
    fn
    )
  (defun setItems (val lst / ret)
    (foreach n (mapcar (function (lambda (n) (- n 48)))
                       (vl-remove 32 (vl-string->list val))
                       )
             (setq ret (cons (nth n lst) ret))
             )
    (reverse ret)
    )
  (setq big-board-list '("Command           Description"
                         "-----------------------------------------------------------"
                         "Co                      Copy"
                         "M                       Move"
                         "Ano                    Automatic Numbering"
                         "Dr                      Door"
                         "Ww                    Window"
                         "Acal                   Area Calulation")
        )
  (setq dcl_id
        (load_dialog
          (setq dlgname (_make-dialog))))
  (if (not (new_dialog "board" dcl_id))(exit))
  (start_list "selections")
  (mapcar 'add_list big-board-list)
  (end_list)
  (setq userclick (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dlgname)
 (princ)
)

dear sir
thx for reply
very usefull
command can be run directly from this dialog
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Re: help me user known command
« Reply #5 on: August 05, 2010, 01:30:50 PM »
yes, just capture the user selection and parse the string returned.  For example, here is how you would  capture the user selection.
Code: [Select]
(defun C:BigBoard ( / userclick dlgname dcl_id  big-board-list _make-dialog)
  ;; bigboard
  (defun _make-dialog ( / fn f dcl )
    (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
          f (open fn "w")
          dcl
          '(
            "board : dialog {"
            ": list_box {"
            "key = \"selections\";"
            "multiple_select = true;"
            "height = 19;"
            "allow_accept = true;"
            "}"
            "ok_cancel;"
            "}"
            )
          )
    (mapcar
      (function
        (lambda ( x )
          (princ x f)
          (princ "\n" f)
          )
        )
      dcl
      )
    (close f)
    fn
    )
  (defun setItems (val lst / ret)
    (foreach n (mapcar (function (lambda (n) (- n 48)))
                       (vl-remove 32 (vl-string->list val))
                       )
             (setq ret (cons (nth n lst) ret))
             )
    (reverse ret)
    )
  (setq big-board-list '("Command           Description"
                         "-----------------------------------------------------------"
                         "Co                      Copy"
                         "M                       Move"
                         "Ano                    Automatic Numbering"
                         "Dr                      Door"
                         "Ww                    Window"
                         "Acal                   Area Calulation")
        )
  (setq dcl_id
        (load_dialog
          (setq dlgname (_make-dialog))))
  (if (not (new_dialog "board" dcl_id))(exit))
  (start_list "selections")
  (mapcar 'add_list big-board-list)
  (end_list)
  (action_tile "selections" "(setq strLst (setItems $value big-board-list))")
  (setq userclick (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dlgname)
  (and (= 1 userclick)
       (and strLst (print strLst)))
 (princ)
)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Sam

  • Bull Frog
  • Posts: 201
Re: help me user known command
« Reply #6 on: August 07, 2010, 01:09:08 AM »
yes, just capture the user selection and parse the string returned.  For example, here is how you would  capture the user selection.
Code: [Select]
(defun C:BigBoard ( / userclick dlgname dcl_id  big-board-list _make-dialog)
  ;; bigboard
  (defun _make-dialog ( / fn f dcl )
    (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
          f (open fn "w")
          dcl
          '(
            "board : dialog {"
            ": list_box {"
            "key = \"selections\";"
            "multiple_select = true;"
            "height = 19;"
            "allow_accept = true;"
            "}"
            "ok_cancel;"
            "}"
            )
          )
    (mapcar
      (function
        (lambda ( x )
          (princ x f)
          (princ "\n" f)
          )
        )
      dcl
      )
    (close f)
    fn
    )
  (defun setItems (val lst / ret)
    (foreach n (mapcar (function (lambda (n) (- n 48)))
                       (vl-remove 32 (vl-string->list val))
                       )
             (setq ret (cons (nth n lst) ret))
             )
    (reverse ret)
    )
  (setq big-board-list '("Command           Description"
                         "-----------------------------------------------------------"
                         "Co                      Copy"
                         "M                       Move"
                         "Ano                    Automatic Numbering"
                         "Dr                      Door"
                         "Ww                    Window"
                         "Acal                   Area Calulation")
        )
  (setq dcl_id
        (load_dialog
          (setq dlgname (_make-dialog))))
  (if (not (new_dialog "board" dcl_id))(exit))
  (start_list "selections")
  (mapcar 'add_list big-board-list)
  (end_list)
  (action_tile "selections" "(setq strLst (setItems $value big-board-list))")
  (setq userclick (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dlgname)
  (and (= 1 userclick)
       (and strLst (print strLst)))
 (princ)
)
dear sir
thx for help
how to execute command directly
see attached image   
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

Sam

  • Bull Frog
  • Posts: 201
Re: help me user known command
« Reply #7 on: April 16, 2013, 03:59:50 AM »
yes, just capture the user selection and parse the string returned.  For example, here is how you would  capture the user selection.
Code: [Select]
(defun C:BigBoard ( / userclick dlgname dcl_id  big-board-list _make-dialog)
  ;; bigboard
  (defun _make-dialog ( / fn f dcl )
    (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
          f (open fn "w")
          dcl
          '(
            "board : dialog {"
            ": list_box {"
            "key = \"selections\";"
            "multiple_select = true;"
            "height = 19;"
            "allow_accept = true;"
            "}"
            "ok_cancel;"
            "}"
            )
          )
    (mapcar
      (function
        (lambda ( x )
          (princ x f)
          (princ "\n" f)
          )
        )
      dcl
      )
    (close f)
    fn
    )
  (defun setItems (val lst / ret)
    (foreach n (mapcar (function (lambda (n) (- n 48)))
                       (vl-remove 32 (vl-string->list val))
                       )
             (setq ret (cons (nth n lst) ret))
             )
    (reverse ret)
    )
  (setq big-board-list '("Command           Description"
                         "-----------------------------------------------------------"
                         "Co                      Copy"
                         "M                       Move"
                         "Ano                    Automatic Numbering"
                         "Dr                      Door"
                         "Ww                    Window"
                         "Acal                   Area Calulation")
        )
  (setq dcl_id
        (load_dialog
          (setq dlgname (_make-dialog))))
  (if (not (new_dialog "board" dcl_id))(exit))
  (start_list "selections")
  (mapcar 'add_list big-board-list)
  (end_list)
  (action_tile "selections" "(setq strLst (setItems $value big-board-list))")
  (setq userclick (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dlgname)
  (and (= 1 userclick)
       (and strLst (print strLst)))
 (princ)
)
dear sir,
this lisp working in 2011 but not working 2013 (windows 8 64 bit)



Command: BIGBOARD
; error: bad argument type: FILE nil
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html