Search the Community
Showing results for tags 'locked attribute'.
Can a lisp programmer review my code to find out what's not working? This code will restore an attribute's grip when used with BricsCAD, Draftsight Professional, ZWCAD 2014, 2015, 2017.... But doesn't work in AutoCAD which is what I use most of the time. The grip apparently is controlled by LOCKED option when creating the attribute tag. ; ULMA - Work properly in ZWCAD, Draftsight, and BricsCAD...but not AutoCAD ; UnLockMyAttribute ; Steve Remenda ; July 30/2014 ; July 5/2016 Tried again to get grips turned back on. no success. ; DXF code 280 lock position flag within the block reference should be 0 (defun c:ulma ( / cmd enam edat1) (setq cmd (getvar "cmdecho")) (setvar "cmdecho" 1) (setq enam (car (nentsel "\nSelect Select attribute turn on grip: "))) (setq myinsert (cdr (assoc 330 (entget enam)))) ;get the block (setq my280 (cdr (assoc 280 (entget enam)))) ;get current 280 cons value (if (= my280 0) ;if the attribute is locked (progn (setq myval 1); 1 to show grip (setq edat1 (subst (cons 280 myval); ; Change the DXF code pair (assoc 280 (entget enam)) (entget enam) );subst );setq - this does display the list and cons 280 does show a 1 (entmod edat1) ; but this returns nil. Should it? (entupd enam) ; this should update the attribute (entupd myinsert) ; this should update the block ); progn then when lock is visible (progn ; Else attribute is something else (initget 1 "Yes No") (setq x (getkword "\nThis attribute grip is already on. Do you want to turn it off? (Yes or No) ")) (if (= x "Yes") ; if user wants to apply italics (progn (setq myval 0); 0 For No grip (setq edat1 (subst (cons 280 myval) ; Change the DXF code pair (assoc 280 (entget enam)) (entget enam) ); subst ); setq (entmod edat1) (entupd enam) ); progn to make attribute visible ); if Yes response );progn Else attribute is something else ); if an attribute is selected. (command "REGEN") (setvar "cmdecho" cmd) (princ) ) ;ulma - UnLock My Attribute
Hey gang! Quick question (hopefully).... Would there be any reason why several block references with (Locked and Constant) attributes do not get added to a Selection Set created using the .Select acSelectionSetWindow method? It's picking up all of the other items including block references, text, and even a block reference with an attribute that is not locked nor constant. The problem blocks are right in the middle of the window surrounded by everything else that is getting added. I am not attempting to use a filter. I am using AutoCAD 2012.