Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/21/2023 in all areas

  1. Here's another - (defun c:brace ( / ang blg di1 di2 mat rad pt1 pt2 ) (setq rad 1.0) ;; Brace radius (if (and (setq pt1 (getpoint "\nSpecify 1st point for brace: ")) (progn (while (and (setq pt2 (getpoint "\nSpecify 2nd point for brace: " pt1)) (< (distance pt1 pt2) (* 4 rad)) ) (princ "\nDistance between the two points must be greater than 4 times the radius.") ) pt2 ) ) (progn (setq di1 (distance pt1 pt2) di2 (- (/ di1 2.0) rad) ang (angle pt1 pt2) mat (list (list (cos ang) (- (sin ang))) (list (sin ang) (cos ang))) blg (1- (sqrt 2.0)) ) (entmake (append '( (000 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline") (090 . 7) (070 . 0) ) (apply 'append (mapcar (function (lambda ( a b ) (list (cons 010 (mapcar '+ (mapcar '(lambda ( r ) (apply '+ (mapcar '* r a))) mat) pt1)) (cons 042 b) ) ) ) (list '(0.0 0.0) (list rad (- rad)) (list di2 (- rad)) (list (+ di2 rad) (- 0 rad rad)) (list (- di1 di2) (- rad)) (list (- di1 rad) (- rad)) (list di1 0.0) ) (list blg 0.0 (- blg) (- blg) 0.0 blg 0.0) ) ) (list (cons 210 (trans '(0.0 0.0 1.0) 1 0 t))) ) ) ) ) (princ) ) To flip the brace, pick the points in the opposite direction.
    3 points
  2. Here you go... (defun c:accolade ( / *error* LM:3pcircle LM:3parc pea cmd r p1 p2 a arc1 li1 arc2 arc3 li2 arc4 ss ) (defun *error* ( m ) (if cmd (setvar 'cmdecho cmd) ) (if pea (setvar 'peditaccept pea) ) (if m (prompt m) ) (princ) ) ;; 3-Point Circle - Lee Mac ;; Returns the center (UCS) and radius of the circle defined by three supplied points (UCS). (defun LM:3pcircle ( pt1 pt2 pt3 / cen md1 md2 vc1 vc2 ) (if (and (setq md1 (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) pt1 pt2)) (setq md2 (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) pt2 pt3)) (setq vc1 (mapcar '- pt2 pt1)) (setq vc2 (mapcar '- pt3 pt2)) (setq cen (inters md1 (mapcar '+ md1 (list (- (cadr vc1)) (car vc1) 0)) md2 (mapcar '+ md2 (list (- (cadr vc2)) (car vc2) 0)) nil ) ) ) (list cen (distance cen pt1)) ) ) (defun LM:3parc ( pt1 pt2 pt3 / lst ocs arc ) (if (setq ocs (trans '(0.0 0.0 1.0) 1 0 t)) (if (setq lst (LM:3pcircle pt1 pt2 pt3)) (progn (if (minusp (sin (- (angle pt1 pt3) (angle pt1 pt2)))) (mapcar 'set '(pt1 pt3) (list pt3 pt1)) ) (setq arc (entmakex (list '(000 . "ARC") (cons 010 (trans (car lst) 1 ocs)) (cons 040 (cadr lst)) (cons 050 (angle (trans (car lst) 1 ocs) (trans pt1 1 ocs))) (cons 051 (angle (trans (car lst) 1 ocs) (trans pt3 1 ocs))) (cons 210 ocs) ) ) ) ) (princ "\nPoints are collinear.") ) ) (if arc arc ) ) (setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0) (setq pea (getvar 'peditaccept)) (setvar 'peditaccept 1) (if (and (not (initget 7)) (setq r (getdist "\nPick or specify radius of arcs : ")) (not (initget 1)) (setq p1 (getpoint "\nPick or specify p1 : ")) (not (initget 1)) (setq p2 (getpoint p1 "\nPick or specify p2 : ")) (> (distance p1 p2) (* 2.0 r)) (setq a (angle p1 p2)) (setq arc1 (LM:3parc (polar p1 (rem (+ a pi) (* 2 pi)) r) (polar p1 (rem (+ a (* 1.25 pi)) (* 2 pi)) r) (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r))) (setq li1 (entmakex (list (cons 0 "LINE") (cons 10 (trans (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) 1 0)) (cons 11 (trans (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (- (/ (distance p1 p2) 2.0) r)) 1 0))))) (setq arc2 (LM:3parc (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (- (/ (distance p1 p2) 2.0) r)) (polar (polar (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (- (/ (distance p1 p2) 2.0) r)) (rem (+ a (* 1.5 pi)) (* 2 pi)) r) (rem (+ a (* 0.25 pi)) (* 2 pi)) r) (polar (polar (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (- (/ (distance p1 p2) 2.0) r)) (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a r))) (setq arc3 (LM:3parc (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (+ (/ (distance p1 p2) 2.0) r)) (polar (polar (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (+ (/ (distance p1 p2) 2.0) r)) (rem (+ a (* 1.5 pi)) (* 2 pi)) r) (rem (+ a (* 0.75 pi)) (* 2 pi)) r) (polar (polar (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (+ (/ (distance p1 p2) 2.0) r)) (rem (+ a (* 1.5 pi)) (* 2 pi)) r) (rem (+ a pi) (* 2 pi)) r))) (setq li2 (entmakex (list (cons 0 "LINE") (cons 10 (trans (polar (polar p1 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) a (+ (/ (distance p1 p2) 2.0) r)) 1 0)) (cons 11 (trans (polar p2 (rem (+ a (* 1.5 pi)) (* 2 pi)) r) 1 0))))) (setq arc4 (LM:3parc (polar p2 a r) (polar p2 (rem (- a (* 0.25 pi)) (* 2 pi)) r) (polar p2 (rem (- a (* 0.5 pi)) (* 2 pi)) r))) ) (progn (setq ss (ssadd)) (ssadd arc1 ss) (ssadd li1 ss) (ssadd arc2 ss) (ssadd arc3 ss) (ssadd li2 ss) (ssadd arc4 ss) (vl-cmdf "_.PEDIT" "_M" ss "" "_J") (while (< 0 (getvar 'cmdactive)) (vl-cmdf "") ) ) ) (*error* nil) ) HTH. M.R.
    2 points
  3. No - such inaccuracies arise as an inherent consequence of the limited precision of the double-precision floating point format (for which the significand can represent decimal values to around 15-17 significant figures of precision). Consider how some numbers cannot be perfectly represented in base10 (decimal) - e.g. multiples of 1/3 represented in decimal would require a infinite number of decimal places to be represented exactly; whereas, these same numbers can be represented exactly in other bases - e.g. 1/3 in base3 (ternary) is exactly 0.1. The same applies to binary values, where other rational numbers cannot be represented exactly, but must instead be approximated to the precision afforded by the amount of memory allocated to the format used to store the value (in this case 64-bits used by the double-precision floating point format). As such, rounding will inevitably occur at the limit of precision following arithmetic operations, which then introduces infinitesimal differences and can result in a calculated value not being exactly equal to its literal counterpart - you can observe these differences directly using the rtos function to display all available decimal places: _$ (rtos x 2 16) "0.8000000000000000" _$ (* x x) 0.64 _$ (rtos (* x x) 2 16) "0.6400000000000002" _$ (= 0.64 (* x x)) nil _$ (equal 0.64 (* x x) 1e-8) T
    1 point
  4. You would think it could be turned off without turning off Dynamic Input. It doesn't really bother me, but I really don't see the need for them, they are selectable in options for a color change. Options>Display>Colors>Dynamic dimensions lines>set the color to your background color (or whatever you desire).
    1 point
  5. I believe that is a function of Polar Tracking if I am not mistaken. Press F10, or click the Polar Tracking button on the status bar.
    1 point
  6. Hi, Thanks to your suggestion, this program has now been upgraded. Your issue should now be resolved in this newer version of the program. Let me know if the calculation are failing, as I did not have many chances to try this on a larger scale.
    1 point
  7. Security wise, it is common to have a stick that can be put in the interior track to prevent the inside light from opening. I don't know if that was the reason for this convention, or just a resulting feature.
    1 point
  8. "Location-wise, you want your patio sliding door to be inside rather than out. Typically, patio doors will slide inside to keep their track protected from outside elements and debris. Of course, there are exterior sliding patio door designs, but they will require more maintenance than an inside sliding option."
    1 point
×
×
  • Create New...