Placing block and moving Attribute field

Discussion in 'AutoCAD' started by Edward Bagby, Feb 18, 2005.

  1. Edward Bagby

    Edward Bagby Guest

    I want to place a block on a drawing and move one of the attribute fields to
    a different location each time I place the block.

    Can the locations of the attributes be accessed and changed? If so, how?


    Thanks for the help!

    Edward
     
    Edward Bagby, Feb 18, 2005
    #1
  2. Edward Bagby

    Mark Propst Guest

    Hi Edward,
    you could get a reference to the just inserted block reference - either
    placing it by code or select it on screen
    ex:
    (just an overview - you need to dim variables and do error checking etc
    obviously)
    set oBlkRef = AddBlockRef 'or whatever routine does the insertion
    'get the blocks attribute objects
    vAtts = oBlkRef.GetAttributes
    'for each one set it's location
    For lIdx = 0 to Ubound(vAtts)
    'get this attribute object
    oAttRef = vAtts(lIdx)
    'vPt = WhereYouWantThePoint
    'is it InsertionPoint, TextAlignmentPoint, or Alignment or
    TextInsertionPoint - or something like that
    'whatever the property is called - i forget at the moment
    'and you said "one of the attributes" so if you need to check the tag or
    value then an if clause here
    If oAttRef.TagString = TargetString ' or whatever qualification you need
    to use
    oAttRef.InsertionPoint = vPt'whatever point you want to put it at
    end if
    Next lIdx
    etc
    hth
    Mark
     
    Mark Propst, Feb 18, 2005
    #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.