MicroStation [CE/C#] ElementPropertiesGetter: Weight Result for a Textelement is 0 (not ByLevel)

Hello,

my code is the following:

uint? WT = new uint();
Bentley.DgnPlatformNET.ElementPropertiesGetter propGet = new Bentley.DgnPlatformNET.ElementPropertiesGetter(Element);
WT = propGet.Weight;

and the result is 0 ,although the weight is bylevel?

Does somebody has any idea?

Best regards 

Axel

Parents Reply
  • You have declared WT as as an un-signed "int". Wouldn't it need to be a "signed" int?

    A thoughtful conjecture, but the MstnPlatformNet tells us …

    public uint Weight { get; }
    
    Historically when element property is "by level", -1 is returned

    But that doesn't work with a uint.  So how do we find if a property is by level?

    There's a Weight structure that has a ByLevel field.  The Weight struct has an Explicit operator that creates a Weight from an int or uint.  I don't know if that would automatically fill the ByLevel field. 

    Unfortunately, there's no example and MstnPlatformNet documentation is terse.

     
    Regards, Jon Summers
    LA Solutions

Children