If we call the spreadsheet table SHAPE then the unique column will be called SHAPEID. The record (row) is found by finding the unique value in the key column. The benefits of putting the data into a spreadsheet are that we can have a whole sheet of parts, and we can manipulate the data and the finished part easily. Autocad vba polyline bulge code#(setq ip1h (mapcar '/ (mapcar ' ip ap1) (list 2.0 2.0 2.0)) ip2h (mapcar '/ (mapcar ' ip ap2) (list 2.0 2.0 2.We need to store the formulas in the order the polyline requires them, not evaluate them to x and y symbols first.īut eventually I learned to enter the formulas per the sketch just doing all the x values, in the order they are to be drawn, then do all the y values, similar to the code process. (setq apc1 (polar ap1 (angle ap1 ap2) br) apc2 (polar ap2 (angle ap2 ap1) br)) (if (> (distance ip ap1) (distance ip ap2)) (setq ip (inters ap1 ap2 (cdr (assoc 10 (entget li))) (cdr (assoc 11 (entget li))) nil)) (setq br (getdist "\nPick or specify bend radius : ")) (prompt "\nLine enitity does not pass through circle or don't have apparent intersections with circle or it is touching circle in single apex point. (if (>= (setq d (distance (setq c (cdr (assoc 10 (entget ci)))) (inters c (polar c ( (* 0.5 pi) (setq a (angle (cdr (assoc 10 (entget li))) (cdr (assoc 11 (entget li)))))) 1.0) (cdr (assoc 10 (entget li))) (cdr (assoc 11 (entget li))) nil))) (setq r (cdr (assoc 40 (entget ci))))) (prompt "\nMissed or picked entity is not circle enitity.") (while (or (not (setq ci (car (entsel "\nPick circle entity.")))) (if ci (/= (cdr (assoc 0 (entget ci))) "CIRCLE"))) (prompt "\nMissed or picked entity is not line enitity.") (while (or (not (setq li (car (entsel "\nPick line entity.")))) (if li (/= (cdr (assoc 0 (entget li))) "LINE"))) (defun c:bend ( / acos li ci d c a r br ap1 ap2 ip apc1 apc2 ip1h ip2h an1 an2 ip1h1 ip1h2 ip2h1 ip2h2 s1 e1 s2 e2 apc11 apc12 apc21 apc22 sm1 em1 sm2 em2 ) (/ (sin x) (cos You can avoid bulges - you just need points. ( (lambda ( n ) (if (equal 0.0 n 1e-10) nil (mapcar '/ v (list n n n)))) Args: v - vector in R^n, s - real scalar Args: a,b,c - coefficients of ax^2 bx c = 0 (mapcar '(lambda ( s ) (mapcar ' p (vxs v s))) (defun LM:inters-line-circle ( p q c r / v s ) points p,q and circle with centre c and radius r Returns the point(s) of intersection between an infinite line defined by Autocad vba polyline bulge mac#Line-Circle Intersection (vector version) - Lee Mac Pt6 (polar (car int) (angle (car int) pt4) brd) Int (LM:inters-line-circle pt5 (mapcar ' pt5 vc1) pt4 ( brd brd)) (prompt "\nCircle does not intersect polyline.") (prompt "\nCircle center cannot lie on polyline.") Pt3 (mapcar ' pt1 (vxs vc1 (vxv (mapcar '- cpt pt1) vc1))) (defun bend ( pt1 pt2 cpt crd brd / ang bu1 bu2 int pt3 pt4 pt5 pt6 pt7 vc1 ) (princ (strcat "\nBend radius must be greater than or equal to " (rtos rad) ".")) (progn (initget 6) (setq rtn (getdist msg))) ( (/= typ (cdr (assoc 0 (entget (car sel))))) (progn (setvar 'errno 0) (setq sel (entsel msg)) (vlax-curve-getpointatparam (car ply) (1 (fix par))) (vlax-curve-getpointatparam (car ply) (fix par)) Rad (bendradius "\nSpecify bend radius: " (cdr (assoc 40 cir))) (setq par (vlax-curve-getparamatpoint (car ply) (vlax-curve-getclosestpointto (car ply) (trans (cadr ply) 1 0)))Ĭir (entget (car cir)) (setq cir (select "\nSelect circle: " "CIRCLE")) (if (and (setq ply (select "\nSelect 2D polyline: " "LWPOLYLINE"))
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |