I'm using the Building Designer SDK, and specifically the BuildingEditElemHandle class, attempting to read/extract Data Group data from previously created parametric cell elements. I create an instance of BuildingEditElemHandle, pass the element descriptor to its ctor, then call GetCatalogCollection(). Calling the HasDataGroupData() function on the returned CCatalogCollection always returns false. Any attempt to access any other data members usually just results in ABD crashing.
Alternatively, I can call different functions to verify and extract XML Fragments from the element. For example, mdlXMLFragmentList_getCount() returns 7, and I can iterate through them. So I know the data is there, but I can't get the Building Designer SDK functions to retrieve the data.
Does anyone have any experience writing code to extract Data Group data from building elements? Am I missing something about how to go about this?
Thank you.
Hi Jay,
seeing you use SS6, why don't you try using the new TFCatalog API?
here's a sample code you can try:
TFCatalogItemList* pCItemList = mdlTFCatalogItemList_construct (); if (TFCatalogItem* pCItem = mdlTFCatalogItemList_getCatalogItem (pCItemList)) { if (BSISUCCESS == mdlTFCatalogItem_initFromElementDescr (pCItem, pElmdscr)) { if (TFPropertyList* pPropertyList = mdlTFCatalogItem_getPropertyList (pCItem)) { for (TFPropertyList* pPropertyNode = pPropertyList; pPropertyNode; pPropertyNode = mdlTFPropertyList_getNext (pPropertyNode)) { if (TFProperty* pProperty = mdlTFPropertyList_getProperty (pPropertyNode)) { //get name TFWString const* pName = mdlTFProperty_getName (pProperty); wchar_t const* pNameChars = mdlTFWString_getPtr (pName); //get display name TFWString const* pDisplayName = mdlTFProperty_getDisplayName (pProperty); wchar_t const* pDisplayNameChars = mdlTFWString_getPtr (pDisplayName); //get value ValueDescr valDescr; mdlTFProperty_getValueDescr (pProperty, &valDescr); } } mdlTFPropertyList_free (&pPropertyList); } } }
after you're done inspecting/editing the values, you may want to call mdlTFCatalogItem_setPropertyList() and mdlTFCatalogItem_attachLinkagesOnElement(), to write the datagroup information back to the element
Thank you for responding, Jonas. I don't have a header file / function declaration file that declares the data structures and functions that your example code uses (TFCatalog API?). As you would expect, the following compiler errors are the result. 'TFCatalogItemList' : undeclared identifier 'mdlTFCatalogItemList_construct': identifier not found 'TFCatalogItem' : undeclared identifier 'mdlTFCatalogItemList_getCatalogItem': identifier not found 'mdlTFCatalogItem_initFromElementDescr': identifier not found 'mdlTFCatalogItem_getPropertyList': identifier not found 'mdlTFCatalogItemList_free': identifier not found Is this TFCatalog API you mention publicly available? If so, where is it?