Hello,
I am trying to re-assemble a block that I have exploded. Is this possible? The block consisted of an ACADText object and an ACADLWPolyline object. I have successfully obtained the property values of the individual objects that formerly made up the block. Now I simply want to put the block back together. My code looks like the following:
****Begin Code********
Global ExplodedObjects As Variant
Dim SelectedBlockReference As AcadBlockReference
Dim SelectionSet As AcadSelectionSet
Dim BOMPieceMarkRef as String
Dim BOMPieceMarkID As String
Dim TheLayer As String
Set SelectionSet = ThisDrawing.ActiveSelectionSet
Set SelectedBlockReference = SelectionSet(0)
ExplodedObjects = SelectedBlockReference.Explode
For i = 0 To UBound(ExplodedObjects)
ExplodedObjects(i).Update
If ExplodedObjects(i).ObjectName = "AcDbText" Then
BOMPieceMarkRef = ExplodedObjects(i).TextString
BOMPieceMarkID = ExplodedObjects(i).Hyperlinks.Item(0).URL
LayerName = ExplodedObjects(i).Layer
End If
ExplodedObjects(i).Update
Next
*****End Code******
My other option here is to reference the ACADText object's properties inside the block object. That would be nice because I wouldn't have to explode the block at all, but I can't figure out how to do that yet. Any help is greatly appreciated.
Thanks,
T-Tops
I am trying to re-assemble a block that I have exploded. Is this possible? The block consisted of an ACADText object and an ACADLWPolyline object. I have successfully obtained the property values of the individual objects that formerly made up the block. Now I simply want to put the block back together. My code looks like the following:
****Begin Code********
Global ExplodedObjects As Variant
Dim SelectedBlockReference As AcadBlockReference
Dim SelectionSet As AcadSelectionSet
Dim BOMPieceMarkRef as String
Dim BOMPieceMarkID As String
Dim TheLayer As String
Set SelectionSet = ThisDrawing.ActiveSelectionSet
Set SelectedBlockReference = SelectionSet(0)
ExplodedObjects = SelectedBlockReference.Explode
For i = 0 To UBound(ExplodedObjects)
ExplodedObjects(i).Update
If ExplodedObjects(i).ObjectName = "AcDbText" Then
BOMPieceMarkRef = ExplodedObjects(i).TextString
BOMPieceMarkID = ExplodedObjects(i).Hyperlinks.Item(0).URL
LayerName = ExplodedObjects(i).Layer
End If
ExplodedObjects(i).Update
Next
*****End Code******
My other option here is to reference the ACADText object's properties inside the block object. That would be nice because I wouldn't have to explode the block at all, but I can't figure out how to do that yet. Any help is greatly appreciated.
Thanks,
T-Tops