Jump to content

How to change all Layers LWeights in one shout ?


Recommended Posts

Posted

Hi

is it possible to change all Layer's LWeights in a drawing to a specific LWeight ?

 

Thanks

 

Michaels

Posted

Example without using VL:

 

(defun LayerLnwt ( layer lnwt / def el )
 ;; © Lee Mac 2010

 (setq lnwt
   (cond
     (
       (cdr
         (assoc lnwt
           '(("BYLAYER" . -1) ("BYBLOCK" . -2) ("DEFAULT" . -3))
         )
       )
     )
     ( (fix (* 100 lnwt)) )
   )
 )
      
 (if (setq def (tblobjname "LAYER" layer))
   (entupd
     (cdr
       (assoc -1
         (entmod
           (if (assoc 370 (setq el (entget def)))
             (subst
               (cons 370 lnwt) (assoc 370 el) el
             )
             (append el (list (cons 370 lnwt)))
           )
         )
       )
     )
   )
 )

 (princ)
)


(defun c:test ( / l def )

 (mapcar '(lambda ( x ) (LayerLnWt x 0.18))
   (progn
     (while (setq def (tblnext "LAYER" (not def)))
       (setq l (cons (cdr (assoc 2 def)) l))
     )
     l
   )
 )

 (princ)
)

Posted

Seriously? A new thread? :roll:

 

Lee has posted a nice example sans VL, but I'd say that's a pretty big issue if you want to do any programming.

FYI, you can edit the lineweights for all layers from -LAYER quite easily.

 

 

Nice work Lee. :)

Posted
Seriously? A new thread? :roll:

 

Ditto :wink:

 

Nice work Lee. :)

 

Many thanks Alan :)

Posted

Thank you LEE.

Your examples and routines are great as usual.

I thank you for your complete help.

 

Best Regards

 

Michaels

Posted

This tiny code box is going to drive me nuts!

Posted
Seriously? A new thread? :roll:

Lee has posted a nice example sans VL, but I'd say that's a pretty big issue if you want to do any programming.

FYI, you can edit the lineweights for all layers from -LAYER quite easily.Nice work Lee. :)

First, Yes it is a new thread.certainly.

second, all issues that are being written by Lee would be pretty big issues, that's for sure.

third, I do not know what is the meaning of FYI , Can you please explain it for me, of course if you do not mind ?

fourth, How can I edit the lineweights from the -LAYER since that it is supported to enter a single Layer Name only?

Would you have time to answer please.

Posted
This tiny code box is going to drive me nuts!

 

Definitely - its really difficult to see what the code is doing without copying the whole shabang over to VLIDE or other.

Posted
First, Yes it is a new thread.certainly.

second, all issues that are being written by Lee would be pretty big issues, that's for sure.

third, I do not know what is the meaning of FYI , Can you please explain it for me, of course if you do not mind ?

fourth, How can I edit the lineweights from the -LAYER since that it is supported to enter a single Layer Name only?

Would you have time to answer please.

 

 

  1. I suppose everyone likes two threads for one question.
  2. OK
  3. FYI = For Your Information
  4. Just use a "*" to encompass all layers. The portion to enter layer name(s) uses the same principals as WCMatch in LISP.
    eg.
    Current layer:  "0-NOTE"
    Enter an option 
    [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck
    /Unlock/stAte/Description/rEconcile]: lw
    
    Enter lineweight (0.0mm - 2.11mm): 0
    
    Enter name list of layers(s) for lineweight 0.00mm <0-NOTE>: *
    Enter an option 
    [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck
    /Unlock/stAte/Description/rEconcile]:


Posted
Definitely - its really difficult to see what the code is doing without copying the whole shabang over to VLIDE or other.
I know. I have no interest in pasting code into Notepad or opening VLIDE just to view a little code.

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