我是个二次开发的新手,C# 中想通过调用API 创建一个孔洞对象,我找到了
STFHoleListClass stfHoleListClass=new STFHoleListClass(); STFHole stfHole = stfHoleListClass.AsSTFHole;
但好象在New 的时候就报错了,想请教下各位老师应该怎么做?
请指明您所用的软件名称和版本(Bentley公司有数百款软件呢)。看您的代码,似乎是在ABD的Structural还是Architectural模块中工作?
ABD的C#接口目前没有公开,也没有任何资料可参考。但ABD有SDK(需要BDN用户才能下载)中有C/C++接口可实现墙体开洞。实例代码如下:
void addOpeningToWall (void) { ElementID wallId = 7977, shapeId = 10868; MSElementDescr *shapeEdP = NULL; TFBrepList *pBrepList = NULL; TFFormRecipeList *pFormList = NULL; TFFormRecipe *pForm = NULL; mdlTFModelRef_readFormRecipeListToMasterById (ACTIVEMODEL, &pFormList, wallId); pForm = mdlTFFormRecipeList_getFormRecipe (pFormList); mdlAssoc_getElementDescr (&shapeEdP, NULL, shapeId, ACTIVEMODEL, FALSE); mdlTFBrepList_constructFromElmdscr2(&pBrepList, shapeEdP, ACTIVEMODEL); mdlElmdscr_freeAll (&shapeEdP); mdlTFFormRecipe_addOpeningByBrepNode (pForm, NULL, L"OPENING_1", &pBrepList, 0, TRUE, NULL); mdlTFFormRecipe_synchronize (pForm); mdlTFModelRef_rewriteFormRecipe (ACTIVEMODEL, pForm); mdlTFFormRecipeList_free (&pFormList); }
Answer Verified By: yan liu