Author Topic: region2pl  (Read 4564 times)

0 Members and 1 Guest are viewing this topic.

dexus

  • Bull Frog
  • Posts: 210
Re: region2pl
« Reply #15 on: July 17, 2023, 09:48:11 AM »
Quote
So when it does find a arc that is flipped the wrong way, it will return a bad argument type error.

So when it does find a arc that is flipped the wrong way, it'll flip it with negative bulge right way...
How does it know which one?
It does find the arc, but then it saves True to the mp variable.
Because vl-some doesn't return the variable from the lambda function, it only returns True or Nil.
Which doesn't have a position in mlst, therefore it doesn't know which one to flip.
Am I missing something here?

Yes, you are missing the fact that (vl-some) not always return T or nil... In our particular case it returns variable mp which is mid point of exploded arc...
So if polyline at some position where is placed arc don't have parameter at mp - meaning that exploded arc don't pass - overlap with pline, at that position bulge should be negative from that that was calculated through (_arcbulge) sub...
Oh, I see, you are correct, it does return the first found variable...  :embarrassed2:
The example function just had a function that returned T.
Thanks!

dexus

  • Bull Frog
  • Posts: 210
Re: region2pl
« Reply #16 on: January 24, 2024, 06:09:01 AM »
I have a file with a region that gives an error in all versions of the code posted in this topic.
The following error is given:
Error: AutoCAD.Application: Invalid argument coordinates in Coordinates property
It looks like it might have something todo with the very small Normal: (7.15096e-040 -2.50277e-040 1.0)

Does anyone have any idea how to fix this?
DWG attached to this post.