@Anonymous wrote:
Breaking exactly between 2 points on arcs in degrees. 45 degree, exemple. From 90 to 135. How to? ....
To do that particular one, here is one way that requires the User only to select the Arc:
(defun C:BA90135 (/ arc ctr); = Break Arc from 90 to 135 degrees
(setq
arc (car (entsel "\nSelect Arc to break from 90 to 135 degrees: "))
ctr (cdr (assoc 10 (entget arc)))
); setq
(command "_.break" arc
"_none" (polar ctr (/ pi 2) 1)
"_none" (polar ctr (* pi 0.75) 1)
); command
); defun
But of course you wouldn't always want that combination of directions. If the 45-degree multiples are among your Polar angle settings, you can do this:
(defun C:BAPD (/ orth asnap arc ctr); = Break Arc at Polar Directions
(setq orth (getvar 'orthomode) asnap (getvar 'autosnap)); save Ortho/Polar conditions
(setvar 'autosnap (+ (boole 2 (getvar 'autosnap) 8) 8)); turn on Polar
(setq
arc (car (entsel "\nSelect Arc to break between Polar-angle directions: "))
ctr (cdr (assoc 10 (entget arc)))
); setq
(command "_.break" arc
; User specify directions: pick in Polar mode or type in current angle format:
"_none" (polar ctr (getangle ctr) 1)
"_none" (polar ctr (getangle ctr) 1)
); command
(setvar 'autosnap asnap); reset Polar/Ortho conditions
(setvar 'orthomode orth)
); defun
That could also be made to change the Polar angle choices for you, if you want, for instance to lock it in to only the 45-degree multiples even if your current settings include others.
And BAPD will accept typed-in angles other than those in the Polar angle settings -- it could be made to reject those, if you want.
Neither of those has error handling yet, or a check on whether you actually picked an Arc [they would also work on a Circle, though in some cases BAPD would break out the wrong part of it], etc., but see what you think -- those enhancements can be added easily enough.
Kent Cooper, AIA