assign a point variable to a specific point

I want to assign a point variable to a specific point - here is the point cooridinates:

The colon I am not sure what to do with it.

How do I assign this in VBA?

Dim myPoint As Point3d
myPoint.X = "120127:1.59600"
myPoint.Y = "119952:3.37943"
myPoint.Z = 0

Thanks,

Paul

Parents Reply Children
  • I am testing self referencing (reference the sheet model to the design model and visa versa). I wanted to use a known test point.
  • Hi Paul,

    Unknown said:
    I am testing self referencing

    I have to say I still don't understand completely how self referencing testing depends on what is displayed in Element Information dialog.

    When working with VBA, all coordinates are expressed as Point3D and decimal numbers, independently if they are displayed in feet and inches or meters. And I guess all possible information about coordinates are accessible using VBA API. Or does the point belongs to element that is not accessible by a standard way?

    Can you access the element e.g. using selection set? It's easy to work with selected elements from VBA and you don't have to take care about formating.

    Another question is how do you access the information displayed in Element Information dialog? Using Property Handler? If yes (I guess there is no other way how to do it), what will happen if you will try to use GetValueAsPoint3d method? I have never used it, but it looks like what you need.

    With regards,

      Jan

  • Jan,
    When I reference attach the design model to the active sheet model it comes in way off.
    I placed a point where it should come in and wanted to use that point in this line of code:
    omod2.Attachments.Add ActiveDesignFile.FullName, omod1.Name, omod1.Type, "test", Point3dZero, point1, True

    "point1" is the test point.
  • Hi Paul,

    ok, and where the point1 comes from?

    • If it exists in a design file, you should access it using MicroStation VBA API, so you will receive Point3d automatically. No reason for conversion.
      Because you did not write any information what your "point" in the design file is, it's hard to recommend what VBA function to use.
      This is standard and preferred way.
    • If you, from any reason, really want to access the values displayed in Element information dialog, you have to use PropertyHandler and I think you can try GetValueAsPoint3d method.
    • If you want to enter it as fixed value in your code, you have to convert feet:inches format to decimal feet value yourself.

    But I guess it doesn't work neither, because reference point has to be express, accordingly to MicroStation VBA help, in UORs, not in master units. So you have to add another conversion from (master units) Point3d to (UOR) Point3d value. There is UORsPerMasterUnit property available that makes the conversion possible.

    With regards,

      Jan