I have to access elements in an active model, using C#. Now as elements are part of model, I found some method with DGN model like
Adding, Updating, and Deleting ElementsCollections and Iterators
|
But unable to find it with DgnModel object.
How to scan through elements of an active model, using C#?
Have code in MDL like below
//--- Scan elements ------------------------------ eofPos = mdlElement_getFilePos (FILEPOS_EOF, NULL); while (filePos<eofPos) { nextPos=mdlElmdscr_read(&edP,filePos,pModelRef,FALSE,&readPos); if(nextPos==0) break; elemType = mdlElement_getType (&edP->el); if(elemType==2) { mdlElement_getProperties(&level, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &edP->el); elemID = (long)mdlElement_getID (&edP->el); index=0; weld = GetElementType(edP); if(weld && index==10) { strcpy(diameter,GetWeldDiameter(elemID)); if(!strcmpi(diameter,"1.25") || !strcmpi(diameter,"1.5") || !strcmpi(diameter,"2") || !strcmpi(diameter,"3") || !strcmpi(diameter,"4") || !strcmpi(diameter,"6") || !strcmpi(diameter,"8") || !strcmpi(diameter,"10") || !strcmpi(diameter,"12") ) { fprintf(fp,"INSERT INTO WELDS (ELEMID, DIAMETER) VALUES ('%ld','%s');\n",elemID,diameter); } } n++; } mdlElmdscr_freeAll (&edP); filePos=nextPos; }
Need to take this to C#.
Thanks for the help in advance.