www.mxdraw.com
|
对AutoCAD的Lisp表格数据分解处理类,像这样的格式:(69,“Test”,(244,55,44) ),常用其它语言用Lisp表格数据向VC程序传迭数据,MxStrList用来分析数据使用。
class MxStrList;
MxStrList.h
例如:samplesExApp.sln中的自定义函数中,用来解析函数传过来的参数字符串
bool CMSXCustom::GetFlagBh(IN const MxResbuf* pParam, OUT MxResbuf* pRetData) { CString sCoord = pParam->AtString(0); MxStrList sParam(sCoord); McGePoint3d pt; pt.x = sParam.GetDoubleAt(0); pt.y = sParam.GetDoubleAt(1); CString sAppName = _T("FlagBh"); struct resbuf* pFilter =acutBuildList(RTDXF0, _T("INSERT"), -3,1001,sAppName,RTNONE ); AcDbObjectIdArray aryId; FindEntAtPoint(pt,pFilter,50,aryId); Mx::mcutRelRb(pFilter); if(aryId.isEmpty() ) return false; CString sBh; bool isFindBh = false; for(long i = 0; i < aryId.length();i++) { AcDbObjectId id= aryId[i]; McDbObjectPointer<AcDbBlockReference> spBlk(id,McDb::kForRead); if(spBlk.openStatus() == Mcad::eOk) { spBlk->close(); if(GetFlagBhImp(sBh,id ) ) { isFindBh = true; break; } } } if(isFindBh) { pRetData->AddString(sBh); return true; } else { return false; } }