Suppress all check dialog on open documents

Suppress all check dialog on open documents

dnicolini
Enthusiast Enthusiast
844 Views
4 Replies
Message 1 of 5

Suppress all check dialog on open documents

dnicolini
Enthusiast
Enthusiast

Hi All,

 

is there a way to suppress all check dialogs box during opening a document. I need to open a document in "silent mode". Now I have a first dialog for missing Xref, another one for shx font...

 

How can I set AutoCAD Application to open all document without show this dialogs box? System variables?

 

Thank you.

Regards,

Dario Nicolini

0 Likes
845 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor

There is a system variable "EXPERT" with value to be set from 0 to 5 that can suppress some prompts, but not all possible prompts. AFAIK, there is simply no reliable way to suppress all possible prompts opened by AutoCAD (AutoCAD editor, actually) when one tries to open a drawing in AutoCAD editor.

 

If your intention is to only access/manipulate drawing data itself, regardless how the drawing looks like in Acad editor, you could try to read the drawing into drawing database, rather than open it in Editor. This would make your drawing data accessing code a lot faster.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 5

dnicolini
Enthusiast
Enthusiast

I already tried with EXPERT and I can suppress the XRef dialog but not the shx. Do you know if there is a variabile for this kind of dialog?

 

I need to manipulate the drawing and also use the send command to use acad command.In this case can I use the database or I have to open the file? If I can do you have a sample code?

 

Thank you.

0 Likes
Message 4 of 5

norman.yuan
Mentor
Mentor

Assume you need to find a title block in a bunch of drawings and if found, read an attribute's value. In this case, you do not need to open the drawing in Editor, you simply do something like this:

 

Dim fileNames() as String=[.....] 'get an array of drawing file names

For Each dwgName As String in fileNames

  Using db As Database=New Database(Flase,True)

      db.ReadDwgFile(dwgName,FileOpenMode.OpenForReadAndAlLShare, False, "")

      ''Now you can search through the database/ModelSpace/Layout for the block

  End Using

Next

 

For accessing data in drawing file (database), in most cases, you do not have to use SendCommand(COM API) or SendStringToExecute(.NET API). As matter of fact, you should avoid them unless they are the only option in very special situation.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 5

dnicolini
Enthusiast
Enthusiast

Thank for the code.

 

I know that sendCommand is not good but I need to use for example: "overkill" command or "convert" to convert all polilyne and hatch.

 

How can I use this command without re-write all the code to do the same thing?

 

Thank you!

0 Likes