Jump to content

Need right click to reopen my DCL dialog


rwsice9

Recommended Posts

OK LISP Masters! I have this one ALMOST where I need it. (some of the functions are still incomplete, but I know how to get those to work). Here is what this lisp is supposed to do.

 

You are presented with a dialog box with options for device type, and other device options, then based on your options, it inserts a block, adds your other picked options, then keeps going. When you right click, the dialog should return, letting you pick different options, so you can insert different blocks.

 

I have the whole thing working, EXCEPT for the "right click to return the dialog". Can anyone please help?

 

(defun c:notif(/ :dlgId :done);new combined notification
 (setq CVR (getvar "useri2")
SCL (GETVAR "userr1")
lyr (getvar "clayer")
osm (getvar "osmode")
)  
 (if (= 0 scl)(command (alert "Please Set your scale and try agagin")(exit)))
 (COMMAND "OSMODE" "514")
(COMMAND "-LAYER" "s" "F-ALRM-INDC" "")

    (setq :dlgId (load_dialog "notif.dcl"))
  (setq :done 3)
 (while (/= :done 0)
    (if (not (new_dialog "DLG_Notif" :dlgId))
      (exit)
      )

 (action_tile "devStrobe" "(setq dev 1)")
 (action_tile "devHRNStrobe" "(setq dev 2)")
 (action_tile "devSPKStrobe" "(setq dev 3)")
 (action_tile "devHorn" "(setq dev 4)")
 (action_tile "devSpeaker" "(setq dev 5)")
 (action_tile "mtWall" "(setq mt 1)")
 (action_tile "mtCeil" "(setq mt 2)")
 (action_tile "cd15" "(setq cd 15)")
 (action_tile "cd30" "(setq cd 30)")
 (action_tile "cd75" "(setq cd 75)")
 (action_tile "cd95" "(setq cd 95)")
 (action_tile "cd110" "(setq cd 110)")
 (action_tile "cd135" "(setq cd 135)")
 (action_tile "cd177" "(setq cd 177)")
 (action_tile "cd185" "(setq cd 185)")
 (action_tile "wat25" "(setq wat 4)")
 (action_tile "wat5" "(setq wat 5)")
 (action_tile "wat1" "(setq wat 1)")
 (action_tile "wat2" "(setq wat 2)")
 (action_tile "wat75" "(setq wat 7)")
 (action_tile "lensClear" "(setq lens 1)")
 (action_tile "lensAmber" "(setq lens 2)")
 (action_tile "lensCombo" "(setq lens 3)")
 (action_tile "spcWP" "(setq wp 1)")
 (action_tile "spcWG" "(setq wg 1)")
 (action_tile "accept" "(done_dialog 1)")
 (action_tile "cancel" "(done_dialog 0)")

 (setq :done (start_dialog))

(cond
 ((= :done 1)
  (setvar "cmdecho" 0)
 (if (= wat 4)(setq watt ".25W"))
 (if (= wat 5)(setq watt ".5W"))
 (if (= wat 1)(setq watt "1W"))
 (if (= wat 2)(setq watt "2W"))
 (if (= wat 7)(setq watt "7.5W"))
  (setq :txting 0)

(while (= 0 :txting)
  (initget 0)
(if (= dev 1) (progn (COMMAND "_.-INSERT" "FA_STROBE_ONLYW" pause SCL "" pause CD) (setq :txting 0))(setq :txting 1))
(if (= dev 2) (COMMAND "_.-INSERT" "FA_Hornstrobe" pause SCL "" pause CD))
 (if (= dev 3) (COMMAND "_.-INSERT" "FA_Speakerstrobe" pause SCL "" pause CD watt))

  )
  (setvar "cmdecho" 1)
  );done
 ((= :done 0)
  (prompt "\nEnd notification command.")
  )
 );cond
;    (if (= 1 cvr)(command "-layer" "s" "F-STRB-COVR" ""))
;  (setq elast (entlast))
;    (IF (= 1 CVR)(command "_.-insert" "sg-15cd" "_non"
;     (cdr (assoc 10 (entget elast))) "1" "" (* 180. (/ (cdr (assoc 50 (entget elast))) pi))))
   ); while
   (unload_dialog :dlgId)
 (COMMAND "CLAYER" LYR)
 (COMMAND "OSMODE" OSM)
 (princ)
 )

 

I also have the LISP and DCL files attached.

NOTIF.LSP

notif.dcl

Link to comment
Share on other sites

I would venture to something along the lines of...

(if *reopen*
(progn
 (setq *reopen* nil)
 (vlr-remove-all :vlr-mouse-reactor)
); /progn
); /if
(if (not *reopen*)
(setq *reopen* (vlr-mouse-reactor nil '((:vlr-beginrightclick . reopendiag))))
); /if
(defun reopendiag (<rea> <args>)
(:dlgId)
(princ)
); /defun

 

I'm not "master" (long shot from it), so the masters may have better solution.

 

I'm just stuck at terminating the right click reactor when done with the command; how to trigger (vlr-remove-all :vlr-mouse-reactor) off the Cancel button, maybe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...