当前位置:首页 >> 机械/仪表 >>

arx函数集合


void

drawline(AcGePoint3d

startPt,AcGePoint3d

endPt,const

ACHAR

*linetype,int

c,AcDb::LineWeight ww)//画直线 { AcDbLine *pLine =

new AcDbLine(startPt, endPt); //构建直线类(AcDbLine)的对象 AcDbBlockTable *pBlockTable; //指向块表的指针 acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead); //将指针指向当前数据库中的块表 AcDbBlockTableRecord *pBlockTableRecord; //指向块表记录的指针 //将块表记录的指针指向当前块表的模型空间记录 pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close(); //关闭块表 AcDbObjectId lineId; //直线 ID pBlockTableRecord->appendAcDbEntity(lineId, pLine); //将指向添加到块表记录 //属性设置------------------------------------------------------------------pLine->setLinetype(linetype); pLine->setLinetypeScale(0.6,1); pLine->setLineWeight(ww); pLine->setColorIndex(c); pBlockTableRecord->close(); //关闭块表记录 pLine->close(); } void createArc( AcGePoint3d centerPt,double r,double bA,double eA,const ACHAR *linetype,int c,AcDb::LineWeight ww) { AcDbArc *pArc = new AcDbArc(centerPt,r,bA,eA); AcDbBlockTable *pBlockTable; //指向块表的指针 acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead); //将指针指向当前数据库中的块表

AcDbBlockTableRecord *pBlockTableRecord; //指向块表记录的指针 //将块表记录的指针指向当前块表的模型空间记录 pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close(); //关闭块表 AcDbObjectId arcId; //圆弧 ID pBlockTableRecord->appendAcDbEntity(arcId, pArc); //添加到块表记录 //属性设置--------------------------------------------------------pArc->setLinetype(linetype); pArc->setLinetypeScale(0.6,1); pArc->setLineWeight(ww); pArc->setColorIndex(c);

pBlockTableRecord->close(); //关闭块表记录 pArc->close(); } void createspLine(AcGePoint3dArray points,int order,double jd,const ACHAR *linetype,int c,AcDb::LineWeight ww) { AcDbSpline *pLine = new AcDbSpline(points, order, jd); AcDbBlockTable *pBlockTable; //指向块表的指针 acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead); //将指针指向当前数据库中的块表 AcDbBlockTableRecord *pBlockTableRecord; //指向块表记录的指针 //将块表记录的指针指向当前块表的模型空间记录 pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close(); //关闭块表

AcDbObjectId spLineId; //样线 pBlockTableRecord->appendAcDbEntity(spLineId, pLine); //添加到块表记录 //属性设置--------------------------------------------------------pLine->setLinetype(linetype); pLine->setLinetypeScale(0.6,1); pLine->setLineWeight(ww); pLine->setColorIndex(c);

pBlockTableRecord->close(); //关闭块表记录 pLine->close(); } void createText(AcGePoint3d pt1,const ACHAR *zhi,AcDbObjectId style,double h,double xzj) { AcDbText *pText = new AcDbText(pt1, zhi, style, h,xzj); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId zhiId; pBlockTableRecord->appendAcDbEntity(zhiId, pText); pBlockTable->close(); pBlockTableRecord->close(); pText->close(); } void createAlignedDim(AcGePoint3d pt1,AcGePoint3d pt2,AcGePoint3d pt3)//直线尺寸标注 { const ACHAR *a=NULL; AcDbObjectId style = AcDbObjectId::kNull;

AcDbAlignedDimension *pDim = new AcDbAlignedDimension(pt1, pt2, pt3,a,style); pDim->setColorIndex(1); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId biaoID; pBlockTableRecord->appendAcDbEntity(biaoID, pDim); pBlockTable->close(); pBlockTableRecord->close(); pDim->close(); }

void createDiaDim(AcGePoint3d pt,double l,double d)//直径尺寸标注 { const ACHAR *zheshicicun=NULL; AcDbObjectId dimStyle = AcDbObjectId::kNull; ads_point pt2, pt3; pt2[X] = pt.x; pt2[Y] = pt.y; pt2[Z] = pt.z; double pi=3.1415926,gel; AcGeVector2d pt4(pt.x,pt.y); gel=pt4.angle(); acutPolar(pt2, pi+gel, d, pt3);o AcGePoint3d pt1=asPnt3d(pt3); AcDbDiametricDimension *pDim = new AcDbDiametricDimension(pt,pt1, l, zheshicicun,

