Author Topic: Any way to suppress dynamic block message. Like a no for all opened files?  (Read 1464 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7027
This ran successfully  for me:


Code - Auto/Visual Lisp: [Select]
  1. (defun c:test (/ ws)
  2.   ;; RJP - 07.23.2018
  3.   (if (= 4 (getvar 'cmdactive))
  4.     (cond ((setq ws (vlax-get-or-create-object "wscript.shell"))
  5.            (vlax-invoke ws 'sendkeys "N")
  6.            (vlax-release-object ws)
  7.            (entmakex '((0 . "circle") (10 . (0 0 0)) (40 . 25)))
  8.            (vl-cmdf "_.qsave")
  9.           )
  10.     )
  11.   )
  12. )
  13.  
Script:
Quote
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (2) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (3) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (4) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (5) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (6) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN (7) - Copy.dwg"
(c:test)
_.close
_.open "G:\Ron\2018-07-23\AN_Breakline_Double_DYN ( 8) - Copy.dwg"
(c:test)
_.close

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

3dwannab

  • Newt
  • Posts: 32
This ran successfully for me
You best believe it did. How can I ever repay you? This has bugged me for years.

I've got it to work by putting this in my custom.lsp file which loads after the accadoc.lsp file.

I've wcmatch'd the filename for DYN so I'll get that popup which will, in turn, let me know to correct the filename to include DYN. (handy).

I've also added a line to hit enter also. This will be super useful on day to day editing of my dynamic blocks.

Code - Auto/Visual Lisp: [Select]
  1. (defun run_dynamic_dialog_script ()
  2.  (if (wcmatch (getvar 'dwgname) "*DYN*.dwg")
  3.   (progn
  4.    (command "_script" "Close_Dynamic_BK_Dialog")(princ)
  5.    (princ "\nYou HAVE opened a dynamic block.\n\nWozzers...\n-------------------------------------------------------\n")
  6.    ;; Comment this out if you don't want a new fancy custom dialog.
  7.    (alert "You HAVE opened a dynamic block.\n\nWozzers...\n-------------------------------------------------------\n")
  8.    )
  9.   (progn
  10.    (princ "\nYou HAVE NOT opened a dynamic block.\n\nWozzers...\n-------------------------------------------------------\n")
  11.    (alert "You HAVE NOT opened a dynamic block.\n\nWozzers...\n-------------------------------------------------------\n")
  12.    )
  13.   )
  14.  )(princ)
  15.  
  16. ;; http://www.theswamp.org/index.php?topic=54322.msg589125#msg589125
  17. (defun c:dynamic_dialog_close (/ ws)
  18. ;; RJP - 07.23.2018 - ronjonp
  19. (if (= 4 (getvar 'cmdactive))
  20.  (cond ((setq ws (vlax-get-or-create-object "wscript.shell"))
  21.   ;; This would be useful on a mass editing of dynamic blocks or even on day-to-day use
  22.   ; (vlax-invoke ws 'sendkeys "{ENTER}")
  23.   ;; else, use this to just open the file.
  24.   (vlax-invoke ws 'sendkeys "N")
  25.   )
  26.  )
  27.  )

Then created an scr with (empty line at enf of course):
Code: [Select]
(c:dynamic_dialog_close)

All of the above files are in the support path.



Now I have my own custom popup when I want.

Thanks once again.. !

« Last Edit: July 23, 2018, 04:07:42 PM by 3dwannab »

ronjonp

  • Needs a day job
  • Posts: 7027
Glad it worked out for you :)

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC