Here is one answer.
--
Public Sub SaveBlockToDisk(BlockName As String,
FilePath As String)
Dim Block As AcadBlock
Dim BlockRef As
AcadBlockReference
Dim Sset As AcadSelectionSet
Dim Point(0 To 2) As
Double
For Each Block In
ThisDrawing.Blocks
If Block.Name = BlockName
Then
'create insertion
point
Point(0) = 0: Point(1) = 0: Point(2) =
0
'insert the
block
Set BlockRef =
ThisDrawing.ModelSpace.InsertBlock(Point, BlockName, 1#, 1#, 1#,
0#)
'refresh
application
Application.Update
'create a selection set
object
Set Sset =
ThisDrawing.SelectionSets.Add("Temp")
'add the
block to the selection set
Sset.Select
acSelectionSetLast
'write the block to
file
ThisDrawing.Wblock FilePath &
BlockName & ".dwg", Sset
'delete the
temporary block reference
BlockRef.Delete
'delete the selection
set
Sset.Delete
'refresh
application
Application.Update
End If
Next Block
End
Sub
Public Sub Test()
SaveBlockToDisk
"Block1", "C:\"
End Sub
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Will
AutoCAD's VBA allow one to WBLOCK an AcadBlock?