Author Topic: small pieces to remove  (Read 1318 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Re: small pieces to remove
« Reply #15 on: November 16, 2022, 03:35:27 AM »
Basically, splits the curve into segments, at each of the points in the argument
https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-RefGuide-AcDbCurve__getSplitCurves_AcGePoint3dArray__AcDbVoidPtrArray__const

I donít think itís available to lisp though. I think Bigalís suggestion might be a better alternative, just move the end, instead of splitting it and deleting the short ends

Retired

DEVITG

  • Bull Frog
  • Posts: 475
Re: small pieces to remove
« Reply #16 on: November 16, 2022, 08:01:01 PM »
@domenicomaria Just do a google , and get it

Quote
https://www.google.com/search?q=getSplitCurves&sourceid=chrome&ie=UTF-8

Could you, please upload your sample dwg?
Location @ Cůrdoba Argentina Using ACAD 2019  at Window 10

domenicomaria

  • Bull Frog
  • Posts: 418
Re: small pieces to remove
« Reply #17 on: November 17, 2022, 12:16:11 AM »
@ Daniel & DEVITG

Thank you

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Re: small pieces to remove
« Reply #18 on: November 17, 2022, 01:23:26 AM »
mine fails in some cases
Retired

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Re: small pieces to remove
« Reply #19 on: November 17, 2022, 02:57:37 AM »
fixed it, getsplitcurves wants the points sorted  :mrgreen:
added
Code - C: [Select]
  1.             std::sort(item.second.begin(), item.second.end(), [&](const auto& a, const auto& b) -> bool
  2.             {
  3.                 double da, db;
  4.                 pLine->getDistAtPoint(a, da);
  5.                 pLine->getDistAtPoint(b, db);
  6.                 return da < db;
  7.             });
  8.  

i attached the source and a binary for autocad 2021-2023.
the command is CHOPPER  :lol:
Retired

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Re: small pieces to remove
« Reply #20 on: November 17, 2022, 03:01:13 AM »
BTW, the sort is a lambda expression in c++, just in case I can convert you to the darkside  :devilsidesmile:
Retired

domenicomaria

  • Bull Frog
  • Posts: 418
Re: small pieces to remove
« Reply #21 on: November 17, 2022, 03:37:24 AM »
Daniel, you are great !

I want try to translate it into vlisp