open drawing without viewing

open drawing without viewing

Andy73
Contributor Contributor
326 Views
2 Replies
Message 1 of 3

open drawing without viewing

Andy73
Contributor
Contributor
I am working a routine that I wblock out some blocks to self named files. I then need to open each file to do thing like convert the block attributes to text, explode the block , rename some layers, ect... Is there a way to open a document "not visible" to save on the graphics processing time. By some blocks I mean upwards of 300.

Thank you
Andy
0 Likes
327 Views
2 Replies
Replies (2)
Message 2 of 3

arcticad
Advisor
Advisor
You have to use ObjectDBX to get the Database of the file.
{code}


Function test1()
Dim FileName As String
FileName = "c:\1.dwg"

Set ODBX = GetOdbx
On Error Resume Next
ODBX.Open FileName

If not Error = 0 Then

For Each item In ODBX.Modelspace
If TypeOf item Is AcadBlockReference Then
MsgBox item.name
End If
Next

End If


End Function

Function GetOdbx() As Variant
Dim ODBX As Variant

If ThisDrawing.GetVariable("acadver") = "16.1s (LMS Tech)" Then
Set ODBX = GetInterfaceObject("ObjectDBX.AxDbDocument.16")
End If

If ThisDrawing.GetVariable("acadver") = "16.0" Then
Set ODBX = GetInterfaceObject("ObjectDBX.AxDbDocument.16")
End If

If ThisDrawing.GetVariable("acadver") = "17.1s (LMS Tech)" Then
Set ODBX = GetInterfaceObject("ObjectDBX.AxDbDocument.17")
End If

If ThisDrawing.GetVariable("acadver") = "17.2s (LMS Tech)" Then
Set ODBX = GetInterfaceObject("ObjectDBX.AxDbDocument.17")
End If


Set GetOdbx = ODBX

End Function
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 3 of 3

Anonymous
Not applicable
you could also set the regenauto variable off and application.Visible = False
0 Likes