Finding Master Unit data in VBA without label

I am having some trouble with some VBA code to Insert Cells. The VBA code is not the problem, i have tracked the issue down to the UoRUnits as seen in this thread.

https://communities.bentley.com/products/microstation/f/microstation-forum/187632/text-size-multiplying-automatically---why?ReplySortBy=CreatedDate&ReplySortOrder=Ascending

My problem now is similar but not exactly the same. I am trying to adjust my code to factor in the units of the Default Model. All of these files are exported from AutoCAD to DGN.

The units of the File are in Metres, but there is no label. 

When i try to find the "Metres" values in VBA it shows nothing.

So my question is, how can i find the "Meters" value if there is no label?

Using V8i SS10

Thanks.

Parents
  • how can i find the "Meters" value if there is no label?

    A ModelReference has a MasterUnit property and a SubUnit property.  Each is a MeasurementUnit.

    A MeasurementUnit has a MsdMeasurementSystem and a MsdMeasurementBase that, together, tell what type of units the model has.  The UnitsPerBaseNumerator and the UnitsPerBaseDenominator provide the unit value. The Label aids human comprehension.

    The units of the File are in Metres, but there is no label

    A DWG file has no units.  The absence of a label in MicroStation is the result of importing a DWG without modification.  If you can, review the settings for opening a DWG file.

     
    Regards, Jon Summers
    LA Solutions

  • Thanks for the reply Jon.

    So under what "rules" would MicroStation determine the DGN is Metres? Or is it assumed?

    As i mentioned above, we did not create these files and cannot ask for them to be redone. They have been submitted to us (the client) in pretty poor form. I have been able to fix up the majority of the drawings but some of them throw out my VBA programs to replace border when the units are different so i would like to add a check in place.

    I am just trying to adjust my VBA program to take into account some extra variables.

    I still find it bizarre that a sheet model, not having any reference to the design model is affected by a setting in the working units for the design model. 

Reply
  • Thanks for the reply Jon.

    So under what "rules" would MicroStation determine the DGN is Metres? Or is it assumed?

    As i mentioned above, we did not create these files and cannot ask for them to be redone. They have been submitted to us (the client) in pretty poor form. I have been able to fix up the majority of the drawings but some of them throw out my VBA programs to replace border when the units are different so i would like to add a check in place.

    I am just trying to adjust my VBA program to take into account some extra variables.

    I still find it bizarre that a sheet model, not having any reference to the design model is affected by a setting in the working units for the design model. 

Children