Jump to content

Change linewights on all lines


mel-wlp

Recommended Posts

Need some help please - this is probably quite simple but just not for me .. I found this lisp that works great .. only my client wants all lineweights to be be set as default not 0 - can someone tell me how to change this please

 

https://autocad.fandom.com/wiki/Lineweight_stripper_(AutoLISP_tool)

;;; AutoCAD Wiki AutoLISP code header.  
;;;
;;; Copy this code to a file on your computer. 
;;; Start highlighting OUTSIDE the code boxes and use the mouse or keyboard to
;;; highlight all the code.
;;; If you select too much, simply delete any extra from your destination file.
;;; In Windows you may want to start below the code and use [Shift]+[Ctrl]+[Home] 
;;; key combination to highlight all the way to the top of the article,
;;; then still holding the [Shift] key, use the arrow keys to shrink the top of
;;; the selection down to the beginning of the code.  Then copy and paste.
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; The working version of this software is located at the AutoCAD Wiki.
;;; Please AutoCAD:Be_bold in adding clarifying comments and improvements at
;;; https://autocad.fandom.com/wiki/Lineweight_stripper_(AutoLISP_tool)
;;; C:LWSTRIP
;;; Makes all lineweights 0 in the current drawing
;;;
;;; Copyright holders:
;;; 2008 Hubbard Enterprises, Inc. dba Hubbard Engineering Gilbert, Arizona
(DEFUN
   C:LWSTRIP (/ EG EN ICURRENTOBJECT SSALL)
  (SETQ
    SSALL
     (SSGET "X")
    ICURRENTOBJECT -1
  )
  ;;For every object in the selection set,
  (WHILE (SETQ EN (SSNAME SSALL (SETQ ICURRENTOBJECT (1+ ICURRENTOBJECT))))
    ;;Set the lineweight to 0
    (SETQ EG (ENTGET EN))
    ;;Entmod modifies the entity based on the new list after the substitution.
    (ENTMOD (SUBST (CONS 370 0) (ASSOC 370 EG) EG))
  )
  ;;Set various drawing settings to make sure lineweights don't appear unexpectedly.
  (SETVAR "celweight" -1)
  (SETVAR "dimlwd" -2)
  (SETVAR "dimlwe" -2)
  (SETVAR "lwdefault" 0)
  ;;Exit function silently
  (PRINC)
)
;|«Visual LISP© Format Options»
(72 2 40 2 nil "end of " 60 2 2 2 1 nil nil nil T)
;*** DO NOT add text below the comment! ***|;

 

Edited by SLW210
Added Code Tags!
Link to comment
Share on other sites

Have you tried :

(ENTMOD (SUBST (CONS 370 25) (ASSOC 370 EG) EG))

And :

(SETVAR "lwdefault" 25)

Edited by marko_ribar
Link to comment
Share on other sites

59 minutes ago, marko_ribar said:

Have you tried :

(ENTMOD (SUBST (CONS 370 25) (ASSOC 370 EG) EG))

 

 

If you put (CONS 370 25) the lineweight becomes 25mm, try -3

 

(ENTMOD (SUBST (CONS 370 -3) (ASSOC 370 EG) EG))

 

 

 

 

  • Like 1
Link to comment
Share on other sites

 

2 hours ago, Steven P said:

 

If you put (CONS 370 25) the lineweight becomes 25mm, try -3

 

(ENTMOD (SUBST (CONS 370 -3) (ASSOC 370 EG) EG))

 

 

 

 

-1 isn't it  ?    Defaul    -3     , ByBLock    -2       , ByLayer   -1 

 

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