I have a drawing with several hatch objects, and when I attempt to query some of the hatch's Area, I get an Invalid input Automation Error.
The hatch has an Area in the Properties dialog box, yet in the vlax-dump-object for the hatch object, it states
Area (RO) = AutoCAD.Applicaiton: Invalid input
Any thoughts on what would cause this?
As for how to test for it, should I just wrap the vla-get-area in a catch-all-error?
Object snaps might interfere with the results: the routine could be altered to turn them off or you could do it manually. Also, there is a bounding lightweight polyline made around the hatch that is erased. If you want to keep it for any reason you could remove (or comment out) the line (command "erase" bound "").
Edited by: Tom_Brabant on Mar 26, 2009 3:01 PM
You are right. It doesn't check the relevance of the 10 groups, but eliminates the first and last one assuming they are not on the boundary. But, arcs and islands are a bigger issue. What do you think of this?
1. Set an undo mark.
2. use (command "hatchedit" ) to convert the pattern to dots.
3 also adjust the hatch scale to make the dots proportional to your area measurement..
4. explode the hatch.
5. save the exploded entities (zero length lines) as a (previous) selection set
6. Count the entities in the set to approximate the area to the desired precision (depends on choice of hatch scale)
7. Undo back to mark to undo the hatch destruction.
Edited by: Tom_Brabant on Mar 26, 2009 4:06 PM