chelsea1307 Posted April 22, 2010 Share Posted April 22, 2010 I have this lisp by kpblc and it takes everything in a block and changes its properties to by layer. Works great, except for attributes then you have to go back and attsync each block individually, is there a way with lisp to attsync all blocks within a dwg at once, and either add it to the lisp below or just a seperate lisp that does this or a command im totally missing. The other problem is Mtext, if mtext color is selected within the mtext editor dialog box is there a way to change it back to by layer without going into each mtext individually, also would be great added into this lisp but a seperate lisp you have that does the same thing would work too. I know a little about lisp so i can add to mine so it calls other lisps at the end to bring these in. Author kpblc changes all blocks inserted in a dwg from by block/color to by layer. (defun c:norm (/ *error* adoc lst_layer func_restore-layers) (defun *error* (msg) (func_restore-layers) (vla-endundomark adoc) (princ msg) (princ) ) ;_ end of defun (defun func_restore-layers () (foreach item lst_layer (vla-put-lock (car item) (cdr (assoc "lock" (cdr item)))) (vl-catch-all-apply '(lambda () (vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item)))) ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of foreach ) ;_ end of defun (vl-load-com) (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))) ) ;_ end of vla-startundomark (vlax-for item (vla-get-layers adoc) (setq lst_layer (cons (list item (cons "lock" (vla-get-lock item)) (cons "freeze" (vla-get-freeze item)) ) ;_ end of list lst_layer ) ;_ end of cons ) ;_ end of setq (vla-put-lock item :vlax-false) (vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false))) ) ;_ end of vlax-for (vlax-for blk (vla-get-blocks adoc) (if (and (equal (vla-get-islayout blk) :vlax-false) (equal (vla-get-isxref blk) :vlax-false) ) ;_ end of and (progn (vlax-for subent blk ;(vla-put-layer subent "0");edit-> removed force to layer 0 (vla-put-color subent 256) (vla-put-lineweight subent aclnwtbyblock) (vla-put-linetype subent "byblock") ) ;_ end of vlax-for ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for (func_restore-layers) (vla-endundomark adoc) (command "_regenall") (princ) ) ;_ end of defun Quote Link to comment Share on other sites More sharing options...
chelsea1307 Posted April 22, 2010 Author Share Posted April 22, 2010 battman and the sync button work a little fast then attsync each individual block but still looking for some way to do it all at once Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 23, 2010 Share Posted April 23, 2010 Attsync > N > * Quote Link to comment Share on other sites More sharing options...
chelsea1307 Posted April 23, 2010 Author Share Posted April 23, 2010 so simple, thanks lee mac. Any ideas on the mtext problem? Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 23, 2010 Share Posted April 23, 2010 so simple, thanks lee mac. Any ideas on the mtext problem? Give this a look. Quote Link to comment Share on other sites More sharing options...
chelsea1307 Posted April 23, 2010 Author Share Posted April 23, 2010 thanks alan that works like a charm Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 23, 2010 Share Posted April 23, 2010 thanks alan that works like a charm Joe and Steve did a great job with it. 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.