Lee Mac Posted October 17, 2013 Share Posted October 17, 2013 Genius as always . thank you so much lee mac!!! That's some old code! - but thanks Daniel! Quote Link to comment Share on other sites More sharing options...
sieu khung khiep Posted June 10, 2017 Share Posted June 10, 2017 Cbrk.lsp doenot worked in some case,i don't know why but when i modify this lisp,now it working for me,but i donot know my lisp modifed is that correct? can you update your code,lee (defun c:CBrk (/ ss tmp i j ent elst inc st s501 len R1 ) (vl-load-com) (or Cbrk:num (setq Cbrk:num 2)) (cond ((setq ss (ssget "_:L" '((0 . "ARC,CIRCLE")))) (initget 6) (and (setq tmp (getint (strcat "\nSpecify Number of Sections <" (itoa Cbrk:num) "> : "))) (setq Cbrk:num tmp)) (setq i -1) (while (setq ent (ssname ss (setq i (1+ i)))) (setq elst (entget ent) j -1) (cond ((eq "CIRCLE" (cdr (assoc 0 elst))) (setq inc (/ (* 2 pi) cBrk:num) st 0.));cond (t (progn (setq len (vla-get-arclength (vlax-ename->vla-object ent)) R1 (cdr (assoc 40 elst))) (setq s501 (abs (- (cdr (assoc 51 elst)) (setq st (cdr (assoc 50 elst))) ))) (if (<= len (* pi R1)) (if (> s501 pi) ;big angle but leng arc small (setq inc (/ (- (* 2 pi) s501) cBrk:num)) (setq inc (/ s501 cBrk:num));setq );if1 (if (> s501 pi) ;goc lon (setq inc (/ s501 cBrk:num));setq (setq inc (/ (- (* 2 pi) s501) cBrk:num)) );if1 );if );progn ));cond (repeat cbrk:num (entmake (list (cons 0 "ARC") (assoc 8 elst) (assoc 10 elst) (assoc 40 elst) (cons 50 (+ st (* (setq j (1+ j)) inc))) (cons 51 (+ st (* (1+ j) inc))))) (entmake (list (cons 0 "LINE") (assoc 8 elst) (assoc 10 elst) (cons 11 (polar (cdr (assoc 10 elst)) (+ st (* j inc)) (cdr (assoc 40 elst))))))) (if (eq "ARC" (cdr (assoc 0 elst))) (entmake (list (cons 0 "LINE") (assoc 8 elst) (assoc 10 elst) (cons 11 (polar (cdr (assoc 10 elst)) (+ st (* (1+ j) inc)) (cdr (assoc 40 elst))))))) (entdel ent)))) (princ)) Quote Link to comment Share on other sites More sharing options...
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.