Results 1 to 4 of 4

Thread: Refreshing Attribute / Block definitions All Attributes to specified layer.

  1. #1
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Refreshing Attribute / Block definitions All Attributes to specified layer.

    Is there a way to refresh attribute definitions?
    After changing the properties of the attributes, previously inserted blocks still show on the old layer.

    Or
    Change all the attributes to a different layer?

    Example

    Block with attributes and objects on layer "E-LITE".

    We want the light to show but not the attribute.

    I would like to put the attributes on "E-LITE-ATTR" (our electrical department still needs the attributes to show)

    Any help would be greatly appreciated.

    Below is a lsp that rotates all the attributes, perhaps we can use this to change the attributes "layer"
    Thank you aaronic_abacus for the original lsp at the link
    http://forums.augi.com/showthread.ph...to-remain-at-0

    Code:
    (DEFUN C:SAT (/ BS BSL CT NOFUV NOFNU LP NE NEL NEAET NEA NEAS OFNU NNEL)
     (PROMPT "\n*SET ATTRIBUTE ROTATION* ")
     (PROMPT "\nSelect block with attributes to rotate: ")
     (SETQ BS (SSGET '((-4 . "<AND") (0 . "INSERT") (66 . 1) (-4 . "AND>")) ))
     (SETQ BSL (SSLENGTH BS))
     (SETQ CT (- BSL 1))
     (SETQ NOFUV (GETANGLE "\nNew attribute rotation angle: "))
     (SETQ LP 1)
     (WHILE LP
      (SETQ NE (SSNAME BS CT))
      (SETQ CT2 0)
      (SETQ LP2 1)
      (WHILE LP2
       (SETQ NE (ENTNEXT NE))
       (SETQ NEL (ENTGET NE))
       (SETQ NEAET (CDR (ASSOC 0 NEL)))
       (SETQ NEA (ASSOC 50 NEL))
       (SETQ NEAS (CDR NEA))
       (IF (= NEAET "ATTRIB") 
        (PROGN
         (IF (/= NEA NIL)
          (PROGN
           (SETQ NOFNU (CONS 50 NOFUV))
           (SETQ OFNU NEA)
           (SETQ NNEL (SUBST NOFNU OFNU NEL))
           (ENTMOD NNEL)
           (ENTUPD NE)
         ));END PROGN/IF NEA
       ));END PROGN/IF NEAET
       (IF (= NEAET "SEQEND") (SETQ LP2 NIL))
      );END WHILE LP2
      (SETQ CT (- CT 1))
      (IF (< CT 0) (SETQ LP NIL))
     );END WHILE LP
     (PRINC)
    );END SAT

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,523
    Login to Give a bone
    0

    Default Re: Refreshing Attribute / Block definitions All Attributes to specified layer.

    Quote Originally Posted by ReachAndre View Post
    Is there a way to refresh attribute definitions?
    After changing the properties of the attributes, previously inserted blocks still show on the old layer.
    ...
    I don't know about the layer thing, but the ATTSYNC command works for updating block attributes back to thier definitions.
    So if you update/fix a block attribute, you run the attsync command, select the block and all those blocks will update.

    HTH

  3. #3
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: Refreshing Attribute / Block definitions All Attributes to specified layer.

    I was under the impression attsync was for annotative blocks only but this worked great.
    Thanks,
    Andre

  4. #4
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: Refreshing Attribute / Block definitions All Attributes to specified layer.

    Code:
    (DEFUN C:SAL (/ BS BSL CT NOFUV NOFNU LP NE NEL NEAET NEA NEAS OFNU NNEL)
     (PROMPT "\n*SET ATTRIBUTE LAYER* ")
     (PROMPT "\nSelect blocks with attributes to change layer: ")
     (SETQ BS (SSGET '((-4 . "<AND") (0 . "INSERT") (66 . 1) (-4 . "AND>")) ))
     (SETQ BSL (SSLENGTH BS))
     (SETQ CT (- BSL 1))
     (SETQ NOFUV (GETSTRING T "\nNew attribute layer: "))
     (SETQ LP 1)
     (WHILE LP
      (SETQ NE (SSNAME BS CT))
      (SETQ CT2 0)
      (SETQ LP2 1)
      (WHILE LP2
       (SETQ NE (ENTNEXT NE))
       (SETQ NEL (ENTGET NE))
       (SETQ NEAET (CDR (ASSOC 0 NEL)))
       (SETQ NEA (ASSOC 8 NEL))
       (SETQ NEAS (CDR NEA))
       (IF (= NEAET "ATTRIB") 
        (PROGN
         (IF (/= NEA NIL)
          (PROGN
           (SETQ NOFNU (CONS 8 NOFUV))
           (SETQ OFNU NEA)
           (SETQ NNEL (SUBST NOFNU OFNU NEL))
           (ENTMOD NNEL)
           (ENTUPD NE)
         ));END PROGN/IF NEA
       ));END PROGN/IF NEAET
       (IF (= NEAET "SEQEND") (SETQ LP2 NIL))
      );END WHILE LP2
      (SETQ CT (- CT 1))
      (IF (< CT 0) (SETQ LP NIL))
     );END WHILE LP
     (PRINC)
    );END SAL
    Attached Files Attached Files
    Last edited by aaronic_abacus; 2014-07-02 at 02:37 AM.

Similar Threads

  1. Multiview block definitions and Attributes - AutoCAD
    By jasonp in forum AutoCAD Customization
    Replies: 1
    Last Post: 2014-12-15, 11:45 PM
  2. Replies: 11
    Last Post: 2012-12-18, 07:46 PM
  3. Use extracted attribute table to modify block's attributes?
    By Neo_Richard_Blake in forum AutoCAD Tables
    Replies: 3
    Last Post: 2012-02-17, 07:59 PM
  4. Replies: 2
    Last Post: 2011-05-23, 12:03 PM
  5. Replies: 5
    Last Post: 2009-09-16, 01:39 AM

Posting Permissions

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