Hi All,
I got a file from my customer which they are using Bentley Building product to design. I want to edit the geometry but I can't because these geometries are attached a TriForma Dependency Linkage which prevent me to edit them. I know TFREMOVE command in Bentley building product can do this but I haven't these products. So I want to remove these linkages by my program. I coded the following program but it can't do this.
MSElementDescrP edP = NULL;mdlElmdscr_read (&edP, elemAddr[i], ACTIVEMODEL, FALSE, NULL);if (SUCCESS == mdlDependency_getLinkage (NULL, 0, &edP->el, 48640, 0)){ int status2; mdlElement_memcpy (&el, &edP->el); status2 = mdlDependency_deleteLinkage (&el, 48640, 0); // returning 1 indicates success status2 = mdlElmdscr_replaceElement (&edP, &el); status2 = mdlElmdscr_rewrite (edP, NULL, elemAddr[i]);}mdlElmdscr_freeAll (&edP); I noticed that the Required app=1 in this Linkage. Does it mean I can't delete it without TriForma application loaded ?
MSElementDescrP edP = NULL;mdlElmdscr_read (&edP, elemAddr[i], ACTIVEMODEL, FALSE, NULL);if (SUCCESS == mdlDependency_getLinkage (NULL, 0, &edP->el, 48640, 0)){ int status2; mdlElement_memcpy (&el, &edP->el); status2 = mdlDependency_deleteLinkage (&el, 48640, 0); // returning 1 indicates success status2 = mdlElmdscr_replaceElement (&edP, &el); status2 = mdlElmdscr_rewrite (edP, NULL, elemAddr[i]);}mdlElmdscr_freeAll (&edP);
Attached DGN is a test dgn which only includes on solid with TriForma dependency linkage.
Any help are appreicated !
Xue
This Triforma dependency will allow you to delete the element (Delete allow w/o app: 1). Extract the geometry to create a brand new element without any Triforma defpendencies, add the new element to the file and then delete the Triforma solid, don't try to rewrite...
HTH
-B
Thanks all ! mdlDependency_setIgnoreMissingCallbacks is what I want.