Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

Re: [V8i C# Addin] Getting Area of a Fence

$
0
0

Hi,

I think you can use this code (not tested):

BCOM.Fence fence = s_comApp.ActiveDesignFile.Fence;
BCOM.Element el = fence.CreateElement();
double area = el.AsShapeElement().Area();

The real code has to be a bit more complex, because CreateElement() doesn't always return shape element (see MicroStation VBA help for details). So I guess depending how the fence was created my code can throw an exception in some cases.

With regards,

 Jan


Viewing all articles
Browse latest Browse all 1677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>