myloveflyer Posted May 24, 2019 Posted May 24, 2019 How to extend or cut a straight line by changing the diameter of the circle?See the DWG in the attachment for details. test.dwg Quote
lrm Posted May 24, 2019 Posted May 24, 2019 If you don't want to use trim/extend then you could use parametric constraints which would allow you to change one diameter and all the other would update and lines would adjust accordingly. Just put a parametric diameter dimension on one of the circles and use its label (e.g., dia1) for the other circles constraint dimensions. The line ends would be (dia1)/2 from the circle center. Quote
myloveflyer Posted May 24, 2019 Author Posted May 24, 2019 51 minutes ago, lrm said: 如果您不想使用TRIM/EXTEND,那么您可以使用参数约束,这将允许您更改一个直径,所有其他的将更新,线条将相应调整。只需在其中一个圆上放置一个参数直径维,并对其他圆约束尺寸使用它的标签(例如dia 1)。线的末端将是(Dia 1)/2从圆心。 The graph must extend or cut the line by changing the diameter of the circle, because the graph is from other software. If you define a constraint, you need to define a lot. Can you write a color by changing the diameter of the circle or cutting the line? Quote
BIGAL Posted May 24, 2019 Posted May 24, 2019 Here is something to try , for me this is step 2 step 1 would change the size of the circles then trim as below. ; defun trim inside circles ; By Alan H May 2019 AlanH Consulting ; www.alanh.com.au (defun aH:trimcircles (/ ss ang rad oldsnap oldaunits obj lay) (setq oldsnap (getvar "osmode")) (setq oldaunits (getvar 'aunits)) (setq lay (cdr (assoc 8 (entget (car (entsel "Pick circle")))))) (setq ss (ssget (list (cons 0 "Circle") (cons 8 lay)))) ;(setq rad (getreal "Enter new radius")) ;(repeat (setq x (sslength ss)) ; (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) ; (vlax-put Obj 'Radius rad) ; ) (setvar 'osmode 0) (setvar 'aunits 3) (repeat (setq x (sslength ss)) (setq obj (entget (ssname ss (setq x (- x 1))))) (setq rad (cdr (assoc 40 obj))) (setq cenpt (list (nth 1 (assoc 10 obj)) (nth 2 (assoc 10 obj)))) (setq ent (cdr (assoc -1 obj))) (setq rad (- rad 3)) (setq lst '()) (setq ang 0.0) (repeat 10 (setq lst (cons (polar cenpt ang rad) lst)) (setq ang (+ ang 0.62831853)) ) (command "trim" ent "" "fence") (while (= (getvar "cmdactive") 1) (repeat (setq y (length lst)) (command (nth (setq y (- y 1)) lst)) ) (command "" "") ) ) (setvar 'osmode oldsnap) (setvar 'aunits oldaunits) ) (aH:trimcircles) (defun c:trci () (aH:trimcircles)) Quote
XDSoft Posted May 2, 2024 Posted May 2, 2024 [XDrX-PlugIn(160)] extend or cut curve with circle (theswamp.org) https://www.theswamp.org/index.php?topic=59528.0 Implemented using moving grips(stretch point) (defun c:xdtb_cirextend (/ box clone ints nearpt pnt r ss ss1 strepnts x y z) (xd::doc:getdouble (xdrx-string-multilanguage "\n圆半径" "\nCircle Radius") "#mradius" 10.0 ) (if (setq ss (xdrx-ssget (xdrx-string-multilanguage "\n选择圆<退出>:" "\nSelect Circle<Exit>:") '((0 . "circle")) ) ) (progn (mapcar '(lambda (x) (setq r (xdrx-getpropertyvalue x "radius") box (xdrx-entity-box x) box (xd::pnts:close box) ) (setq clone (xdrx-object-clone x)) (xdrx-setpropertyvalue x "radius" #mradius) (if (setq ss1 (ssget "f" box '((0 . "*polyline,line")))) (progn (mapcar '(lambda (y) (setq strepnts (xdrx-entity-getstretchpoint y)) (if (setq pnt (vl-some '(lambda (z) (if (xdrx-point-ison z clone) z ) ) strepnts ) ) (progn (if (setq ints (xdrx-entity-intersectwith y x 1)) (progn (setq nearpt (xdrx-points-nearpt pnt ints)) (xdrx-entity-movestretchpointex y pnt (mapcar '- nearpt pnt ) ) ) ) ) ) ) (xdrx-ss->ents ss1) ) ) ) (xdrx-entity-delete clone) ) (xdrx-ss->ents ss) ) ) ) (princ) ) ===================================== The above code uses XDrx API, download link: https://github.com/xdcad/XDrx-API-zip https://sourceforge.net/projects/xdrx-api-zip/ Dual version link: https://github.com/xdcad 1 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.