block's sequence end - seqend

Discussion in 'AutoCAD' started by Brent, Mar 1, 2004.

  1. Brent

    Brent Guest

    In vba when I copy a block object and change the copied block's layer, the
    new block's sequence end value stays the same as the original block's value.
    Is there a fix for this problem? I've tried to search the news group and
    also Adesk's web based discussion group. There was a reference to a fix by
    Frank O. but his website didn't list the stated program any longer. Any
    response would be appreciated.

    Thanks in advance,

    Brent
     
    Brent, Mar 1, 2004
    #1
  2. Brent

    KG Guest

    Use this code snippet.

    Dim currBlk As AcadBlockReference 'contains the reference to the block to
    be changed...
    Dim handHEX As String
    Dim handDBL As Double
    Dim tempOBJ As AcadEntity
    Dim blkID As Long


    'if it has attributes, change seqend...
    'if a block has no attributes, there is no SEQEND...
    If currBlk.HasAttributes Then
    handHEX = "&H" & currBlk.Handle
    blkID = currBlk.ObjectID
    'loop until we find seqend or move on to another entity...
    Do
    handDBL = CDbl(handHEX) + 1
    handHEX = Hex(handDBL)
    Set tempOBJ = ThisDrawing.HandleToObject(handHEX)
    If tempOBJ.ObjectName = "AcDbSequenceEnd" Then
    tempOBJ.Layer = "YourLayerNameHere"
    tempOBJ.Update
    Exit Do
    End If
    handHEX = "&H" & handHEX
    Loop Until blkID <> tempOBJ.OwnerID
    End If
     
    KG, Mar 2, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.