dimStyle); pDim->setColorIndex(1); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId biaoID; pBlockTableRecord->appendAcDbEntity(biaoID, pDim); pBlockTable->close(); pBlockTableRecord->close(); pDim->close(); } //定义粗糙度标注符号--------------------------void createRoughness1 (AcGePoint3d pt,const ACHAR *zhi) { double pi=3.1415926; AcGePoint3d pt1=biandian(pt,-1.5,3*cos(30*pi/180)); AcGePoint3d pt2=biandian(pt,1.5,3*cos(30*pi/180)); AcGePoint3d pt3=biandian(pt2,5*cos(60*pi/180),5*sin(60*pi/180)); AcGePoint3d pt4=biandian(pt1,-3.5,1); huazixian(pt,pt1,NULL,1,AcDb::kLnWt000); huazixian(pt1,pt2,NULL,1,AcDb::kLnWt000); huazixian(pt,pt2,NULL,1,AcDb::kLnWt000); huazixian(pt2,pt3,NULL,1,AcDb::kLnWt000); wenzhi(pt4,zhi,NULL,2.5,0);

} void createRoughness2(AcGePoint3d pt,const ACHAR *zhi) { double pi=3.1415926; AcGePoint3d pt1=biandian(pt,3*cos(30*pi/180),1.5); AcGePoint3d pt2=biandian(pt,3*cos(30*pi/180),-1.5); AcGePoint3d pt3=biandian(pt2,5*cos(30*pi/180),-5*sin(30*pi/180));

AcGePoint3d pt4=biandian(pt1,1,1.8); huazixian(pt,pt1,NULL,1,AcDb::kLnWt000); huazixian(pt1,pt2,NULL,1,AcDb::kLnWt000); huazixian(pt,pt2,NULL,1,AcDb::kLnWt000); huazixian(pt2,pt3,NULL,1,AcDb::kLnWt000); double u=-pi*90/180; wenzhi(pt4,zhi,NULL,2.5,u); } ///////////////////////////// void CreateHatch(AcDbObjectIdArray objIds,const ACHAR* patName, bool bAssociative)//剖面线 { Acad::ErrorStatus es; AcDbHatch *pHatch = new AcDbHatch(); // 设置填充平面 AcGeVector3d normal(0, 0, 1); pHatch->setNormal(normal); pHatch->setElevation(0); pHatch->setAssociative(bAssociative); // 设置填充图案 pHatch->setPattern(AcDbHatch::kPreDefined, patName); // 添加填充边界 es = pHatch->appendLoop(AcDbHatch::kExternal, objIds); // 显示填充对象 es = pHatch->evaluateHatch(); // 添加到模型空间 AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId tianID; pBlockTableRecord->appendAcDbEntity(tianID, pHatch); pBlockTable->close(); pBlockTableRecord->close(); pHatch->close(); }

//加载线型------------------------------------------------------------void loadLineType() { AcDbLinetypeTable *pLinetypeTbl; AcDbObjectId lineTypeId; acdbHostApplicationServices()->workingDatabase()->getLinetypeTable(pLinetypeTbl,AcDb::k ForRead); const ACHAR *lyName = _T("DASHED"); if ((pLinetypeTbl->getAt(lyName,lineTypeId))!=Acad::eOk); { pLinetypeTbl->close(); acdbHostApplicationServices()->workingDatabase()->loadLineTypeFile(lyName,_T("acadiso.li n")); } lyName = _T("CENTER2"); if ((pLinetypeTbl->getAt(lyName,lineTypeId))!=Acad::eOk); { pLinetypeTbl->close(); acdbHostApplicationServices()->workingDatabase()->loadLineTypeFile(lyName,_T("acadiso.li n")); } lyName = _T("DOT"); if ((pLinetypeTbl->getAt(lyName,lineTypeId))!=Acad::eOk); { pLinetypeTbl->close(); acdbHostApplicationServices()->workingDatabase()->loadLineTypeFile(lyName,_T("acadiso.li n")); } pLinetypeTbl->close(); }

