TheSwamp

CAD Forums => CAD General => Topic started by: 3dwannab on July 14, 2018, 03:09:57 PM

Title: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 14, 2018, 03:09:57 PM
See:

(https://i.imgur.com/4C5nQQ0.jpg)

I want to batch my block library files with lisps and scripts but this message it a pain in my derriere.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: cadtag on July 16, 2018, 07:19:11 AM
maybe try running thru accoreconsole.exe instead of the gui?
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 16, 2018, 07:35:18 AM
Thanks, I may try that this evening when I have time and come back with my result.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 20, 2018, 04:47:10 PM
Thanks, I may try that this evening when I have time and come back with my result.
Yes, I've done that accoreconsole.exe method using ScriptPro but it'll only run the scr.

Not sure how to run my autorun lisp files on them when a drawing opens from my block library.

SP fails when running in ACAD.exe mode.

Maybe there's a regedit item that could be modified!!  :knuppel2:
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: mjfarrell on July 20, 2018, 07:22:13 PM
Does the EXPERT variable suppress that dialog?
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 21, 2018, 04:46:16 AM
Nope, already tried that.

Pretty sure there'll never be a no for all when opening multiple drawings containing parameters!

Still searching regedit for it.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: ribarm on July 21, 2018, 07:03:16 AM
Why don't you hit No and then exit BEDITOR and QSAVE DWG... I think the pop up sould dissappear then...
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 21, 2018, 08:08:03 AM
Why don't you hit No and then exit BEDITOR and QSAVE DWG... I think the pop up sould dissappear then...
I want to open every block file in my block library so doing that for the amount of DYN drawings (300+) I have would be just  :idiot2:
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: ribarm on July 21, 2018, 08:39:19 AM
Why don't you hit No and then exit BEDITOR and QSAVE DWG... I think the pop up sould dissappear then...
I want to open every block file in my block library so doing that for the amount of DYN drawings (300+) I have would be just  :idiot2:

This only tells us that you acquired dynamic blocks from other source... You haven't created them... If you want you could zip them and share link over dropbox or cloud and with help of others they could be resaved in format you desire... But I suppose you refuse to share them despite they are not your courtesy???
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 21, 2018, 01:03:51 PM
This only tells us that you acquired dynamic blocks from other source... You haven't created them... If you want you could zip them and share link over dropbox or cloud and with help of others they could be resaved in format you desire... But I suppose you refuse to share them despite they are not your courtesy???
You assume wrong. I've been making DBs from they were first added to ACAD.

My courtesy. Really?
I don't want them resaved in any format. I can use a plugin on the app store for that. Maybe re-read what I've said instead of slandering me that might set you straight. And no, you can't have my 300+ DB block dwgs that I've spent the last 12 years working on.

Here you can have one as a good will gesture.

I really hope this isin't as unwelcoming as the foobar2000 forum.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: ChrisCarlson on July 23, 2018, 08:03:27 AM
I'm confused as to what you are asking in general, not specifically. What are you attempting to do with block.dwg file in your processes?

Importing the block.dwg file into an existing drawing should not cause that dialog to display and allow full function of the block. You can then export the block out into a block.dwg file. However, opening the block.dwg file should cause that dialog to appear as AutoCAD is alerting you to the fact it isn't really a drawing file.

To answer your specific question, there are 3rd party applications which can automatically select an option for a dialog prompt. Something similar to ClickYes.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: huiz on July 23, 2018, 08:48:10 AM
I'm confused as to what you are asking in general, not specifically. What are you attempting to do with block.dwg file in your processes?

Importing the block.dwg file into an existing drawing should not cause that dialog to display and allow full function of the block. You can then export the block out into a block.dwg file. However, opening the block.dwg file should cause that dialog to appear as AutoCAD is alerting you to the fact it isn't really a drawing file.


In the OP he clearly explains that he want to batch process his blocks. Probably in this batch process the blocks need to be opened (as single drawings), do something and then save. So it is not about inserting the blocks in a current drawing and save that.


The messagebox can't be suppressed unfortunately, at least I've not found a solution for Lisp nor Script. I assume you can write a .NET plugin that opens each drawing and process it as a side database. But then you must be capable of writing plugins.


Normally The Swamp is very welcoming to new members but I think not everybody did understand the question completely :-)

Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 23, 2018, 10:28:56 AM
To answer your specific question, there are 3rd party applications which can automatically select an option for a dialog prompt. Something similar to ClickYes.
Exactly, what my next thing was to do. I opened up spy++ to check that dialog and look for it in the registry but there was nothing. I'll look into that app. Thank you.

In the OP he clearly explains that he want to batch process his blocks. Probably in this batch process the blocks need to be opened (as single drawings), do something and then save. So it is not about inserting the blocks in a current drawing and save that.


The messagebox can't be suppressed unfortunately, at least I've not found a solution for Lisp nor Script. I assume you can write a .NET plugin that opens each drawing and process it as a side database. But then you must be capable of writing plugins.

Normally The Swamp is very welcoming to new members but I think not everybody did understand the question completely :-)
Precisely what I intend to do. My habit of blocks management is to have them as separate dwgs.

This dialog doesn't appear when you BEDIT them in a drawing. But this doesn't help me here.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 23, 2018, 10:40:01 AM
Found DialogDevil which is the ticket.

Simply, drag the icon to the No button and it'll close it automatically thereafter.

Case closed. Thanks guys for your help.

ED.
Spoke to soon. It appears that pesky dialog has a different handle every time.
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 23, 2018, 11:31:15 AM
This is two different dwg files with authoring elements. 2 handles / 1 dialog.

As two cancels on the keyboard can get rid of that dialog, I also tried to put
Code: [Select]
(command ^C^C) in my accaddoc lsp but it doesn't work. That dialog prevents that from happening or it just doesn't work.

(https://i.imgur.com/JCkbLkU.jpg)
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: ronjonp on July 23, 2018, 11:46:54 AM
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
Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: 3dwannab on July 23, 2018, 03:59:16 PM
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.. !

Title: Re: Any way to suppress dynamic block message. Like a no for all opened files?
Post by: ronjonp on July 23, 2018, 04:10:30 PM
Glad it worked out for you :)