Jump to content

Leaderboard

Popular Content

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

  1. Be worth setting up a plotstyle just for that I think - saves you having to remember everything, might be able to do something with LISP for all the other p[arts
    1 point
  2. No problem with text, you can just uncheck "Capture fonts used in the drawing" and select "Convert all text to geometry" in the PDF Options. You should also uncheck everything else and see if adjusting the quality helps.
    1 point
  3. My grain of sand another. Selecting 3 points. The third point will be on one side or the other of the main alignment. The radius is equal to the distance from p3 to the line p1-p2/2 (defun punto_izda_dcha (p1 p2 p3 / a b c) (defun det3 (a b c) (+ (det2 b c) (det2 a b) (- (det2 a c))) ) (defun det2 (a b) (- (* (car a) (cadr b)) (* (car b) (cadr a))) ) (setq resultado (/ (det3 p1 p2 p3) 2)) ) (defun c:llave (/ pt1 pt2 pt3 dist_pt1_pt2 radio bulge p2aux p3aux p4aux p5aux p6aux area ang_perp) (if (= cal nil) (arxload "geomcal")) (setq pt1 (getpoint "\nIndica el punto 1: ")) (setq pt2 (getpoint "\nIndica el punto 2: ")) (setq pt3 (getpoint "\nIndica el punto 3: ")) (setq dist_pt1_pt2 (distance pt1 pt2)) (setq radio (/ (c:cal "dpl(pt3,pt1,pt2)") 2.)) (setq bulge (abs(- 1 (sqrt 2)))) (cond ((equal (c:cal "dpl(pt3,pt1,pt2)") 0.0 0.01) (setq radio (/ dist_pt1_pt2 8)) ) ((> (* (c:cal "dpl(pt3,pt1,pt2)") 4) dist_pt1_pt2) (setq radio (/ dist_pt1_pt2 4)) ) ) (setq p2aux (polar pt1 (angle pt1 pt2) radio)) (setq p4aux (mapcar '(lambda (x y) (/ (+ x y) 2)) pt1 pt2)) (setq p3aux (polar p4aux (angle pt2 pt1) radio)) (setq p5aux (polar p4aux (angle pt1 pt2) radio)) (setq p6aux (polar pt2 (angle pt2 pt1) radio)) (setq area (punto_izda_dcha pt1 pt2 pt3)) (if (< area 0) (setq ang_perp (+ (angle pt1 pt2) (* (/ pi 2)3))) (setq ang_perp (+ (angle pt1 pt2) (/ pi 2))) ) (setq p2 (polar p2aux ang_perp radio)) (setq p3 (polar p3aux ang_perp radio)) (setq p4 (polar p4aux ang_perp (* radio 2))) (setq p5 (polar p5aux ang_perp radio)) (setq p6 (polar p6aux ang_perp radio)) (entmake (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 7) '(43 . 0.25);grosor '(38 . 0.0);elevacion '(62 . 1);color por capa (list 10 (car pt1) (cadr pt1)) '(40 . 0.0) '(41 . 0.0) (if (< area 0) (cons 42 bulge) (cons 42 (- bulge))) (list 10 (car p2) (cadr p2)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (list 10 (car p3) (cadr p3)) '(40 . 0.0) '(41 . 0.0) (if (< area 0) (cons 42 (- bulge)) (cons 42 bulge)) (list 10 (car p4) (cadr p4)) '(40 . 0.0) '(41 . 0.0) (if (< area 0) (cons 42 (- bulge)) (cons 42 bulge)) (list 10 (car p5) (cadr p5)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (list 10 (car p6) (cadr p6)) '(40 . 0.0) '(41 . 0.0) (if (< area 0) (cons 42 bulge) (cons 42 (- bulge))) (list 10 (car pt2) (cadr pt2)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(210 0.0 0.0 1.0) )) )
    1 point
  4. Based on wall insulation code I have of straights and arcs using just the pline command with option of a "Arc" would be feasible also, though the code by lee would be hard to beat. May have a go also using plain pline commands. Could add radius options in a range like 0.5 - 2.5 but more than likely will be fixed. Another ; pline with arcs by AlanH April 2023 (defun c:wow ( / pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt9 pt10 pt11 dist ang rad) (setq rad 1) (setq pt1 (getpoint "\nPick start point ")) (setq pt11 (getpoint pt1 "\nPick end point ")) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq ang (angle pt1 pt11)) (setq dist (distance pt1 pt11)) ; do like Lee check dist is long enough (setq pt2 (polar (polar pt1 ang rad) (+ ang (* 1.25 pi)) rad)) (setq pt3 (polar (polar pt1 ang rad) (- ang (/ pi 2)) rad)) (setq pt4 (polar pt3 ang (- (/ dist 2.0) (* 2.0 rad)))) (setq pt5 (polar (polar pt4 (- ang (/ pi 2.)) rad)(+ ang (* 0.25 pi)) rad)) (setq pt6 (polar (polar pt4 ang rad) (- ang (/ pi 2)) rad)) (setq pt7 (polar (polar pt6 ang rad) (+ ang (* 0.75 pi)) rad)) (setq pt8 (polar pt4 ang (* 2.0 rad))) (setq pt9 (polar pt8 ang (- (/ dist 2.0) (* 2.0 rad)))) (setq pt10 (polar (polar pt11 (+ pi ang) rad) (+ ang (* 1.75 pi)) rad)) (command "pLINE" pt1 "w" 0.0 0.0 "arc" "s" pt2 pt3 "L" pt4 "arc" "s" pt5 pt6 "arc" "s" pt7 pt8 "L" pt9 "arc" "s" pt10 pt11 "") (setvar 'osmode oldsnap) (princ) )
    1 point
  5. @Emmanuel Delay Have you thought about using a block for this? (defun c:foo (/ d p1 p2) (cond ((null (tblobjname "block" "Brace")) (entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference") (2 . "Brace") (10 0. 0. 0.) (70 . 0) ) ) (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbPolyline") (90 . 7) (70 . 0) (43 . 0.) (38 . 0.) (39 . 0.) (10 -0.5 0.) (40 . 0.) (41 . 0.) (42 . 0.414213562373095) (91 . 0) (10 -0.4 -0.1) (40 . 0.) (41 . 0.) (42 . 0.) (91 . 0) (10 -0.1 -0.1) (40 . 0.) (41 . 0.) (42 . -0.414213562373095) (91 . 0) (10 0. -0.2) (40 . 0.) (41 . 0.) (42 . -0.414213562373095) (91 . 0) (10 0.1 -0.1) (40 . 0.) (41 . 0.) (42 . 0.) (91 . 0) (10 0.4 -0.1) (40 . 0.) (41 . 0.) (42 . 0.414213562373095) (91 . 0) (10 0.5 0.) (40 . 0.) (41 . 0.) (42 . 0.) (91 . 0) ) ) (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0"))) ) ) (if (and (setq p1 (getpoint "\nPick first point: ")) (setq p2 (getpoint p1 "\nPick second point: ")) ) (entmake (list '(0 . "INSERT") '(100 . "AcDbEntity") '(8 . "Brace") '(100 . "AcDbBlockReference") '(2 . "Brace") (cons 10 (mapcar '/ (mapcar '+ p1 p2) '(2 2 2))) (cons 41 (setq d (distance p1 p2))) (cons 42 d) (cons 43 d) (cons 50 (angle p1 p2)) ) ) ) (princ) )
    1 point
×
×
  • Create New...