Jump to content

CHANGE ALL LAYERS TO DEFAULT LINEWEIGHT AUTOCAD LISP


Efeezy

Recommended Posts

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

Link to comment
Share on other sites

  • Efeezy changed the title to CHANGE ALL LAYERS TO DEFAULT LINEWEIGHT AUTOCAD LISP

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

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

Link to comment
Share on other sites

(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
  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
On 6/28/2019 at 7:23 PM, Lee Mac said:

(command "_.-layer" "_lw" "default" "*" "")

 

You saved me hours in updating 5 drawings.  Worked like a charm. Thanks a million.  Stay safe! Barry from Cape Town, South Africa

Link to comment
Share on other sites

On 7/18/2019 at 2:26 AM, SLW210 said:

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

 

I didn't realize that but I was able to find posts online from 2009 about the LAYTRANS command so I'm assuming it came out 2008 or so - possibly earlier.

 

There was a new features tutorial video I watched that was pre-release for like Autocad 2020 or something and it was talking about LAYTRANS having additional features.  But for some reason it mentioned 2019 and newer.  I dunno it was like a year and a half ago lol.

 

-ChriS

Link to comment
Share on other sites

It's been a while, but it may have been in Express Tools even before then. In AutoCAD 2008, they moved the Layer Tools from Express Tools into Core AutoCAD. Not sure where I got AutoCAD 2016 from.

Link to comment
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
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...