AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

*Nate Holt
Message 1 of 1 (75 Views)

Flipping IEC4 symbol library attibs to "Visible"

75 Views, 0 Replies
07-22-2004 08:42 AM
The INST and LOC attribute definitions on the new IEC4 library were left marked "invisible" on purpose. This is because it was anticipated some users might want to use the new "combined inst/loc prefix tagging mode" that appears in AcadE 2005. For those users, the IEC4 lib would be the better choice because the INST and LOC attribute values would be hidden (because they're already included in the TAG1/TAG2 values). But, it's easy to flip the whole IEC4 library to have the INST and LOC attributes marked "visible". Use the utility shown below: 1. Paste utility below into a file with a ".lsp" extension (ex: flip2visible.lsp). APPLOAD it one time 2. Select the "Components" pulldown menu --> "Symbol Library" --> "Modify Symbol Library" utility. 3. Browse to and select the c:\program files\autodesk\acade 2005\IEC4 folder and then, on the subdialog edit box marked "Run AutoLisp", enter in this expression: (c:flip2visible) 4. Hit Start That should do it. (defun c:flip2visible ( / ss en ix slen newed ed atnam atrec70 name_list ) ; Symbol library tool - Flip attdefs INST and LOC to "visible" ; Call this from the Symbol Library Modification Wizard by 1) APPLOADING ; this routine one time and then 2) entering this into the edit box ; for the AutoLisp function: ; (c:flip2visible) ; Enter list of attribute names that are to be processed (setq name_list (list "LOC" "INST")) ; Begin processing. Get all ATTDEFS in the drawing. (setq ss (ssget "_X" '((0 . "ATTDEF")))) (if (/= ss nil) (progn (setq slen (sslength ss)) (setq ix 0) (while (< ix slen) ; cycle through each ATTDEF (setq en (ssname ss ix)) ; get entity name (setq ed (entget en)) ; open the entity (setq atnam (cdr (assoc 2 ed))) ; get ATTDEF name (setq atrec70 (cdr (assoc 70 ed))) ; get the visible/invisible flag value (if (member atnam name_list) (progn ; hit an ATTDEF that is listed to check ; Check if the "invisible" flag bit is set (1's bit) (if (= (logand atrec70 1) 1) (progn ; yes, invisible bit is set. Clear it. (setq atrec70 (1- atrec70)) ; Write new value back to entity (setq newed (subst (cons 70 atrec70) (assoc 70 ed) ed)) (entmod newed) (entupd en) (princ "\n ******** ") (princ atnam) (princ " flipped to visible") ) ) ) ) (setq ix (1+ ix)) ) (setq ss nil) ; release selection set ) ) (princ) )
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.