ILoveMadoka Posted February 9, 2011 Posted February 9, 2011 I thought I remember someone once writing a lisp routing to allow you to dynamically change your LTSCALE until the linetype dashes appear? All I could find was this: http://www.cadtutor.net/forum/showthread.php?42389-LTSCALE-Auto-shrink-until-pattern-appears&highlight=ltscale Specifically when I have little line fragments that are too short to display at the current LTSCALE I'd like to removed the guess, enter, guess again, enter, guess again to doing this if it is at all possible? :wink: Please advise... THX! Quote
alanjt Posted February 9, 2011 Posted February 9, 2011 (defun c:LTS (/ _draw ss gr) ;; Dynamically change LTScale of selected object(s) ;; Requried subroutines: AT:SS->List ;; Alan J. Thompson, 07.06.10 (defun _draw (p1 p2) (redraw) (grdraw p1 p2 3 1) (/ (distance p1 p2) 100.)) (if (setq ss (AT:SS->List (ssget "_:L" '((0 . "ARC,ELLIPSE,CIRCLE,*LINE"))) T)) (while (and (eq 5 (car (setq gr (grread T 15 1)))) (vl-consp (cadr gr))) (foreach x ss (vl-catch-all-apply (function vla-put-linetypescale) (list x (_draw (trans (vlax-curve-getClosestPointTo (car (vl-sort ss (function (lambda (a b / pt) (< (distance (vlax-curve-getClosestPointTo a (setq pt (trans (cadr gr) 1 0))) pt ) (distance (vlax-curve-getClosestPointTo b pt) pt) ) ) ) ) ) (trans (cadr gr) 1 0) ) 0 1 ) (cadr gr) ) ) ) ) ) ) (redraw) (princ) ) (defun AT:SS->List (SS VLA) ;; Convert selection set to list of ename or vla objects ;; SS - SSGET selection set ;; VLA - T for vla objects, nil for ename ;; Alan J. Thompson, 04.01.10 (if (eq 'PICKSET (type SS)) ((lambda (i / e l) (while (setq e (ssname SS (setq i (1+ i)))) (cond (VLA (setq l (cons (vlax-ename->vla-object e) l))) ((setq l (cons e l))) ) ) ) -1 ) ) ) Quote
ILoveMadoka Posted February 9, 2011 Author Posted February 9, 2011 Thank you! This is awesome!! I did have to modify one little thing for my particular instance.. (/ (distance p1 p2) 100.)) to (/ (distance p1 p2) 0.25)) Thank you SO MUCH!!!! VERY Appreciated! Quote
alanjt Posted February 9, 2011 Posted February 9, 2011 Thank you!This is awesome!! I did have to modify one little thing for my particular instance.. (/ (distance p1 p2) 100.)) to (/ (distance p1 p2) 0.25)) Thank you SO MUCH!!!! VERY Appreciated! Right on. Yeah, I wrote this when we were working with some client provided lintypes and the LTScales were retarded (as you can see). 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.