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
-----------------------------------------------------------------
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.
-----------------------------------------------------------------
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...
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
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