기본 콘텐츠로 건너뛰기

1월, 2017의 게시물 표시

MDL에서 VBA 매크로 실행

프로젝트를 로딩후 , (프로젝트 이름,모듈 이름,매크로 이름)를 인자로 주어 매크로를 실행합니다. mdlVBA_unloadProject ("DropIt"); if (SUCCESS == mdlVBA_loadProject( "DropIt" )) { if(SUCCESS != mdlVBA_runMacro ("DropIt","Module1","Start")) { mdlVBA_reportCurrentError (); } }

shared cell의 속성 변경

shared cell의 속성(Level,Color,Style)을 변경하려면 shared cell 자체의 속성을 변경하는 것 뿐만 아니라 shared cell이 가리키는 원본의 속성도 같이 변경해야 원하는 결과를 얻을 수 있습니다. if (SUCCESS == mdlSharedCell_getDefinitionId(&m_uniqueId,&(element->el))) { return ERROR_SUCCESS; } 원본의 ID를 구한 뒤 원본의 속성을 변경하면 됩니다. UInt32 filePosP = 0 ; if (SUCCESS == mdlAssoc_getElement( NULL , &filePosP , m_uniqueId , MASTERFILE)) { MSElementDescr *pDescr = NULL; DgnModelRefP modelRef=NULL; if ( mdlElmdscr_read (&pDescr, filePosP , modelRef , FALSE , NULL) != 0) { UInt32 *pColor = NULL,*pWeight = NULL; Int32* pStyle = NULL; if(-1 != (Int32)oSymbology .color ) pColor = &oSymbology .color ; if(-1 != (Int32)oSymbology .style ) pStyle = &oSymbology .style ; if(-1 != (Int32)oSymbology .weight ) pWeight = &oSymbology .weight ; mdlElmdscr_setSymbology(pDescr ,pColor,pStyle,pWeight,NULL); mdlElmdscr_rewrite(pDescr,pDescr,filePosP); mdl