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

RE: [CONNECT C++] How do I measure dimensional properties?

$
0
0

Hello Jon,

I think using EC technology is another way to obtain these information. The following code snippet is a test example for you.

void getElemInfoTest()
    {
    DgnECManagerR ecMan = DgnECManager::GetManager();
    DgnFileP   pDgnFile = ISessionMgr::GetActiveDgnFile();
    SchemaInfo schemaInfo(ECN::SchemaKey(L"DgnElementSchema", 1, 0), *pDgnFile);
    ECN::ECSchemaPtr pSchema = ecMan.LocateSchemaInDgnFile(schemaInfo, ECN::SchemaMatchType::SCHEMAMATCHTYPE_LatestCompatible);
    if (pSchema == NULL)
        {
        mdlDialog_dmsgsPrint(L"Can't get the schema");
        return;
        }
    ECN::ECClassCR   ecClass = *pSchema->GetClassCP(L"ShapeElement");

    ElementId  elemId = 6559;  // A shape element id
    ElementHandle elem(elemId, ISessionMgr::GetActiveDgnModelP());
    if (!elem.IsValid())
        {
        mdlDialog_dmsgsPrint(L"Can't find the specified shape element");
        return;
        }
    DgnElementECInstancePtr pElemInst = ecMan.FindInstanceOnElement(elem, ecClass);
    WString valStr;
    pElemInst->GetValueAsString(valStr, L"Count", false, 0);
    mdlDialog_dmsgsPrint(valStr.GetWCharCP());
    }


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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