Jump to content

Recommended Posts

Posted (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 by CADTutor
  • CADTutor changed the title to Change linetype scale
Posted

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

 

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