AcDbRegion::createFromCurves error aEs = eInvalidInput (3)

AcDbRegion::createFromCurves error aEs = eInvalidInput (3)

Anonymous
Not applicable
1,319 Views
2 Replies
Message 1 of 3

AcDbRegion::createFromCurves error aEs = eInvalidInput (3)

Anonymous
Not applicable

Hello, I have problem at function: AcDbRegion::createFromCurves. 

When trying to build a region formed by three lines, I get the error eInvalidInput (3) . Perhaps the order of adding these lines to the AcDbVoidPtrArray curveArray is important; or maybe it depends on the direction of the normal? What conditions must be met for this function to generate a region?

0 Likes
Accepted solutions (1)
1,320 Views
2 Replies
Replies (2)
Message 2 of 3

tbrammer
Advisor
Advisor
Accepted solution

Can you post your code or a DWG with the lines you are use?

What kind of "lines" do you use? They must be derived from AcDbEntity. So AcDbLine is ok, but not AcGeLine2d.

All curves must be in the same plane. I always use curves within the XY-plane with Z=0.

The curves must not intersect. Their endpoints must match.

If you try to create a region from three lines with startpoints sp1,sp2,sp3 and endpoints ep1,ep2,ep3 than try to make sure that:   

[ep1 = sp2]----[ep2=sp3]----[ep3=sp1]  and not for example  

[ep1 = ep2]----[2p2=sp3]----[ep3=sp1]. So all curves run in the same order. But I'm not sure whether this is required.

It could help to set the lines normals to the plane normal

  norm=(l1->endPoint()-l1(startPoint()).crossProduct(l2->endPoint()-l2(startPoint());

Maybe it is easier to create the region from a closed AcDbPolyline.

If the curves are DB resident, they must be opened for read only, not for write.

It is also possible to create a region from non-DB-resident curves.

The docs say that a return value !=eOk does NOT imply a "total failure" - the returned AcDbVoidPtrArray might be non-empty.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 3

Anonymous
Not applicable

The problem was that the straight lines did not lie in the same plane. I had to break the surface that forms these lines into triangles and connect the vertices of ACGePoint3D with a closed polyline. Thank you

0 Likes