woodman78 Posted July 8, 2011 Share Posted July 8, 2011 I have a lisp to alter mapping that we use in the background of our drawings. It is quite slow and was wondering if anyone can offer any suggestions on how to improve. Part of it explodes the block map tiles in order to set everything to bylayer. Can this be done without exploding which slows things down alot? (defun c:osmap1 (/ pref ss) (vl-load-com) (setq pref "CCC_OSMAP_") ;; <<-- Prefix (vlax-for lay (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object))) (if (/= "0" (vla-get-Name lay)) (vla-put-name Lay (strcat pref (vla-get-Name lay))))) (command "_-layer" "c" "253" "*" "") (and (setq ss (ssget "X" (list (cons 0 "INSERT"))))) (command "explode" SS "") (command "_change" "all" "" "p" "color" "Bylayer" "") (command "_-layer" "F" "CCC_OSMAP_BDY_SYM" "F" "CCC_OSMAP_HT_CTRL" "F" "CCC_OSMAP_ROADS_CTR" "F" "CCC_OSMAP_ROADS" "F" "CCC_OSMAP_POLE_SYMB" "F" "CCC_OSMAP_LEGEND" "") (command "_-purge" "a" "*" "N") (command "regenall") (princ)) Thanks. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 8, 2011 Share Posted July 8, 2011 This would set all your Blocks entity's layers to ByLayer without exploding them . And regen all after that. (vlax-for x (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) (vlax-for blks x (if (not (eq (vla-get-color blks) acByLayer)) (vla-put-color blks acByLayer) ) ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
woodman78 Posted July 8, 2011 Author Share Posted July 8, 2011 Thanks for that Tharwat. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 8, 2011 Share Posted July 8, 2011 Thanks for that Tharwat. You're welcome . Tharwat Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 8, 2011 Share Posted July 8, 2011 Don't forget about the built in setbylayer command. Not the best option for automation, but it's a very useful command to know. :wink: 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.