How to draw an ellipse from origin, 2 axis, and rotation angle ?

Discussion in 'Microstation' started by Julien, Nov 15, 2004.

  1. Julien

    Julien Guest

    Hi,

    How can I program the drawing of an ellipse in a macro ?

    Ideally, I want to recover primary and secondary axis,
    as well as orientation (1st axis azimuth) from a text file,
    and this for many error ellipses to draw.

    Of course, I can use MbeSendCommand "PLACE ELLIPSE",
    compute the extremities of primary and secondary axis
    and send them through MbeSendDataPoint.

    However, I'm fast sure there must be some simpler way to solve the problem,
    like:

    Sub DrawEllipse
    Dim ellipse as New MbeElement
    ' ... tell that the element is of type ellipse
    ' ... give origin and orientation of primary axis
    ellipse.primaryAxis = 2.345
    ellipse.secondaryAxis = 1.234
    ' ... optional other statements
    ellipse.display(MBE_NormalDraw)
    ' ...
    End Sub

    I encounter a few problems :

    - The MbeElement.type property is read only,
    so how to set the type of an element ?

    - How can I set the origin of an element,
    in this case the center of the ellipse ?

    - Should I use MbeElement.rotate
    to define the ellipse orientation
    before drawing it ?

    Thanks for any answer.

    Julien
     
    Julien, Nov 15, 2004
    #1
  2. Inga Morozoff [Bentley], Nov 15, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.