Zorg Posted August 13, 2009 Share Posted August 13, 2009 (command "-scalelistedit" "reset" "y" "e") ( / slist rlist drac csobj entlst entnm) (vl-load-com) (setvar "cmdecho" 0) (setq slist '("1:1" "1:20" "1:50" "1:100")) (setq csobj (vlax-ename->vla-object (cdar (dictsearch (namedobjdict) "ACAD_SCALELIST"))) drac 0) (repeat (vla-get-count csobj) (if (not (member (cdr (assoc 300 (entget (setq entnm (vlax-vla-object->ename (vlax-invoke-method csobj 'item drac)))))) slist)) (setq entlst (append (list entnm) entlst))) (setq drac (1+ drac))) (mapcar 'entdel entlst) (setvar "cmdecho" 1) (princ) cant work out why it wont load :/ can someone help? might just be a very easy one :wink: thanks in advance Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted August 13, 2009 Share Posted August 13, 2009 Purhaps some thing like this? Only simple, localised varibles moved & defun added (defun c:tt ( / slist rlist drac csobj entlst entnm) (vl-load-com) (setvar "cmdecho" 0) (command "-scalelistedit" "reset" "y" "e") (setq slist '("1:1" "1:20" "1:50" "1:100")) (setq csobj (vlax-ename->vla-object (cdar (dictsearch (namedobjdict) "ACAD_SCALELIST"))) drac 0) (repeat (vla-get-count csobj) (if (not (member (cdr (assoc 300 (entget (setq entnm (vlax-vla-object->ename (vlax-invoke-method csobj 'item drac)))))) slist)) (setq entlst (append (list entnm) entlst))) (setq drac (1+ drac))) (mapcar 'entdel entlst) (setvar "cmdecho" 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
Zorg Posted August 13, 2009 Author Share Posted August 13, 2009 I removed the defun orignally to have to excute on boot-up. Will the script need to be changed much for that? Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted August 13, 2009 Share Posted August 13, 2009 Nah not at all However i would keep it a defun & just add in Initializing for it,i find easyer to keep track of things later on. If not, just remove the first line & end line (defun ScaleListCreater ( / slist rlist drac csobj entlst entnm) (vl-load-com) (setvar "cmdecho" 0) (command "-scalelistedit" "reset" "y" "e") (setq slist '("1:1" "1:20" "1:50" "1:100")) (setq csobj (vlax-ename->vla-object (cdar (dictsearch (namedobjdict) "ACAD_SCALELIST"))) drac 0) (repeat (vla-get-count csobj) (if (not (member (cdr (assoc 300 (entget (setq entnm (vlax-vla-object->ename (vlax-invoke-method csobj 'item drac)))))) slist)) (setq entlst (append (list entnm) entlst))) (setq drac (1+ drac))) (mapcar 'entdel entlst) (setvar "cmdecho" 1) (princ) ) (ScaleListCreater) Quote Link to comment Share on other sites More sharing options...
Zorg Posted August 13, 2009 Author Share Posted August 13, 2009 Cheers dude! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.