Visual Basic - ActiveModelReference.AddElement - question about the global origin vs the UCS

When I use this command, the element is placed relative to the global origin.

 

How do I use this command and have it place the element in relation to the UCS?

 

Thanks

Parents
  • MicroStation VBA provides an ACSManager to provide interaction with the current ACS/UCS coordinate system. The MicroStation VBA help provides a sample of using the ACSManager titled: "Transform to and from ACS" and another example showing how to extract the origin can be found under the topic titled: "Rotating Elements", Example 5.

    A quick and accurate way to explore the VBA object model for any conceptual concepts is to use these key strokes: Alt+F11 (Open VBA Editor, F2 (Open Object browser and perform a keyword search), Click on an item of interest in the Object Browser to provide context, then click: F1 (Open help for the item of interest). Note: When using the help topics, check to see if an "Example" hyperlink is available to provide you a convenient way to jump to some sample code on a given topic.

    HTH,
    Bob



  • Hi Bob and thanks fo responding. I used the ACSManager like this:

    ACSManager.DefineACS NewOrigin, NewAngle, msdACSTypeRectangular

    This moved the ACS graphic on the screen.
    But when the progam looped back to the point routine that calculates th points to place the next graphic, it ignored the new ACS and placed the new object at the old 0,0,0 point. It's like it does not know the ACS was moved.

    This is the code for adding the graphic.
    Set line = Application.CreateLineElement1(Nothing, Points)
    ActiveModelReference.AddElement line
    Is something missing in this code that should refer to the new ACS?
  • Hi Manslick,

    did you study Transform to and from ACS example mentioned by Bob?

    In VBA API, methods like AddElement always work with global coordinate system and they are not aware of ACSManager setting. If you want to create an element in ACS coordinates, you have to converts its coordinates into global system before AddElement methods is used. This is your responsibility, how to do it is demonstrated at the mentioned example.

    With regards,

      Jan

  • Hi Jan, I was not able to see the examples. For unknown reasons those links do not work on my system.
    But I was afraid I would get the answer you just gave. Now I know what to do.
    Thank you.
Reply Children