CAD2005 Posted December 21, 2024 Posted December 21, 2024 (edited) I want to type 100, then the linetype scale will be 100, so how can this lisp be calibrated? thanks a lot ;Change linetype scale by a factor. (defun c:lrr () (setq en (car (entsel)) ed (entget en) lts (cdr (assoc 48 ed)) ) (if (/= lts nil) (progn (setq ns (getreal (strcat "\nScale linetype what factor of current scale? Current scale: <"(rtos lts)">. ")) ns2 (* (/ ns ) lts) ) (setq ed (subst (cons 48 ns2) (assoc 48 ed) ed ) ) (entmod ed) (entupd en) );progn (progn (setq ns (getreal (strcat "\nScale linetype to what factor of current scale? Current scale: <"(rtos 1)">.")) ns2 (* (/ ns ) 1) ) (command "change" en "" "p" "s" (rtos ns2) "") ) );if ) Back to Top Edited December 22, 2024 by CADTutor Quote
EIA Posted December 23, 2024 Posted December 23, 2024 In case it helps, here is the code I use for changing the linetype scale in multiple lines: (defun c:default ( / sel i obj objType newLT) (setq sel (ssget)) (setq newLT (getreal "\nNew linetype scale")) (setq i 0) (while (< i (sslength sel)) (setq obj (vlax-ename->vla-object(ssname sel i))) (setq objType (vla-get-objectname obj)) (vlax-put-property obj 'LinetypeScale newLT) (setq i (+ i 1)) ) ) Quote
CAD2005 Posted December 28, 2024 Author Posted December 28, 2024 Thank you @EIA ! But is there a way to batch change it? as axis lines in a layer Quote
Tharwat Posted December 28, 2024 Posted December 28, 2024 Select all then go to property palette to change the scale to your desired units. Quote
BIGAL Posted December 29, 2024 Posted December 29, 2024 Maybe a slight modification to the code by EIA. (defun chgltype (nlt / sel obj objtype entg) (setq entG (entget (car (entsel "\nPick a entity for linetype ")))) (setq entglay (cdr (assoc 8 entg))) (setq sel (ssget (list (cons 0 "*line,circle,arc")(cons 8 entglay)))) (setq i 0) (while (< i (sslength sel)) (setq obj (vlax-ename->vla-object(ssname sel i))) (setq objType (vla-get-objectname obj)) (vlax-put-property obj 'LinetypeScale nLT) (setq i (+ i 1)) ) (princ) ) (defun c:100 ( / ) (chgltype 100) ) (defun c:10 ( / ) (chgltype 10) ) 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.