How can I do it? Like in AutoCAD electrical, when I drawing wire? Please see attach.
Thanks
How can I do it? Like in AutoCAD electrical, when I drawing wire? Please see attach.
Thanks
I find LISP, but doesn't work, I have error no finstion definition: dxf
Code:(defun C:arcc ( / head hdata bulge en ed) (if (and (setq en (entsel "\nselect polyline: ")) (= (dxf 0 (setq hdata (entget (car en)))) "POLYLINE") ) (progn (entmod (subst '(70 . 1) '(70 . 0) hdata)) (setq bulge (list (cons 42 0.5))) (setq en (dxf -1 hdata)) (while (and (setq en (entnext en)) (setq ed (entget en)) (/= "SEQEND" (dxf 0 ed)) ) (setq ed (append ed bulge)) (entmod ed) ) (entupd en) ) ) (princ) ) (princ)
Last edited by Opie; 2010-03-12 at 02:59 PM. Reason: [code] tags added
b.ssss.12 (Are you a robot like C-3PO and R2-D2 ?)
Well let's go to the facts.
The error No function definition DXF is dued that you must have a function named DXF.
See the example following:
(defun dxf (num x)
(cdr(assoc num (entget x)))
)
See in AutoCAD Help:
DXF Reference --> DXF Format --> Group Codes in Numerical Order
And here try the new code:
I hope that helps you.Code:(princ Type ARCC to Start !") ;; -------------------------- (defun dxf (num x) ; The DXF function that was missing. (cdr(assoc num (entget x))) ) ;; -------------------------------------- (defun C:arcc ( / head hdata bulge en ed) (if (and (setq en (entsel "\nselect polyline: ")) (= (dxf 0 (setq hdata (entget (car en)))) "POLYLINE") ) (progn (entmod (subst '(70 . 1) '(70 . 0) hdata)) (setq bulge (list (cons 42 0.5))) (setq en (dxf -1 hdata)) (while (and (setq en (entnext en)) (setq ed (entget en)) (/= "SEQEND" (dxf 0 ed)) ) (setq ed (append ed bulge)) (entmod ed) ) (entupd en) ) ) (princ) ) (princ)
Enjoy and improve the code. Ah! You must extract ename.
(setq c (car (entsel)))
(setq b (entget c))
(setq a (cdr (assoc '0 b))) ; a will get the name of entity.
hugopaulo
I have new error
Code:error: bad argument type: lentityp ((-1 . <Entity name: 7ffffb08020>) (0 . "LWPOLYLINE") (330 . <Entity name: 7ffffb039f0>) (5 . "3F2") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 35.2926 24.9918) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 41.4498 24.9918) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0 1.0))
I need this.. ..is there any complete lisp for this?
Are you wanting it to work on Lines/Lwpolylines/Polylines?
Waht is the size for the break?
i want it both...lets say the break around 500mm distance.
A quick one, no error trap, no defaults.. none of the essentials ... WYSIWYG
Code:(defun c:brc (/ obj rad e pt rf pt1 pt2 arc gr mode data) (vl-load-com) (setq osm (getvar 'osmode)) (setvar 'osmode 32) (setq obj (car (entsel "\nSelect Object to break:"))) (Setq rf (getpoint "\nPick center point of arc:")) (setq rad (getdist "\nEnter Radius value/Pick two points: ")) (setq pt (vlax-curve-getClosestPointTo (setq e obj) rf) rf (+ (vlax-curve-getdistatPoint e pt) rad) ) (command "_arc" "_non" (setq pt1 (vlax-curve-getPointAtDist e rf)) "_e" "_non" (setq pt2 (vlax-curve-getPointAtDist e (- rf (* rad 2)))) "_r" rad ) (setq arc (entlast) tr 0 ) (prompt "\nMove Mouse up and down to flip") (while (progn (setq gr (grread t 15 0) mode (car gr) data (cadr gr) ) (cond ((= 5 mode) (if ((if (zerop tr) < > ) pi (angle pt data) ) (setq tr (boole 6 1 tr) ro (vlax-invoke (vlax-ename->vla-object arc) 'rotate pt pi ) ) ) T ) ((member mode '(2 3)) nil) ) ) ) (command "_break" obj pt1 pt2) (setvar 'osmode osm) (princ) )
Last edited by pbejse; 2012-10-12 at 07:58 AM. Reason: Add pi for missing variable ang
One mistake :
replace ang with PI
M.R.Code:((if (zerop tr) < >) pi (angle pt data))