Author Topic: I need a lisp to draw a line and break object it touch in one step  (Read 1217 times)

0 Members and 1 Guest are viewing this topic.

meja

  • Newt
  • Posts: 47
I want to draw a line(or arc pline etc)and break any object it touch in one step。EVen I think use CAB's Breakall Function,But I fail。 So who can help me,give a code to do it! :smitten:
« Last Edit: June 10, 2023, 03:35:05 AM by meja »

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2141
  • class keyThumper<T>:ILazy<T>
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #1 on: June 10, 2023, 04:16:49 AM »
You may have issues with the first option.
From memory, an arc can't enclose 360 deg in Autocad

I'm surprised Alan's code fails in any other situation.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

meja

  • Newt
  • Posts: 47
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #2 on: June 10, 2023, 07:25:37 AM »
you misunderstand me,CAB code is perfect,just I cant mod it for my use
ps CIRCLE can be break(360 degree) with line if use breakall lisp,but it error with arc

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #3 on: June 10, 2023, 11:47:13 AM »
I've mod. CAB's Break Objects routine to suit my needs... Perhaps it'll work with your examples... Test it if you have a time...

You should use : (c:BreakAll-nogap)
« Last Edit: June 10, 2023, 11:56:52 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

meja

  • Newt
  • Posts: 47
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #4 on: June 10, 2023, 01:30:14 PM »
I've mod. CAB's Break Objects routine to suit my needs... Perhaps it'll work with your examples... Test it if you have a time...

You should use : (c:BreakAll-nogap)
many thanks :smitten:
my idea is while I am drawing a line,it breaks any objects it crossed。Not to select line I have drawed and other objrcts。

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #5 on: June 10, 2023, 03:24:55 PM »
I've mod. CAB's Break Objects routine to suit my needs... Perhaps it'll work with your examples... Test it if you have a time...

You should use : (c:BreakAll-nogap)
many thanks :smitten:
my idea is while I am drawing a line,it breaks any objects it crossed。Not to select line I have drawed and other objrcts。

While you draw, CAD is in dynamic mode and it can't predict where your command is going to end - cmdactive sysvar, therefore you can't break object in desired location; only when command is finished CAD knows position of entities and can do break if that's intention... But CAB did his routine to work with gaps, so you'll have to modify my version to be without gaps - pull info from (c:BreakAll-nogap) and add it to Break this with other object for single entity breaking... But for me this is what I was needing - BreakAll... If you need something more sophisticated you'll have to code for it and not wait on the plate for every single request...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2141
  • class keyThumper<T>:ILazy<T>
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #6 on: June 10, 2023, 06:16:54 PM »
you misunderstand me,CAB code is perfect,just I cant mod it for my use
ps CIRCLE can be break(360 degree) with line if use breakall lisp,>> . . . . .

ok, good to know.
Thanks
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8728
  • AKA Daniel

meja

  • Newt
  • Posts: 47
Re: I need a lisp to draw a line and break object it touch in one step
« Reply #8 on: June 12, 2023, 07:43:34 AM »
I just dont know python,how to run the code