pmadhwal7 Posted March 27, 2021 Share Posted March 27, 2021 Dear all, i have done one mistake during creating layout that i was forget to make some object by layer and when i realized it was copy in nearly 100 layouts, i wnt to know that is their any way to do those object by layer at once? Drawing3.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 27, 2021 Share Posted March 27, 2021 maybe Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted March 30, 2021 Author Share Posted March 30, 2021 On 3/28/2021 at 5:02 AM, BIGAL said: maybe try this method but it was not done my current object by layer Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 30, 2021 Share Posted March 30, 2021 (edited) I think I misread your request, so select all in pspace in a layout, then chprop to Bylayer ? Is that what you want just step through all layouts and change. Are you meaning the Byblock plines to be Bylayer ? Post an image etc showing what is to be changed. Maybe this. (defun layoutbylay ( / lay x obj ) (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (/= (vla-get-name lay) "Model") (progn (setvar 'ctab (vla-get-name lay)) (setvar 'tilemode 1) (setq ssall (ssget "x")) (setq x 0) (repeat (sslength ssall) (setq obj (vlax-ename->vla-object (ssname ssall x))) (vlax-put-property obj "Linetype" "Bylayer") (vlax-put-property obj "Color" acbylayer) (vlax-release-object obj) (setq x (+ x 1)) ) ) ) ) (princ) ) (layoutbylay) Edited March 30, 2021 by BIGAL Quote Link to comment Share on other sites More sharing options...
tombu Posted March 30, 2021 Share Posted March 30, 2021 As that initial object would now be a different object in each layout you would need a lisp that prompts to select one of them to get it's entity properties (less entity name) and modify every object with the same properties in Paper Space in the drawing. Quote Link to comment Share on other sites More sharing options...
tombu Posted March 30, 2021 Share Posted March 30, 2021 BlackBox's posts are a good start Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 30, 2021 Share Posted March 30, 2021 (edited) On 3/27/2021 at 7:11 AM, pmadhwal7 said: Dear all, i have done one mistake during creating layout that i was forget to make some object by layer and when i realized it was copy in nearly 100 layouts, i wnt to know that is their any way to do those object by layer at once? Drawing3.dwg 252.17 kB · 7 downloads Question; Have you thought about using a viewport ( or creating a block \ xref ) to show the keymap linework? Copying this information to 100+ tabs does not make a whole lot of organizational sense. Here's a quick example to change all color byblock items to bylayer: (defun c:foo (/ s) ;; RJP » 2021-03-30 ;; Change all color byblock objects to bylayer (if (setq s (ssget "_x" '((62 . 0)))) (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((62 . 256))))) ) (princ) ) Edited March 30, 2021 by ronjonp Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted March 31, 2021 Author Share Posted March 31, 2021 On 3/30/2021 at 11:39 AM, BIGAL said: I think I misread your request, so select all in pspace in a layout, then chprop to Bylayer ? Is that what you want just step through all layouts and change. Are you meaning the Byblock plines to be Bylayer ? Post an image etc showing what is to be changed. Maybe this. (defun layoutbylay ( / lay x obj ) (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (/= (vla-get-name lay) "Model") (progn (setvar 'ctab (vla-get-name lay)) (setvar 'tilemode 1) (setq ssall (ssget "x")) (setq x 0) (repeat (sslength ssall) (setq obj (vlax-ename->vla-object (ssname ssall x))) (vlax-put-property obj "Linetype" "Bylayer") (vlax-put-property obj "Color" acbylayer) (vlax-release-object obj) (setq x (+ x 1)) ) ) ) ) (princ) ) (layoutbylay) work fine but it was also change my hath color too is it possible to change particular object??? by clicking them Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 31, 2021 Share Posted March 31, 2021 No need to cycle through tabs to change object properties .. this one will exclude hatch. (defun c:foo (/ s) ;; RJP » 2021-03-31 ;; Change all color byblock objects to bylayer (if (setq s (ssget "_x" '((0 . "~HATCH") (62 . 0)))) (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((62 . 256))))) ) (princ) ) 1 Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted April 1, 2021 Author Share Posted April 1, 2021 17 hours ago, ronjonp said: No need to cycle through tabs to change object properties .. this one will exclude hatch. (defun c:foo (/ s) ;; RJP » 2021-03-31 ;; Change all color byblock objects to bylayer (if (setq s (ssget "_x" '((0 . "~HATCH") (62 . 0)))) (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((62 . 256))))) ) (princ) ) great sir thanks a lot Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 1, 2021 Share Posted April 1, 2021 4 hours ago, pmadhwal7 said: great sir thanks a lot Glad to help Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted April 2, 2021 Author Share Posted April 2, 2021 23 hours ago, ronjonp said: Glad to help one more question is it possible to change an object layer by selecting it in all layout sheets? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 2, 2021 Share Posted April 2, 2021 If its in same location in every layout then its doable by picking one and get a pt to use in the other layouts with (ssget pt) but you may have to possibly open every layout. Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted April 3, 2021 Author Share Posted April 3, 2021 14 hours ago, BIGAL said: If its in same location in every layout then its doable by picking one and get a pt to use in the other layouts with (ssget pt) but you may have to possibly open every layout. location is same but layout is different some time object is also same Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 3, 2021 Share Posted April 3, 2021 (edited) Take the layoutbylay and use that code as a start, you just need to remove the repeat and replace with the (ssget pt) you should have selected the object at the start of the code, again this should work not tested (setq pt (cadr (entsel "\nPick object "))) Have a go only way to learn. Edited April 3, 2021 by BIGAL Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 5, 2021 Share Posted April 5, 2021 On 4/3/2021 at 5:49 AM, pmadhwal7 said: location is same but layout is different some time object is also same Have you thought about organizing your drawings differently? IMO, some of these problems could be avoided. 1 Quote Link to comment Share on other sites More sharing options...
tombu Posted April 5, 2021 Share Posted April 5, 2021 Layout title blocks (or xrefs) with attributes would have make this a quick fix and reduced drawing size. 1 Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted April 6, 2021 Author Share Posted April 6, 2021 i will try your suggestions thanks all you guys really helpful 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.