Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I read out points of Complex elements?

5 views
Skip to first unread message

Harry Stegeman

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
Hello,

I need to read out the points (vertexes) from elements (components?) in
a complex element. How can I do this?

I need the points of ComplexStrings(12) and ComplexShapes(14).
I can only find the begin and endpoints of the components in the
elements, and the closest vertex and segment.

If anyone has some suggestion I would appreciate them.

Harry Stegeman
Holland


Christoph Effkemann

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
You can try the mdl function mdlLinear_extract.

Christoph Effkemann

-----------------------------------------------------------------
You can find the following description in the MDL Reference Manual.

int mdlLinear_extract
( Dpoint3d *points, /* <= vertices */
int *numVerts, /* <= number of vertices */
MSElementUnion *in, /* => linear element */
int filenum /* => 0 for master, 1-72 for reference */
);

Description:
The mdlLinear_extract function extracts an array of coordinates from a
linear element pointed to by in. The coordinates are transformed into the
current coordinate system if one exists.

The numVerts argument is set to the number of vertices in points.
Sufficient memory should be allocated in points to receive MAX_VERTICES
vertices.

Note:
mdlLinear_extract does copy hidden points in a curve element into the
points array. Be aware that the hidden points consist of two points at the
beginning and two points at the end of the curve that are used only as
curve definition data and are not displayed.

Returns:
mdlLinear_extract returns SUCCESS if a valid MicroStation element of type
LINE_ELM, LINE_STRING_ELM, SHAPE_ELM, CONIC_ELM, CURVE_ELM, MULTILINE_ELM
or BSPLINE_POLE_ELM is passed in in. Otherwise, it returns
MDLERR_BADELEMENT.
-----------------------------------------------------------------

H.Stegeman

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
Christoph,

Thank you for you reaction.
Is it possible to call this routine in Microstation Basic?

Do you know a way of extracting coordinates
in MicroStation Basic?

I can't program mdl routines.

Harry Stegeman

Christoph Effkemann wrote...

Ken Baker

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
Here's an example found in the MicroStation help file:

Sub ShowPoints(element as MbeElement)

Dim points() as MbePoint

Dim iPoint as Integer


If element.getPoints(points) = MBE_Success Then

print "Number of Points : " ;UBound(points) - LBound(points) + 1

For iPoint = LBound(points) To UBound(points)

print "x :" ;points(iPoint).x ;" y:" ;points(iPoint).y ;

print " z:" ;points(iPoint).z

Next iPoint

End If

End Sub

Hope it helps.
KB

Simon Wurster

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to H.Stegeman
Hi Harry,
I haven't done this (I've found ways to cheat), but I think you'll need to loop
through each component of the complex element, determine its type, and extract
the coordinates based on its type. Since a complex chain or shape can contain
just about anything (including b-splines and even other complex elements), be
prepared for some heavy-duty coding. And if you need discrete coordinates,
you'll have to check for this too, since the endpoint of a line could be the
begin point of a line string.

About cheating: if you're using the complex shape to create a fence, just get
the complex shape's origin coords and use the PLACE FENCE ELEMENT command on
the origin, rather than trying to get each individual element's endpoints.
HTH,
Simon

0 new messages