the region is unioned by two regions .but the area get by api getArea() is 0.in cad property window can not show area and perimeter. i use command "area" to caculate area but failed. is there anything wrong?
Solved! Go to Solution.
Solved by tbrammer. Go to Solution.
Can you please post the DWG with the region in question?
You wrote that the region is a union of two regions. Do both have a valid area? Can you post a DWG with those regions as well?
Do you know how the regions were created?
Which AutoCAD version are you using?
the region is created by api booleanOper(AcDb::kBoolUnite).it have merged the other region.the version of CAD is 2018.
Again: Can you please post the DWG with the region in question and if possible a DWG with the two regions that you merged?
Have you tried to open the DWG with _RECOVER?
Can you check the DWG with a newer version of AutoCAD?
I can reproduce the behaviour with AutoCAD 2024.
The two regions in the DWG are valid. But if I _UNITE them, the resulting region looks OK, but it doesn't show geometry properties like area and circumference.
If I use the command SNOOPENTS from ArxDbg.arx (<ARX>\samples\database\ARXDBG) I get the error messages
ERROR calling AcDbRegion::getAreaProp()
ARX ERROR: eInvalidInput
Also the AutoCAD command _AREA _OBJECT can't calculate the area.
The AutoCAD command _MASSPROP however displays values for area (Fläche) and circumference (Umfang):
The geometry of one region is very complex. It has a lot of "touching points" that makes it hard to decide whether there is one region with a hole or multiple separate regions. I suppose that this causes the problem.
Looks like a bug. So I think this is a case for the AutoCAD product support.
I managed to create a valid united region like this:
See attached DWG. I think you can do the same programmatically with ObjectARX. This could be a workaround for you.
i have resolved the problem.the region is create by the AcDb3dPolyline which vertexs ' z value is 0.i change to AcDbPolyline and setElevation(0),then the problem is resolved.thank you for your help.
i have resolved the problem.the region is create by the AcDb3dPolyline which vertexs ' z value is 0.i change to AcDbPolyline and setElevation(0),then the problem is resolved.thank you for your help.
Can't find what you're looking for? Ask the community or share your knowledge.