Author Topic: Lisp or method to break circle in two or more parts  (Read 428 times)

0 Members and 1 Guest are viewing this topic.

Vikram

  • Newt
  • Posts: 49
Lisp or method to break circle in two or more parts
« on: February 01, 2021, 05:05:55 AM »
I need a lisp or a method to break the circle in 2 or more parts. I used to use AutoCAD previously so Lee Mac's circle break lisp was very helpful for me. Now my company have started using ProgeCAD/IntelliCAD and that lisp is not compatible with that lisp as it partially supports visual functions. You can see the combability on this link. https://www.progesoft.com/products/progecad-professional/manual?mp=understanding-autocad-compatibility/programming-progecad/understanding-autolisp-compatibility
Whenever I use cbrk command and select the two points to break my IntelliCAD crashes.
I have attached Lee Macs lisp to break circle.
 My project is stuck due to this! :sick:


Dahzee

  • Newt
  • Posts: 22
Re: Lisp or method to break circle in two or more parts
« Reply #1 on: February 01, 2021, 05:55:29 AM »
Hi Vikram,

Not sure if the below will work in Progecad, but it uses native commands, so could work.

"If you convert a circle to a polyline and then explode it, you're left with 2 arcs -- a top arc and a bottom arc. If you select both arcs, you can drag the left and right endpoints of those arcs to the points on the circle where you wanted it broken"

d2010

  • Newt
  • Posts: 154
Re: Lisp or method to break circle in two or more parts
« Reply #2 on: February 01, 2021, 07:59:48 AM »
RE: "If you convert a circle to a polyline and then explode it, you're left with 2 arcs -
------------------------
You see my Demo. Circle2Polyline .
Code: [Select]
(Defun dfn_cmd_circlebreak(en1 /  cls nop xlm p obj ctr dia occ prv ra3 old)  (asserte "A232")
  (setq;|a13812|;
nam (car en1)
xlm (entget nam)
p (cadr en1)
old (entlast)
obj (cdr (assoc 0 xlm))) (if (=  obj "CIRCLE") (progn  (setq;|a13986|;
occ (cdr (assoc 62 xlm))
ra3 (cdr (assoc 40 xlm))
ctr (cdr (assoc 10 xlm))
xlm (if (/= occ nil) (subst (cons 62 11) (cons 62 occ) xlm) (subst (cons 62 12) nil xlm))
xlm (subst (cons 40 (* ra3 0.78)) (cons 40 ra3) xlm)) (entmakex (cdr xlm)))) (if (/= old (entlast)) (progn  (setq;|a14372|;
dia (* 2.0 ra3)
cls (dfn_getx_readkey "[YN]" "Pline-toClose(y.yes)(n.no): ")) (if (=  cls "Y") (command "_.break" p (polar p (/ kpi 4) 0.001) "_.pedit" p "_y" "_c" "_x") (command "_.break" p (polar p (/ kpi 4) 0.001) "_.pedit" p "_y" "_x"))))
)
You execute (dfn_cmd_circlebreak (entsel)) at line-command.
The "0.78" is decrease of radius. You replace with 1.0 for same-radius with circle/s.
For quickUnderstand you replace ~cls (dfn_getx_readkey "[YN]" ~ with
(setq cls "Y"),.

« Last Edit: February 01, 2021, 10:10:40 AM by d2010 »

Vikram

  • Newt
  • Posts: 49
Re: Lisp or method to break circle in two or more parts
« Reply #3 on: February 01, 2021, 11:53:39 AM »
Thanks for your time appreciate your help but It dint work on ProgeCAD. But making it polyline and breaking it worked for me.

BIGAL

  • Swamp Rat
  • Posts: 665
  • 30 + years of using Autocad
Re: Lisp or method to break circle in two or more parts
« Reply #4 on: February 01, 2021, 05:40:34 PM »
The other alternative is 1st principals know radius, know centre pt, erase circle, make an arc angle 0-PI, 2nd arc pi-2*pi using command or entmake should work with any cad.
A man who never made a mistake never made anything