Purge a Drawing 2000 vs 2002

Purge a Drawing 2000 vs 2002

Anonymous
Not applicable
284 Views
4 Replies
Message 1 of 5

Purge a Drawing 2000 vs 2002

Anonymous
Not applicable
How can I purge an entire drawing using either 2000 or 2002? It seems that
2002 uses a dialog box while 2000 is command line only. This is causing
problems since we have both versions in our office.

Thanks in Advance

Jerry Bartling
0 Likes
285 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
I assume your using the SendCommand Method? If you are then the similar command is -purge, picking which options you want after that.

Of course, you could use the Purge Method on the document object. The following is from the VBA help:

Sub Example_PurgeAll()
' This example removes all unused named references from the database
ThisDrawing.PurgeAll
End Sub
0 Likes
Message 3 of 5

Anonymous
Not applicable
Yes I am using the send command. Here is a snippet of code, certainly there
is a better/cleaner way. The problem with using -purge is that it doesn't
work in 2000. I have tried using purgeall in 2000 but with mixed results.

Thanks Jerry

For i = 1 To 8
ThisDrawing.SendCommand "explode" & vbCr & "all" & vbCr & vbCr
If Version = "15.0" Then
ThisDrawing.SendCommand "purge" & vbCr & "all" & vbCr & "*" &
vbCr & "no" & vbCr
Else
ThisDrawing.SendCommand "-purge" & vbCr & "all" & vbCr & "*" &
vbCr & "no" & vbCr
End If
Next


wrote in message news:f10ee44.0@WebX.maYIadrTaRb...
I assume your using the SendCommand Method? If you are then the similar
command is -purge, picking which options you want after that.
Of course, you could use the Purge Method on the document object. The
following is from the VBA help:
Sub Example_PurgeAll()
' This example removes all unused named references from the database
ThisDrawing.PurgeAll
End Sub
0 Likes
Message 4 of 5

Anonymous
Not applicable
Jerry,

-purge works just fine on my machine (LDD R2i). Purge will bring up a
dialog box. It may be different in 2000 but it seems to work in 2000i.

Brian

"Jerry" wrote in message
news:9678488C287574389E7D0B4804960A2F@in.WebX.maYIadrTaRb...
> Yes I am using the send command. Here is a snippet of code, certainly
there
> is a better/cleaner way. The problem with using -purge is that it doesn't
> work in 2000. I have tried using purgeall in 2000 but with mixed results.
>
> Thanks Jerry
>
> For i = 1 To 8
> ThisDrawing.SendCommand "explode" & vbCr & "all" & vbCr & vbCr
> If Version = "15.0" Then
> ThisDrawing.SendCommand "purge" & vbCr & "all" & vbCr & "*" &
> vbCr & "no" & vbCr
> Else
> ThisDrawing.SendCommand "-purge" & vbCr & "all" & vbCr & "*" &
> vbCr & "no" & vbCr
> End If
> Next
>
>
> wrote in message news:f10ee44.0@WebX.maYIadrTaRb...
> I assume your using the SendCommand Method? If you are then the similar
> command is -purge, picking which options you want after that.
> Of course, you could use the Purge Method on the document object. The
> following is from the VBA help:
> Sub Example_PurgeAll()
> ' This example removes all unused named references from the database
> ThisDrawing.PurgeAll
> End Sub
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
If the VBA route doesn't work you could always use lisp, with a main function calling first a secondary one that does the purge for acad2002 using -purge. If it fails, which it would for acad2000, then (calling it using) vl-catch-all-apply would keep the routine running, allow you to test whether an error object was returned, and then to call the one that runs for acad2000.
0 Likes