Hi,
we are trying to create instances of columns, slabs, beams, piles, etc. programmatically with the help of the Bentley.Building.Api.
So far i successfully created walls with TFLoadableWallList. There is also an c# example for TFLoadableSlabList shipped with the SDK.The documentation hints that with a TFLoadableList I should be able to create other types of objects than walls and slabs:
"TFloadable stands for anything that can be "loaded" from a catalog. Basically if there's a placement tool that allows you to place an item from a catalog, there might be a loadable for these items. the workflow to place a loadable goes as following:
1. pick a TFCatalogItem 2. initialize loadable with the picked catalog item 3. fill in other item-specific geometry data (endpoints for wall, origin for cells, brep for slabs) 4. place the item (_getElmDscr)"
Somehow I am struggling with picking the TFCatalogItems for anything else than slabs and walls. I have the corresponding catalog items I am looking for present in my model.
TFCatalogList datagroup = new TFCatalogList(); datagroup.Init(""); ITFCatalog catalog = datagroup as ITFCatalog; ITFCatalogTypeList typeList; catalog.GetAllCatalogTypesList(0, out typeList); ITFCatalogItemList itemList; catalog.GetCatalogItemByNames(catalogTypeName, catalogInstanceName, 0, out itemList); // alternative // catalog.GetCatalogItemsByTypeName(catalogTypeName, 0, out itemList);
The same code works for walls.
Can someone clear that up and point me in the right direction (further documentation, etc.)?Is it possible to place beams programmatically?Is it worth looking into more recent updates of OBD?
Best,Tilman
Hello Tilman,
Thank you for the response. We have filed an bug so that the developer to have a look at the forum post and that way they can suggest an workflow or workaround. Bug number:792728.
Regards,Alifur
Hi Alifur,thanks for your reply.A small update on the post above: I can successfully pick catalog items (other than slabs and walls) now, but I am still struggling with step 2: "initialize loadable with the picked catalog item"..Best regards,Tilman