Create Regions

Create Regions

ashrafa33
Enthusiast Enthusiast
1,616 Views
8 Replies
Message 1 of 9

Create Regions

ashrafa33
Enthusiast
Enthusiast

I have more than 1000 polyline 

when icreate REGION using regions = Region.CreateFromCurves(curves);

i get "Autodesk.AutoCAD.Runtime.Exception: eInvalidInput"

how i can Know where is my error

i want to know where i have open region or self-intersection

i think it is open or self-intersection less than 0.001 m

i wnat to find this point

0 Likes
1,617 Views
8 Replies
Replies (8)
Message 2 of 9

hosneyalaa
Advisor
Advisor

@ashrafa33 

try

 

 try
            {

           /// code

               
            }
            catch (Autodesk.AutoCAD.Runtime.Exception ex)
            {
                
            }

 

 

 

https://forums.autodesk.com/t5/net/region-from-3d-polyline/m-p/10759703

 

0 Likes
Message 3 of 9

ashrafa33
Enthusiast
Enthusiast

i try it before

try catch give me

 Autodesk.AutoCAD.Runtime.Exception: eInvalidInput at
Autodesk.AutoCAD.DatabaseServices.Region.CreateFromCurves(DBObjectCollection
curveSegments)
at select.Select_Polylines.region_create() in .................:line 1050

it dose not give me where it is open or self-intersection 

0 Likes
Message 4 of 9

ashrafa33
Enthusiast
Enthusiast

my polylines was arcs & line i convert them polylines list

to delete duplicted  and laping items then i try to make region

so they are not closed polylines

0 Likes
Message 5 of 9

hosneyalaa
Advisor
Advisor
0 Likes
Message 6 of 9

ashrafa33
Enthusiast
Enthusiast

the above post did not help me

any ideas

0 Likes
Message 7 of 9

ashrafa33
Enthusiast
Enthusiast

ashrafa33_0-1698661386160.png

 

0 Likes
Message 8 of 9

hosneyalaa
Advisor
Advisor

Try to join lines and arc  Get polyline through Comment join 

Does it work?

You must attached example drawing

And some code

 

Maybe you have a double in vertex ?

0 Likes
Message 9 of 9

SENL1362
Advisor
Advisor

Maybe you have a double in vertex ?

Or arc's where the Tangents do not match the other end.

Seen these errors a lot for imported DXF files where the tangents of the rounded corners of rectangles have small rounding error (e.q. 89.9999 degrees).

Solution: Move these open endpoints en then move them back to the closing point.

 

0 Likes