Jump to content

Recommended Posts

Posted

Hello, 

I need help regarding to change the linetype scale of every line on a certain layer based on its individual length.

Thank you. 

Posted

Something like this. You will need to edit the values.

 

(defun c:ltsc ( / lay ss obj x len)
(setq lay (cdr (assoc 8 (entget (car (entsel "\pick line for layer"))))))
(setq ss (ssget '((0 . "LINE")(cons 8 lay))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq len (vla-get-length obj))
(cond 
((and (> len 0.0001)(<= len 100.0)) (vla-put-LinetypeScale obj 0.9))
((and (> len 100.001)(<= len 200.0)) (vla-put-LinetypeScale obj 1.9))
((and (> len 200.0001)(<= len 300.0)) (vla-put-LinetypeScale obj 2.9))
((and (> len 300.0001)(<= len 400.0)) (vla-put-LinetypeScale obj 3.9))
((and (> len 400.0001)(<= len 500.0)) (vla-put-LinetypeScale obj 4.9))
)
)
(princ)
)

 

  • Like 1
  • 4 weeks later...

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