Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/08/2023 in all areas

  1. Maybe this would work ;;; By Isaac A. ;;; https://www.cadtutor.net/forum/topic/76618-how-to-create-circle-in-every-corner-of-polyline-and-trim-circles-inside/ ;;; Draws circles in every vertex of plines and trims them (defun c:ctri (/ b foo ss) (if (not etrim) (load "extrim.lsp")) (defun foo (p) ;; Alan J. Thompson, 09.09.10 ;; https://www.cadtutor.net/forum/topic/25037-drawing-circles-to-all-vertices-of-polyline/ (if (vl-consp p) (or (vl-member-if (function (lambda (a) (equal (list (car a) (cadr a)) (list (car p) (cadr p))))) plst ) (setq plst (cons (cdr (assoc 10 (entmake (list '(0 . "CIRCLE") (cons 10 p) (cons 40 b))) ) ) pLst ) ) ) ) ) (if (and (setq ss (ssget '((0 . "*POLYLINE")))) (not (initget 6)) ;;; (setq i -1) (setq b (getdist "\nSpecify circle radius :")) ) ((lambda (i / e eLst p pLst) (while (setq e (ssname ss (setq i (1+ i)))) (vl-position (cdr (assoc 0 (entget e))) '("LWPOLYLINE" "POLYLINE")) (repeat (setq p (1+ (fix (vlax-curve-getEndParam e)))) (foo (vlax-curve-getPointAtParam e (setq p (1- p)))) ) (etrim e (ia:midp (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e))) ;;; (osnap (vlax-curve-getStartPoint e) "gcen") ) ) -1 ) ) (princ) ) ;;; ia:midp ;;; Returns the midpoint of 2 given points (defun ia:midp (a b) (mapcar '* (mapcar '+ a b) '(0.5 0.5 0.5)) ) Although most of the code is from Alan J. T., thanks for sharing your codes. This will work with open polylines but as has been said it will not work on the start and end point because it needs 2 points on the polyline to trim the circles. HTH.
    1 point
  2. 1 point
  3. Hello initially, I coded this : (defun C:CC (/ coords ent rad) (setq rad (getreal"\nEnter radius: ")) (while (setq ent (entsel "\nSelect polyline (or press Enter to Exit) >> ")) (setq ent (car ent)) (setq coords (vl-remove-if 'not (mapcar (function (lambda(p) (if (= 10 (car p))(cdr p)))) (entget ent)))) (foreach pt coords (command "_circle" "_non" pt rad) ) ) (princ) ) This will convert polyline vertices to circle. What I want is to automate trim the vertices inside the circle. Hope someone help me to include extrim or any code on this. Thank you sir.
    1 point
  4. 1 point
×
×
  • Create New...