void createTolerance(AcGePoint3d tian)//标注公差 { AcGePoint3d tian1=biandian(tian,15,-10); AcGePoint3d tian2=biandian(tian1,8,0); AcGePoint3d dian=tian2; huazixian(tian, tian1,NULL,1,AcDb::kLnWt000); huazixian(tian1, tian2,NULL,1,AcDb::kLnWt000); AcGePoint3d dian1=biandian(dian,3,0); AcGePoint3d dian2=biandian(dian,12,0); AcGePoint3d dian3=biandian(dian,15,0); AcGePoint3d dian4=biandian(dian,0,4); AcGePoint3d dian5=biandian(dian,3,4); AcGePoint3d dian6=biandian(dian,12,4); AcGePoint3d dian7=biandian(dian,15,4); huazixian(dian, dian3,NULL,1,AcDb::kLnWt000); huazixian(dian4, dian7,NULL,1,AcDb::kLnWt000); huazixian(dian, dian4,NULL,1,AcDb::kLnWt000); huazixian(dian5, dian1,NULL,1,AcDb::kLnWt000); huazixian(dian6, dian2,NULL,1,AcDb::kLnWt000); huazixian(dian7, dian3,NULL,1,AcDb::kLnWt000); AcGePoint3d dian8=biandian(dian,0.2,0.5); AcGePoint3d dian9=biandian(dian1,0.2,0.5); AcGePoint3d dian10=biandian(dian2,0.2,0.5); double uuu=-25*3.141592/180; wenzhi(dian8,_T("↑"),NULL,3,uuu); wenzhi(dian9,_T("0.03"),NULL,2.5,0); wenzhi(dian10,_T("A"),NULL,2.5,0); } //基准-------------------------void createDatum(AcGePoint3d dian1)//标注基准 { AcGePoint3d dian2=biandian(dian1,15,0); AcGePoint3d dian3=biandian(dian2,-6,-2); AcGePoint3d dian4=biandian(dian2,0,-2); AcGePoint3d dian5=biandian(dian4,-3,0); AcGePoint3d dian6=biandian(dian5,0,-5); AcGePoint3d dian7=biandian(dian6,0,-3); AcGePoint3d dian8=biandian(dian7,-1,-1); huazixian(dian1, dian2,NULL,1,AcDb::kLnWt000); huazixian(dian3, dian4,NULL,0,AcDb::kLnWt040); huazixian(dian5, dian6,NULL,0,AcDb::kLnWt000);

createArc(dian7,3,0,6.28318,NULL,0,AcDb::kLnWt000); wenzhi(dian8,_T("A"),NULL,2.5,0); }


相关文章:
arx函数集合
arx函数集合_机械/仪表_工程科技_专业资料。arx函数集合,有一定参考价值 void drawline(AcGePoint3d startPt,AcGePoint3d endPt,const ACHAR *linetype,int c,...
arx 常用函数功能表
即按下了 ESC 键 AutoCAD 拒绝一无效的要求 AutoLISP 连接失败 用户输入一个关键字或任意文本 (并不是全部 ARX 函数都如此,有特殊的函数返回值不同(会有 RT...
arx函数
arx函数_计算机软件及应用_IT/计算机_专业资料。arx 常用的一些函数功能表 ADS 原函数 ARX 后函数 函数功能 ads_agetcfg ads_agetenv ads_alert ads_angle ads...
Object Arx实用函数收集汇总
Object Arx实用函数收集汇总_IT/计算机_专业资料。精心收集的Auto CAD二次开发技术...nIDs 对象标识符集合 //*** 变量类型:const char...
arx常用的一些交互函数(ads)
arx常用的一些交互函数(ads)_IT/计算机_专业资料。这里是ObjectARX开发中的ads函数...表二元数据 }; 用于处理二元扩展数据(xdata),这些数据可组成不同长度的集合块...
objectARX 常用功能实现集合
objectARX 常用功能实现集合_IT/计算机_专业资料。objectARX 常用功能实现集合 ...在 AutoCAD 中打开图形,并且显示在图形窗口中,可以使用 acedSyncFileOpen()函数...
ARX函数
ARX函数_建筑/土木_工程科技_专业资料。ARX函数今日推荐 67份文档 九...arx函数集合 9页 1下载券 Object Arx实用函数收集... 65页 1下载券 arx常用...
objectARX说明函数
objectARX说明函数_计算机软件及应用_IT/计算机_专业资料 暂无评价|0人阅读|0次下载|举报文档 objectARX说明函数_计算机软件及应用_IT/计算机_专业资料。...
autocad_ARX程序设计。几何算法、配置环境、常用函数、命令添加等
autocad_ARX程序设计。几何算法、配置环境、常用函数、命令添加等_计算机软件及应用_IT/计算机_专业资料。计算几何算法概览一、引言 计算机的出现使得很多原本十分繁琐的...
autocad ARX程序设计。几何算法、配置环境、常用函数、命令添加等
autocad ARX程序设计。几何算法、配置环境、常用函数、命令添加等_工学_高等教育_教育专区。autocad ARX程序设计。几何算法、配置环境、常用函数、命令添加等。针对ARX...
更多相关标签:
matlab arx函数 | 集合与函数概念 | 集合与函数 | 集合函数 | 集合与函数概念知识点 | 高中数学集合与函数 | 集合的特征函数 | 高一集合与函数测试题 |