Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CONNECT C++] How do I read EC Units Schema data?

$
0
0
<ECClass typeName="YARD" displayLabel="yards" isDomainClass="False"><ECCustomAttributes><Unit_Attributes xmlns="Unit_Attributes.01.00"><Dimension>L</Dimension><UnitSystem>usCustomary</UnitSystem><Label>yards</Label><ShortLabel>yd</ShortLabel><ConversionType>Factor Converter</ConversionType><BaseUnit>METRE</BaseUnit><ConversionFactor>1.0936132983377078</ConversionFactor></Unit_Attributes></ECCustomAttributes></ECClass>

The above EC class for YARD is taken from the Units_Schema.  I can create a C++ ECClass for that fragment, but it has no properties...

ECN::ECSchemaPtr      pSchema;
if (TextPropertyManager::GetUnitsSchema	(pSchema))
{
  ECN::ECClassCP      unitClass  { pSchema->GetClassCP (L"YARD") };
  //    unitClass->GetDisplayLabel ()  == 'yards'
  //	unitClass->GetPropertyCount () == 0

What should I do to obtain the Unit_Attributes sub-elements of that class? For example, I want to know the value of ShortLabel, in this example...

<ShortLabel>yd</ShortLabel>


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>