thanx guys, last question? Once i have successfully loaded the .lisp file how do i get my dims to actualy do what Bruce has mentioned?
Registered forum members do not see this ad.
On Lee's site there are some tutorials on this: http://www.lee-mac.com/tutorials.html#lisptutorials
Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!
thanx guys, last question? Once i have successfully loaded the .lisp file how do i get my dims to actualy do what Bruce has mentioned?
Assuming you used Lee's code, then once it's loaded you should have a new command called MacDim. Just type it into the command-line. It'll ask you to select the dimension(s) and specify the alteration value.
Edit: As a future tip: If there's a piece of code in the LSP file which starts withThen the word following it will be the command. Note it's possible that the word could have other characters in it (like - ), but no spaces. Basically acad looks at the name of the function when it's defined (defun = define function), if the name starts with C: then acad adds it as a custom lisp command, otherwise it's just a normal lisp function which you can also call but need to use lisp-like syntax.Code:(defun C:
Also a LSP file may have many of these custom commands, not just one, so look through the whole code for new commands.
Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!
than x irneb, much appreciated everything works well. Only problem i sthat after i use the macdim command my dimensions are no longer rounded off to 5 as they were before applying the command? Any thoughts on this?
That's because Lee's code overwrites the dim with a new computed string. His code would need some alteration to test these rounding of the dimension so it matches the original dim.
Perhaps this:Edit: Sorry, stupid mistake on my part ... in a rush!Code:(defun c:MacDim (/ ss num) (vl-load-com) (if (and (setq ss (ssget '((0 . "DIMENSION")))) (setq num (getreal "\nSpecify Alteration: "))) (mapcar (function (lambda (x) (vla-put-TextColor x 1) ; <<-- 1 = Red (vla-put-TextOverride x (strcat (vla-get-TextPrefix x) (rtos (round (+ (vla-get-Measurement x) num) (vla-get-RoundDistance x)) (vla-get-UnitsFormat x) (vla-get-PrimaryUnitsPrecision x)) (vla-get-TextSuffix x))))) (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))))) (princ)) (defun round (num fact / mod) (if (< (setq mod (rem num fact)) (/ fact 2)) (- num mod) (+ num (- fact mod))))
Last edited by irneb; 20th Aug 2012 at 11:38 am.
Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!
Registered forum members do not see this ad.
awesome! thanx alot saving me lots of grey hairs.
Bookmarks