Jump to content
Efeezy

CHANGE ALL LAYERS TO DEFAULT LINEWEIGHT AUTOCAD LISP

Recommended Posts

Efeezy

Good Morning Everyone:

 

Does anyone have a Lisp that will change all the layer in the drawing to Default lineweight? 

 

Thank you for your time,

 

Efeezy

Share this post


Link to post
Share on other sites
Lee Mac
(command "_.-layer" "_lw" "default" "*" "")

 

Share this post


Link to post
Share on other sites
Lee Mac
(vlax-for l (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (vla-put-lineweight l aclnwtbylwdefault))

 

Share this post


Link to post
Share on other sites
Efeezy

Thank you Lee Mac

 

It work if I cut and paste (command "_.-layer" "_lw" "default" "*" "")

at the command line but I am not good an writing or modifying lisp. How to do I make the command work?

 


--------------------------------------------------------------------
; CHANGE ALL LAYERS TO DEFAULT LINEWEIGHT AUTOCAD LISP

(defun c:111()
(command "_.-layer" "_lw" "default" "*" "")

--------------------------------------------------------------------

Share this post


Link to post
Share on other sites
Lee Mac
Posted (edited)
(defun c:YourCommand () 
    (command "_.-layer" "_lw" "default" "*" "") 
    (princ)
)
(defun c:YourCommand ()
    (vlax-for l (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (vla-put-lineweight l aclnwtbylwdefault))
    (princ)
)

I'm sure you could have worked this out ;)

Edited by Lee Mac

Share this post


Link to post
Share on other sites
Efeezy

Thank you looks like i missed on space after the command. It was driving me nuts!!! Thank you so much have a great weekend!!! :)

Share this post


Link to post
Share on other sites
ammobake

the new LAYTRANS command would also work (kind of) but only a thing in 2019 or higher.

 

ChriS

Share this post


Link to post
Share on other sites
SLW210

LAYTRANS has been around a while. AutoCAD 2016 and newer.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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