mjavy7 Posted December 13, 2023 Posted December 13, 2023 I have a survey with the topographic elevations (not annotative) called out with leaders. I would like to scale all those leaders by "x" all at the same time and all from the tip of the leaders (individually). Is there a Lisp routine that I can use to do this? I am currently selecting each individual one and applying the scale command. This is very time consuming and tedious, any help will be greatly appreciated. 23-1906ATOPOSTRIP.dwg 1 Quote
BIGAL Posted December 13, 2023 Posted December 13, 2023 How much do you know about lisp ? You can select "Leader" (defun c:wow ( / ss le x pt oldsnap leent co-ord) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq sc (getreal "\nEnter scale value ")) (setq ss (ssget '((0 . "*LEADER")))) (repeat (setq x (sslength ss)) (setq le (ssname ss (setq x (1- x)))) (setq leent (entget le)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) leent))) (setq pt (caddr co-ord)) (command "scale" le "" pt sc) ) (setvar 'osmode oldsnap) (princ) ) Quote
mjavy7 Posted December 14, 2023 Author Posted December 14, 2023 3 hours ago, BIGAL said: How much do you know about lisp ? You can select "Leader" (defun c:wow ( / ss le x pt oldsnap leent co-ord) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq sc (getreal "\nEnter scale value ")) (setq ss (ssget '((0 . "*LEADER")))) (repeat (setq x (sslength ss)) (setq le (ssname ss (setq x (1- x)))) (setq leent (entget le)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) leent))) (setq pt (caddr co-ord)) (command "scale" le "" pt sc) ) (setvar 'osmode oldsnap) (princ) ) I do not know how to create what you just created but I do know how to save it, load it and use it. Thank you!! With that said, when I do use it in the original file it work flawlessly. I then scaled the drawing to be 1:1 and now the leaders move to a different location after using your lisp. Another thing that happens is that all my osnap settings get cleared. Quote
BIGAL Posted December 14, 2023 Posted December 14, 2023 If its crashing out then it is not running the last line (setvar 'osmode oldsnap) which resets the osnaps back to what they were. I stay away from annotative so dont get these problems. Post the dwg again with the annotation scale reset, also I am metric scales much easier. Quote
mjavy7 Posted December 23, 2023 Author Posted December 23, 2023 On 12/14/2023 at 12:16 AM, BIGAL said: If its crashing out then it is not running the last line (setvar 'osmode oldsnap) which resets the osnaps back to what they were. I stay away from annotative so dont get these problems. Post the dwg again with the annotation scale reset, also I am metric scales much easier. Here is the file again. Thanks for the help so far. 23-1906ATOPOSTRIP.dwg Quote
BIGAL Posted December 23, 2023 Posted December 23, 2023 Works for me in your dwg ? I am not sure why not working for you. Quote
mjavy7 Posted December 26, 2023 Author Posted December 26, 2023 On 12/23/2023 at 6:22 PM, BIGAL said: Works for me in your dwg ? I am not sure why not working for you. Sorry this is the file that gave me issues.202307400_2730 LEWIS RD DOVER_site plan_V2.dwg Quote
BIGAL Posted December 26, 2023 Posted December 26, 2023 The leader has a base point some 2900 in X direction similar Y that is why its not working I dont think its got anything to do with annotative. Some where inside the leader properties is an answer, also noticed the leader line is made up of 2 objects. The leaders have been created in some other way. Sorry can not help any more. Some one else may have an idea. Quote
Nikon Posted March 20 Posted March 20 On 12/14/2023 at 8:16 AM, BIGAL said: If its crashing out then it is not running the last line (setvar 'osmode oldsnap) which resets the osnaps back to what they were. (setvar "osmode" oldsnap) It works... Quote
Nikon Posted March 20 Posted March 20 On 12/14/2023 at 1:10 AM, BIGAL said: (defun c:wow ( / ss le x pt oldsnap leent co-ord) If you change the code a little bit: ;; changes the scale of all LEADERS that are included in the selection frame ;; MLEADERS keep the starting point ;; osmode returns the initial value (defun c:wow1 ( / ss le x pt oldsnap leent co-ord) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq sc (getreal "\nEnter scale value ")) (setq ss (ssget '((0 . "*LEADER")))) (repeat (setq x (sslength ss)) (setq le (ssname ss (setq x (1- x)))) (setq leent (entget le)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) leent))) (setq pt (caddr co-ord)) (command "scale" le "" pt sc) ) (setvar "osmode" oldsnap) ;; replacing this string (setvar 'osmode oldsnap) (princ) ) ;; changes the scale of all LEADERS in the drawing without selection ;; MLEADERS keep the starting point ;; osmode returns the initial value (defun c:wow2 ( / ss le x pt oldsnap leent co-ord) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq sc (getreal "\nEnter scale value ")) (setq ss (ssget "_X" '((0 . "*LEADER")))) ;; replacing this string(setq ss (ssget '((0 . "*LEADER")))) (repeat (setq x (sslength ss)) (setq le (ssname ss (setq x (1- x)))) (setq leent (entget le)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) leent))) (setq pt (caddr co-ord)) (command "scale" le "" pt sc) ) setvar "osmode" oldsnap) ;; replacing this string (setvar 'osmode oldsnap) (princ) ) 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.