Jump to content

Recommended Posts

Posted

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

Posted
On 3/28/2021 at 5:02 AM, BIGAL said:

maybe

image.thumb.png.bfa7b45cf52c9b13d861eecfc24be149.png

 

try this method but it was not done my current object by layer

Posted (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 by BIGAL
Posted

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.

Posted (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 by ronjonp
Posted
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

image.png.d06d13d95142d52a45823e5c1800fad8.png

 

 

 

Posted

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)
)

 

  • Like 1
Posted
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

Posted
4 hours ago, pmadhwal7 said:

great sir thanks a lot

Glad to help 🍻

Posted
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?

Posted

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. 

Posted
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

Posted (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 by BIGAL
Posted
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.

  • Like 1
Posted

Layout title blocks (or xrefs) with attributes would have make this a quick fix and reduced drawing size.

  • Like 1
Posted

i will try your suggestions thanks all you guys really helpful

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...