Michaels Posted July 20, 2010 Posted July 20, 2010 Hi is it possible to change all Layer's LWeights in a drawing to a specific LWeight ? Thanks Michaels Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 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) ) Quote
alanjt Posted July 20, 2010 Posted July 20, 2010 Seriously? A new thread? 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. Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 Seriously? A new thread? Ditto :wink: Nice work Lee. Many thanks Alan Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 Thank you LEE. Your examples and routines are great as usual. I thank you for your complete help. Best Regards Michaels Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 Seriously? A new thread? 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. Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 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. Quote
alanjt Posted July 20, 2010 Posted July 20, 2010 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. I suppose everyone likes two threads for one question. OK FYI = For Your Information 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]: Quote
alanjt Posted July 20, 2010 Posted July 20, 2010 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. Quote
Recommended Posts
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.