Hello,
I need to place Architectural elements in Open Buildings Designer U9.
As I see, the easiest approach would be to use the so called "Para-Def-Loadables" From the tfapi shipped with the OBDSDK.
In the following code, the Query functions "mdlTFLoadable_getIsCatalogTypeApplicableAsLoadableType" and "mdlTFCatalogType_implementsParaDef" return "true" but no "Loadable is generated.
Catalogtype and Item were found correctly.
WString catalogTypeName = L"Ladders"; WString caltalogItemName = L"Leiter"; //DE //WString caltalogItemName = L"Ladder"; //US StatusInt statusInt; TFApplication* tfAppP = mdlTFApplicationClass_getSingleTon(); //Success if (!tfAppP) return; TFCatalogList* catalogListP = mdlTFCatalogList_construct(); //Success TFCatalog* catalogP = mdlTFCatalogList_getCatalog(catalogListP); //Success TFCatalogTypeList* catTypes = mdlTFCatalog_getCatalogType(catalogP, (WCharP)catalogTypeName.c_str()); //Success TFCatalogType* catType = mdlTFCatalogTypeList_getCatalogType(catTypes); //Success bool isLoadable = mdlTFLoadable_getIsCatalogTypeApplicableAsLoadableType(catType, LoadableTypeEnum::LoadableTypeEnum_ParaDef);//true isLoadable = mdlTFApplication_LoadableGetIsCatalogTypeApplicableAsLoadableType(tfAppP, catType, LoadableTypeEnum::LoadableTypeEnum_ParaDef);//true TFCatalogItemList* catalogItemListP = mdlTFCatalog_getCatalogItemByNames(catalogP, (WCharP)catalogTypeName.c_str(), (WCharP)caltalogItemName.c_str()); //Success if (!catalogItemListP)return; TFCatalogItem* catalogItemP = mdlTFCatalogItemList_getCatalogItem(catalogItemListP); //Success if (!catalogItemP)return; bool implementsParaDef = mdlTFCatalogType_implementsParaDef(catType);//true MSElementDescrP elmdscrP; TFLoadable* loadable = nullptr; statusInt = mdlTFLoadable_initFromCatalogItem(loadable, LoadableTypeEnum::LoadableTypeEnum_ParaDef, catalogItemListP); //BSIERROR if (!loadable) return; mdlTFLoadable_getElmDscr(loadable, &elmdscrP); mdlElmdscr_add(elmdscrP);
Has anybody an idea what I'm missing? Or is everything correct and a Bug is the reason.
Thanks for any hints.
Greetings
Manuel Höger
Hi Manuel,
Thank you for raising this issue. I am discussing this issue with our development team and will update you with some feedback.
Regards,
Shivam Soni
Hi,
Thank you for answering.
Looking forward to your feedback.
I have discussed this issue with our DEV teams and they confirm it's a bug. Can you please raise a Service request so that I can attach a bug to your SR number?
Creating a new Service Request (Technical Support) Access Service Request Manager as described here . Below describes how to log a new technical, product-related Service Request using Technical Support tile; other categories/forms follow the same design… Last edited 3 months ago in Licensing, Cloud and Web Services > Licensing, Cloud and Web Services Wiki
as Shivam mentioned placing Para-def loadables directly from mdlTFLoadable API is not supported at the moment and unfortunately the architectural header is not delivered as well.
However, as with structural elements, these functions are exported and can still be used. Keep in mind that you'll need to link with atfc.lib in the mke file to make this work.
#include <tfapi\mdltfloadable.fdf> typedef void ATFLoadable; typedef void ATFLoadableList; extern "C" { TFAPI_EXPOSE ATFLoadableList* mdlATFLoadableList_construct ( ); TFAPI_EXPOSE StatusInt mdlATFLoadable_initFromDatagroupNameAndType ( ATFLoadable* pThis, LoadableTypeEnum archType, WChar* pDatagroupName, WChar* pCatalogItemName ); TFAPI_EXPOSE ATFLoadable* mdlATFLoadableList_getLoadable ( ATFLoadableList* pThis ); TFAPI_EXPOSE StatusInt mdlATFLoadableList_free ( ATFLoadableList** ppThis ); }
Then you can use this code to place the elements (please ignore the memory leaks)
if (auto atfLoadable = mdlATFLoadableList_construct()) //needs free { mdlATFLoadable_initFromDatagroupNameAndType(mdlATFLoadableList_getLoadable(atfLoadable), LoadableTypeEnum::LoadableTypeEnum_ParaDef, L"Ladders", L"Ladder"); MSElementDescr* pED = nullptr; //needs free mdlTFLoadable_getElmDscrWritten((TFLoadable*)mdlATFLoadableList_getLoadable(atfLoadable), &pED, mdlModelRef_getActive()); }
Answer Verified By: Manuel Höger