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

RE: How can i get the element information of an element which used for fence boundary?

$
0
0

Please follow the MicroStation Programming forum best practices.

Identify Your Platform

Please identify the version of MicroStation, or other product such as PowerDraft, that you are using: MicroStation CONNECT or MicroStation V8i. What is the 8-digit version number (e.g. 10.xx.yy.zz) of MicroStation?

The APIs supplied with MicroStation CONNECT are different to those supplied with MicroStation V8i. Consequently, our answers are likely to be different.

Code Syntax Highlighting

When you post code, use the Forum advanced editor's syntax highlighting tool. That's the icon that resembles a pencil:  Syntax Highlighter

Dimensionality

Is your DGN model 2D or 3D?  That makes a big difference to your algorithm design.

Point in Shape

First, write a command class that Implements ILocateCommandEvents.  In your class _Start event method, set the LocateCriteria to reject all elements except

shape elements.  There are examples in VBA help.

One solution to your question might be to set MicroStation's LocateTolerance temporarily to as large as the largest shape you want to identify.  A crude but possibly useful way to go.

If you really want to implement point-inside-polygon selection, then you'll have to be imaginative because MicroStation doesn't directly support that idiom.  Here is a couple of suggestions...

  1. Build a list of shapes in the DGN model
    1. Use Element.Range to eliminate shapes that can't possibly contain your point
    2. Examine the remaining shapes to see if Point3dInPolygonXY is true

  2. Use VBA's GetFloodBoundary around the current point
    1. Compare the boundary element created with the nearest shape


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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