×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How To "Re-Assemble" Exploded Block

How To "Re-Assemble" Exploded Block

How To "Re-Assemble" Exploded Block

(OP)
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

RE: How To "Re-Assemble" Exploded Block

Hi TTops,

It doesn't look as though you are extracting attributes or unique text strings so why not just talk to the block definition?

CODE

****Begin Code********
Global ExplodedObjects As Variant
Dim SelectedBlockReference As AcadBlockReference
Dim Blk as AcadBlock
Dim Ent as AcadEntity
Dim SelectionSet As AcadSelectionSet
Dim BOMPieceMarkRef as String
Dim BOMPieceMarkID As String
Dim TheLayer As String

Set SelectionSet = ThisDrawing.ActiveSelectionSet
Set SelectedBlockReference = SelectionSet(0)
Set Blk = ThisDrawing.Blocks(SelectedBlockReference.Name)

For Each Ent in Blk
  If BlkEnt.ObjectName = "AcDbText" Then
    BOMPieceMarkRef = Ent.TextString
    BOMPieceMarkID = Ent.Hyperlinks.Item
    TheLayer = Ent.Layer
  End If
Next Ent

*****End Code******

HTH
Todd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close