+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Forum Newbie
    Discipline
    Civil
    Using
    Map 3D 2017
    Join Date
    Apr 2018
    Posts
    2

    Default Changing value of attribute A of a Block with value of attribute B

    Registered forum members do not see this ad.

    I was given a template with blocks.
    One of the block has an attribute with a text value (text value is in separate layer from the geometry)
    I would like to copy the values of Attribute A to the Attribute B, all inside the same block.

    Is there a way to do this in a more automatic way?

    Thanks!

  2. #2
    Full Member pendean's Avatar
    Computer Details
    pendean's Computer Details
    Operating System:
    Windows 10 64it Pro
    Computer:
    Lenovo WorkStation
    Discipline
    Architectural
    Using
    AutoCAD 2018
    Join Date
    Jun 2011
    Location
    Texas
    Posts
    93

    Default

    The second attribute needs to be a FIELD https://www.youtube.com/watch?v=N7auNegVcxw
    --
    Dean Saadallah
    AutoCAD and LT User
    BLOG|TW|FB|PIN
    --

  3. #3
    Forum Newbie
    Discipline
    Civil
    Using
    Map 3D 2017
    Join Date
    Apr 2018
    Posts
    2

    Default

    Quote Originally Posted by ghsotwriter View Post
    I was given a template with blocks.
    One of the block has an attribute with a text value (text value is in separate layer from the geometry)
    I would like to copy the values of Attribute A to the Attribute B, all inside the same block.

    Is there a way to do this in a more automatic way?

    Thanks!
    I mistyped. My last sentence i meant to copy the values of Attribute B to the Attribute A, all inside the same block.

    Thanks for the quick reply pendean!

  4. #4
    Full Member pendean's Avatar
    Computer Details
    pendean's Computer Details
    Operating System:
    Windows 10 64it Pro
    Computer:
    Lenovo WorkStation
    Discipline
    Architectural
    Using
    AutoCAD 2018
    Join Date
    Jun 2011
    Location
    Texas
    Posts
    93

    Default

    Not sure my answer would change even with the new info: are your attributes tags unique from each other, or did you simply copy the first for the second location? posting sample dwg files might help others help you. Let us know.
    --
    Dean Saadallah
    AutoCAD and LT User
    BLOG|TW|FB|PIN
    --

  5. #5
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,406

    Default

    Registered forum members do not see this ad.

    Like pendean a common asked for is to do Revision updates where the revision is bumped in a block containg multipe rows of attributes. A simple way is knowing the attribute order of creation and using the att number rather than tag names, cut att 3 and paste into att 6.
    Something like this
    Code:
    ; Change attribute value by created position
    ; by Alan H 
    (vl-load-com)
    (setq y 1)
    (setq ss1 (car (entsel)))
    (setq bname (vla-get-name(vlax-ename->vla-object SS1))) 
     
    (setq x (getint "\nEnter line no to pick")) ; change this line in block
    (SETQ newstrblank ".")
    (foreach att (vlax-invoke (vlax-ename->vla-object SS1) 'getattributes)
        (if (= y x)
        (progn
        (setq newstr (vla-get-textstring att ))
        (vla-put-textstring att newstrblank)
        )
        )
        (setq y (+ Y 1))
    )
    (setq y 1)
    (setq x (getint "\nEnter line no to move to"))
    (foreach att (vlax-invoke (vlax-ename->vla-object SS1) 'getattributes)
        (if (= y x)
        (vla-put-textstring att newstr)
        )
        (setq y (+ Y 1))
    )
    (princ)
    A man who never made mistakes never made anything

Similar Threads

  1. Change block by changing attribute ?
    By con in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 5th Dec 2017, 09:35 am
  2. Match most current attribute value to another attribute in title block
    By Da Ballz in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 28th Jun 2017, 02:19 am
  3. Replies: 40
    Last Post: 19th Aug 2016, 02:11 am
  4. changing attribute text width without having to select the block...
    By chauncy274 in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 9th Mar 2016, 08:27 pm
  5. VBA program to pick an attribute in a multi attribute block
    By muck in forum .NET, ObjectARX & VBA
    Replies: 3
    Last Post: 22nd Dec 2010, 01:46 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts