明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1278|回复: 0

有资求助!

[复制链接]
发表于 2004-6-6 11:29:00 | 显示全部楼层 |阅读模式
本人要在CAD里面弄一个画缓和曲线的ARX程序,源代码已经有了。但是对于ARX及VC++不了解,所以想请哪为高手帮忙!最好是已经编译好的了。谢谢!

AcDbObjectId CreateArc(AcGePoint3d center,double r,double starangle,double endangle)

AcDbArc * Parc = new AcDbArc (center,r,starangle,endangle);

AcDbBlockTable * pBlockTable;

AcdbHostApplicationServices() - > workingDatabase() - > getSymbolTable(pBlockTable, AcDb::kForRead);

AcDbBlockTableRecord* pBockTableRecord;

pBlockTable- > getAt(ACDB_MODEL_SPACE, pBockTableRecord,AcDb:: kForWrite);

pBlockTable- >close();

AcDbObjectId ArcID;

pBockTableRecord- >appendAcDbEntity(ArcID,pArc);

pBockTableRecord- > close();

pArc- > close();

Return ArcID;

SPLINE线模拟缓和曲线:ObjectARX系统中,系统向二次开发程序员提供了类AcDbSpline,利用AcDbSpline可以较好地模拟缓和曲线。

首先根据工程设计的精度要求,确定在缓和曲线上没间隔多少距离计算一个加点才能模拟缓和曲线,利用式(2)将加点计算后存放在数组类AcGePoint3dArray points中,然后生成SPLINE线:

AcDbObjectId CreateSPLINEAcGePoint3dArray points

AcDbSpline * pSpline = new AcDbSpline(Points,4,0.0);

AcDbBlockTable * pBlockTable;

AcdbHostApplicationServices() - > workingDatabase() - > getSymbolTable(pBlockTable, AcDb::kForRead);

AcDbBlockTableRecord* pBockTableRecord;

pBlockTable- > getAt(ACDB_MODEL_SPACE, pBockTableRecord,AcDb:: kForWrite);

pBlockTable- >close();

AcDbObjectId SplineId;

pBockTableRecord- >appendAcDbEntity(ArcId,pArc);

pBockTableRecord- > close();

pArc- > close();

Return SplineId;

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 06:27 , Processed in 0.140340 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表