Message 1 of 9
exploding blocks
Not applicable
05-23-2002
12:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm cycling through a selection set of blocks, and I explode all the blocks
one by one (as long as they meet certain criteria). However, AutoCAD,
instead of simply exploding the blocks, makes a bad 'exploded' copy of the
block (with the text & dimensions also exploded) and places it right on top
of the existing block which is untouched. What is going on!!??
portion of code(note: this is in VB not VBA):
For intCount = 1 To 3 '''iterate 3 times for nested blocks
'''check if selection set exists and, if so, delete it
intSSCount = MyACAD.ActiveDocument.SelectionSets.Count
For intCount2 = 0 To intSSCount - 1
If MyACAD.ActiveDocument.SelectionSets.Item(intCount2).Name =
"DeleteBlock" Then
MyACAD.ActiveDocument.SelectionSets.Item("DeleteBlock").Delete
Exit For
End If
Next
'''(re)make selection set
Set ssBlock = MyACAD.ActiveDocument.SelectionSets.Add("DeleteBlock")
intCodes(0) = 0 'sets filter to block name
varCodeValues(0) = "INSERT"
ssBlock.Select acSelectionSetAll, , , intCodes, varCodeValues
intBlockCount = ssBlock.Count - 1
'''explode blocks
On Error Resume Next
For intCount2 = 0 To intBlockCount
Set objBlockRef = ssBlock(intCount2)
If OrigIDExists(objBlockRef.Name) Then ''''checks block criteria
before exploding
objBlockRef.Explode
End If
Next
On Error GoTo 0
Next
Thank you very much,
Edward
one by one (as long as they meet certain criteria). However, AutoCAD,
instead of simply exploding the blocks, makes a bad 'exploded' copy of the
block (with the text & dimensions also exploded) and places it right on top
of the existing block which is untouched. What is going on!!??
portion of code(note: this is in VB not VBA):
For intCount = 1 To 3 '''iterate 3 times for nested blocks
'''check if selection set exists and, if so, delete it
intSSCount = MyACAD.ActiveDocument.SelectionSets.Count
For intCount2 = 0 To intSSCount - 1
If MyACAD.ActiveDocument.SelectionSets.Item(intCount2).Name =
"DeleteBlock" Then
MyACAD.ActiveDocument.SelectionSets.Item("DeleteBlock").Delete
Exit For
End If
Next
'''(re)make selection set
Set ssBlock = MyACAD.ActiveDocument.SelectionSets.Add("DeleteBlock")
intCodes(0) = 0 'sets filter to block name
varCodeValues(0) = "INSERT"
ssBlock.Select acSelectionSetAll, , , intCodes, varCodeValues
intBlockCount = ssBlock.Count - 1
'''explode blocks
On Error Resume Next
For intCount2 = 0 To intBlockCount
Set objBlockRef = ssBlock(intCount2)
If OrigIDExists(objBlockRef.Name) Then ''''checks block criteria
before exploding
objBlockRef.Explode
End If
Next
On Error GoTo 0
Next
Thank you very much,
Edward