天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 151|回复: 0

自创实体类从AcDbCurve派生,实现一些类方法并动态绘制

[复制链接]
  • TA的每日心情
    开心
    昨天 06:36
  • 签到天数: 15 天

    [LV.4]偶尔看看III

    105

    主题

    11

    回帖

    1308

    积分

    管理员

    积分
    1308
    QQ
    发表于 2024-5-4 18:45:13 | 显示全部楼层 |阅读模式
    1. MyCurve.cpp:
    2. #include "StdAfx.h"
    3. #include "MyCurve.h"
    4. #include "actrans.h"
    5. #include "aced.h"
    6. //-----------------------------------------------------------------------------
    7. Adesk::UInt32 CMyCurve::kCurrentVersionNumber =1 ;
    8. //-----------------------------------------------------------------------------
    9. ACRX采用DXF采用DEFINE采用MEMBERS (
    10. CMyCurve, AcDbCurve,
    11. AcDb::kDHL采用CURRENT, AcDb::kMReleaseCurrent,
    12. AcDbProxyEntity::kNoOperation, MYCURVE,
    13. TESTCMYENTITY1APP
    14. |Product Desc: A description for your object
    15. |Company: Your company name
    16. |WEB Address: Your company WEB site address
    17. )
    18. //-----------------------------------------------------------------------------
    19. static double pi()
    20. {
    21. return atan(1.0)*4;
    22. }
    23. CMyCurve::CMyCurve () : AcDbCurve () {
    24. }
    25. CMyCurve::CMyCurve(const AcGePoint3d &ptC,const AcGePoint3d &ptE,int Layer/* =6 */,int num/* =25 */) : AcDbCurve () {
    26. ptCenter=ptC;
    27. ptEnd=ptE;
    28. layers=Layer;
    29. number=num;
    30. AcGePoint2d pt1,pt2;
    31. pt1.x=ptCenter.x;
    32. pt1.y=ptCenter.y;
    33. pt2.x=ptEnd.x;
    34. pt2.y=ptEnd.y;
    35. double radius=pt1.distanceTo(pt2);
    36. AcGePoint3dArray pts;
    37. AcGePoint3d pt;
    38. for (int i=0;i<number*layers;i++)
    39. {
    40. pt.x=ptCenter.x+radius*cos(2*i*pi()/number);
    41. pt.y=ptCenter.y+radius*sin(2*i*pi()/number);
    42. pt.z=ptCenter.z+i*((ptEnd.z-ptCenter.z)/layers)/number;
    43. pts.append(pt);
    44. }
    45. AcDb3dPolyline* p3dPline=new AcDb3dPolyline(k3dSimplePoly,pts);
    46. pCurve=(CMyCurve*)p3dPline;
    47. }
    48. CMyCurve::~CMyCurve () {
    49. delete pCurve;
    50. }
    51. //-----------------------------------------------------------------------------
    52. //----- AcDbObject protocols
    53. //- Dwg Filing protocol
    54. void CMyCurve::reset(const AcGePoint3d &ptLast)
    55. {
    56. pCurve=new CMyCurve(ptCenter,ptLast);
    57. }
    58. AcGePoint3d CMyCurve::getCenterPoint()
    59. {
    60. return ptCenter;
    61. }
    62. void CMyCurve::setCenterPoint(const AcGePoint3d &ptcen)
    63. {
    64. pCurve=new CMyCurve(ptcen,ptEnd);
    65. }
    66. void CMyCurve::setEndPoint(const AcGePoint3d &pten)
    67. {
    68. pCurve=new CMyCurve(ptCenter,pten);
    69. }
    70. Acad::ErrorStatus CMyCurve::dwgOutFields (AcDbDwgFiler *pFiler) const {
    71. assertReadEnabled () ;
    72. //----- Save parent class information first.
    73. Acad::ErrorStatus es =AcDbCurve::dwgOutFields (pFiler) ;
    74. if ( es != Acad::eOk )
    75. return (es) ;
    76. //----- Object version number needs to be saved first
    77. if ( (es =pFiler->writeUInt32 (CMyCurve::kCurrentVersionNumber)) != Acad::eOk )
    78. return (es) ;
    79. //----- Output params
    80. pFiler->writeItem(ptCenter);
    81. pFiler->writeItem(ptEnd);
    82. pFiler->writeItem(layers);
    83. pFiler->writeItem(number);
    84. return (pFiler->filerStatus ()) ;
    85. }
    86. Acad::ErrorStatus CMyCurve::dwgInFields (AcDbDwgFiler *pFiler) {
    87. assertWriteEnabled () ;
    88. //----- Read parent class information first.
    89. Acad::ErrorStatus es =AcDbCurve::dwgInFields (pFiler) ;
    90. if ( es != Acad::eOk )
    91. return (es) ;
    92. //----- Object version number needs to be read first
    93. Adesk::UInt32 version =0 ;
    94. if ( (es =pFiler->readUInt32 (&version)) != Acad::eOk )
    95. return (es) ;
    96. if ( version > CMyCurve::kCurrentVersionNumber )
    97. return (Acad::eMakeMeProxy) ;
    98. //- Uncomment the 2 following lines if your current object implementation cannot
    99. //- support previous version of that object.
    100. //if ( version < CMyCurve::kCurrentVersionNumber )
    101. // return (Acad::eMakeMeProxy) ;
    102. //----- Read params
    103. pFiler->readItem(&ptCenter);
    104. pFiler->readItem(&ptEnd);
    105. pFiler->readItem(&layers);
    106. pFiler->readItem(&number);
    107. return (pFiler->filerStatus ()) ;
    108. }
    109. //-----------------------------------------------------------------------------
    110. //----- AcDbEntity protocols
    111. Adesk::Boolean CMyCurve::subWorldDraw (AcGiWorldDraw *mode) {
    112. assertReadEnabled () ;
    113. acutPrintf(采用T("\nsubworldDraw"));
    114. //------ Returning Adesk::kFalse here will force viewportDraw() call
    115. pCurve->subWorldDraw(mode);
    116. return (Adesk::kFalse) ;
    117. }
    118. void CMyCurve::subViewportDraw (AcGiViewportDraw *mode) {
    119. assertReadEnabled () ;
    120. AcDbCurve::subViewportDraw (mode) ;
    121. }
    122. Adesk::UInt32 CMyCurve::subViewportDrawLogicalFlags (AcGiViewportDraw *vd) {
    123. assertReadEnabled () ;
    124. return (AcDbCurve::subViewportDrawLogicalFlags (vd)) ;
    125. }
    126. Adesk::UInt32 CMyCurve::subSetAttributes (AcGiDrawableTraits *traits) {
    127. assertReadEnabled () ;
    128. return (AcDbCurve::subSetAttributes (traits)) ;
    129. }
    130. //- Osnap points protocol
    131. Acad::ErrorStatus CMyCurve::subGetOsnapPoints (
    132. AcDb::OsnapMode osnapMode,
    133. int gsSelectionMark,
    134. const AcGePoint3d &pickPoint,
    135. const AcGePoint3d &lastPoint,
    136. const AcGeMatrix3d &viewXform,
    137. AcGePoint3dArray &snapPoints,
    138. AcDbIntArray &geomIds) const
    139. {
    140. assertReadEnabled () ;
    141. return (AcDbCurve::subGetOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds)) ;
    142. }
    143. Acad::ErrorStatus CMyCurve::subGetOsnapPoints (
    144. AcDb::OsnapMode osnapMode,
    145. int gsSelectionMark,
    146. const AcGePoint3d &pickPoint,
    147. const AcGePoint3d &lastPoint,
    148. const AcGeMatrix3d &viewXform,
    149. AcGePoint3dArray &snapPoints,
    150. AcDbIntArray &geomIds,
    151. const AcGeMatrix3d &insertionMat) const
    152. {
    153. assertReadEnabled () ;
    154. return (AcDbCurve::subGetOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds, insertionMat)) ;
    155. }
    156. //- Grip points protocol
    157. Acad::ErrorStatus CMyCurve::subGetGripPoints (
    158. AcGePoint3dArray &gripPoints, AcDbIntArray &osnapModes, AcDbIntArray &geomIds
    159. ) const {
    160. assertReadEnabled () ;
    161. //----- This method is never called unless you return eNotImplemented
    162. //----- from the new getGripPoints() method below (which is the default implementation)
    163. return (AcDbCurve::subGetGripPoints (gripPoints, osnapModes, geomIds)) ;
    164. }
    165. Acad::ErrorStatus CMyCurve::subMoveGripPointsAt (const AcDbIntArray &indices, const AcGeVector3d &offset) {
    166. assertWriteEnabled () ;
    167. //----- This method is never called unless you return eNotImplemented
    168. //----- from the new moveGripPointsAt() method below (which is the default implementation)
    169. return (AcDbCurve::subMoveGripPointsAt (indices, offset)) ;
    170. }
    171. Acad::ErrorStatus CMyCurve::subGetGripPoints (
    172. AcDbGripDataPtrArray &grips, const double curViewUnitSize, const int gripSize,
    173. const AcGeVector3d &curViewDir, const int bitflags
    174. ) const {
    175. assertReadEnabled () ;
    176. //----- If you return eNotImplemented here, that will force AutoCAD to call
    177. //----- the older getGripPoints() implementation. The call below may return
    178. //----- eNotImplemented depending of your base class.
    179. return (AcDbCurve::subGetGripPoints (grips, curViewUnitSize, gripSize, curViewDir, bitflags)) ;
    180. }
    181. Acad::ErrorStatus CMyCurve::subMoveGripPointsAt (
    182. const AcDbVoidPtrArray &gripAppData, const AcGeVector3d &offset,
    183. const int bitflags
    184. ) {
    185. assertWriteEnabled () ;
    186. //----- If you return eNotImplemented here, that will force AutoCAD to call
    187. //----- the older getGripPoints() implementation. The call below may return
    188. //----- eNotImplemented depending of your base class.
    189. return (AcDbCurve::subMoveGripPointsAt (gripAppData, offset, bitflags)) ;
    190. }
    191. //-----------------------------------------------------------------------------
    192. //----- AcDbCurve protocols
    193. //- Curve property tests.
    194. Adesk::Boolean CMyCurve::isClosed () const {
    195. assertReadEnabled () ;
    196. return (AcDbCurve::isClosed ()) ;
    197. }
    198. Adesk::Boolean CMyCurve::isPeriodic () const {
    199. assertReadEnabled () ;
    200. return (AcDbCurve::isPeriodic ()) ;
    201. }
    202. //- Get planar and start/end geometric properties.
    203. Acad::ErrorStatus CMyCurve::getStartParam (double &param) const {
    204. assertReadEnabled () ;
    205. return (AcDbCurve::getStartParam (param)) ;
    206. }
    207. Acad::ErrorStatus CMyCurve::getEndParam (double &param) const {
    208. assertReadEnabled () ;
    209. return (AcDbCurve::getEndParam (param)) ;
    210. }
    211. Acad::ErrorStatus CMyCurve::getStartPoint (AcGePoint3d &point) const {
    212. assertReadEnabled () ;
    213. return (AcDbCurve::getStartPoint (point)) ;
    214. }
    215. Acad::ErrorStatus CMyCurve::getEndPoint (AcGePoint3d &point) const {
    216. assertReadEnabled () ;
    217. return (AcDbCurve::getEndPoint (point)) ;
    218. }
    219. //- Conversions to/from parametric/world/distance.
    220. Acad::ErrorStatus CMyCurve::getPointAtParam (double param, AcGePoint3d &point) const {
    221. assertReadEnabled () ;
    222. return (AcDbCurve::getPointAtParam (param, point)) ;
    223. }
    224. Acad::ErrorStatus CMyCurve::getParamAtPoint (const AcGePoint3d &point, double &param) const {
    225. assertReadEnabled () ;
    226. return (AcDbCurve::getParamAtPoint (point, param)) ;
    227. }
    228. Acad::ErrorStatus CMyCurve::getDistAtParam (double param, double &dist) const {
    229. assertReadEnabled () ;
    230. return (AcDbCurve::getDistAtParam (param, dist)) ;
    231. }
    232. Acad::ErrorStatus CMyCurve::getParamAtDist (double dist, double &param) const {
    233. assertReadEnabled () ;
    234. return (AcDbCurve::getParamAtDist (dist, param)) ;
    235. }
    236. Acad::ErrorStatus CMyCurve::getDistAtPoint (const AcGePoint3d &point , double &dist) const {
    237. assertReadEnabled () ;
    238. return (AcDbCurve::getDistAtPoint (point, dist)) ;
    239. }
    240. Acad::ErrorStatus CMyCurve::getPointAtDist (double dist, AcGePoint3d &point) const {
    241. assertReadEnabled () ;
    242. return (AcDbCurve::getPointAtDist (dist, point)) ;
    243. }
    244. //- Derivative information.
    245. Acad::ErrorStatus CMyCurve::getFirstDeriv (double param, AcGeVector3d &firstDeriv) const {
    246. assertReadEnabled () ;
    247. return (AcDbCurve::getFirstDeriv (param, firstDeriv)) ;
    248. }
    249. Acad::ErrorStatus CMyCurve::getFirstDeriv (const AcGePoint3d &point, AcGeVector3d &firstDeriv) const {
    250. assertReadEnabled () ;
    251. return (AcDbCurve::getFirstDeriv (point, firstDeriv)) ;
    252. }
    253. Acad::ErrorStatus CMyCurve::getSecondDeriv (double param, AcGeVector3d &secDeriv) const {
    254. assertReadEnabled () ;
    255. return (AcDbCurve::getSecondDeriv (param, secDeriv)) ;
    256. }
    257. Acad::ErrorStatus CMyCurve::getSecondDeriv (const AcGePoint3d &point, AcGeVector3d &secDeriv) const {
    258. assertReadEnabled () ;
    259. return (AcDbCurve::getSecondDeriv (point, secDeriv)) ;
    260. }
    261. //- Closest point on curve.
    262. Acad::ErrorStatus CMyCurve::getClosestPointTo (const AcGePoint3d &givenPnt, AcGePoint3d &pointOnCurve, Adesk::Boolean extend /*=Adesk::kFalse*/) const {
    263. assertReadEnabled () ;
    264. return (AcDbCurve::getClosestPointTo (givenPnt, pointOnCurve, extend)) ;
    265. }
    266. Acad::ErrorStatus CMyCurve::getClosestPointTo (const AcGePoint3d &givenPnt, const AcGeVector3d &direction, AcGePoint3d &pointOnCurve, Adesk::Boolean extend /*=Adesk::kFalse*/) const {
    267. assertReadEnabled () ;
    268. return (AcDbCurve::getClosestPointTo (givenPnt, direction, pointOnCurve, extend)) ;
    269. }
    270. //- Get a projected copy of the curve.
    271. Acad::ErrorStatus CMyCurve::getOrthoProjectedCurve (const AcGePlane &plane, AcDbCurve *&projCrv) const {
    272. assertReadEnabled () ;
    273. return (AcDbCurve::getOrthoProjectedCurve (plane, projCrv)) ;
    274. }
    275. Acad::ErrorStatus CMyCurve::getProjectedCurve (const AcGePlane &plane, const AcGeVector3d &projDir, AcDbCurve *&projCrv) const {
    276. assertReadEnabled () ;
    277. return (AcDbCurve::getProjectedCurve (plane, projDir, projCrv)) ;
    278. }
    279. //- Get offset, spline and split copies of the curve.
    280. Acad::ErrorStatus CMyCurve::getOffsetCurves (double offsetDist, AcDbVoidPtrArray &offsetCurves) const {
    281. assertReadEnabled () ;
    282. return (AcDbCurve::getOffsetCurves (offsetDist, offsetCurves)) ;
    283. }
    284. Acad::ErrorStatus CMyCurve::getOffsetCurvesGivenPlaneNormal (const AcGeVector3d &normal, double offsetDist, AcDbVoidPtrArray &offsetCurves) const {
    285. assertReadEnabled () ;
    286. return (AcDbCurve::getOffsetCurvesGivenPlaneNormal (normal, offsetDist, offsetCurves)) ;
    287. }
    288. Acad::ErrorStatus CMyCurve::getSpline (AcDbSpline *&spline) const {
    289. assertReadEnabled () ;
    290. return (AcDbCurve::getSpline (spline)) ;
    291. }
    292. Acad::ErrorStatus CMyCurve::getSplitCurves (const AcGeDoubleArray &params, AcDbVoidPtrArray &curveSegments) const {
    293. assertReadEnabled () ;
    294. return (AcDbCurve::getSplitCurves (params, curveSegments)) ;
    295. }
    296. Acad::ErrorStatus CMyCurve::getSplitCurves (const AcGePoint3dArray &points, AcDbVoidPtrArray &curveSegments) const {
    297. assertReadEnabled () ;
    298. return (AcDbCurve::getSplitCurves (points, curveSegments)) ;
    299. }
    300. //- Extend the curve.
    301. Acad::ErrorStatus CMyCurve::extend (double newParam) {
    302. assertReadEnabled () ;
    303. return (AcDbCurve::extend (newParam)) ;
    304. }
    305. Acad::ErrorStatus CMyCurve::extend (Adesk::Boolean extendStart, const AcGePoint3d &toPoint) {
    306. assertReadEnabled () ;
    307. return (AcDbCurve::extend (extendStart, toPoint)) ;
    308. }
    309. //- Area calculation.
    310. Acad::ErrorStatus CMyCurve::getArea (double &area) const {
    311. assertReadEnabled () ;
    312. return (AcDbCurve::getArea (area)) ;
    313. }
    314. MyJig.cpp:
    315. #include "StdAfx.h"
    316. #include "MyJig.h"
    317. #include <math.h>
    318. #include "..\..\cmyentity1\cmyentity1\entity.h"
    319. //-----------------------------------------------------------------------------
    320. CMyJig::CMyJig () : AcEdJig ()
    321. {
    322. m采用pEnt=NULL;
    323. }
    324. CMyJig::~CMyJig () {
    325. }
    326. //-----------------------------------------------------------------------------
    327. static AcDbObjectId AddToModelSpace(AcDbEntity *pEnt)
    328. {
    329. AcDbBlockTable *pBlockTable;
    330. acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead);
    331. AcDbBlockTableRecord *pBlockTableRecord;
    332. pBlockTable->getAt(ACDB采用MODEL采用SPACE, pBlockTableRecord,AcDb::kForWrite);
    333. AcDbObjectId entId;
    334. pBlockTableRecord->appendAcDbEntity(entId, pEnt);
    335. pEnt->close();
    336. pBlockTable->close();
    337. pBlockTableRecord->close();
    338. return entId;
    339. }
    340. static AcDbObjectId AddToCurrentSpace(AcDbEntity *pEnt)
    341. {
    342. AcDbBlockTable *pBlockTable;
    343. AcDbDatabase *pDb=acdbHostApplicationServices()->workingDatabase();
    344. pDb->getBlockTable(pBlockTable, AcDb::kForRead);
    345. AcDbObjectId currentSpaceId=pDb->currentSpaceId();
    346. AcDbBlockTableRecord *pBlockTableRecord;
    347. if (acdbOpenObject(pBlockTableRecord,currentSpaceId,AcDb::kForWrite)!=Acad::eOk)
    348. {
    349. return AcDbObjectId::kNull;
    350. }
    351. AcDbObjectId entId;
    352. pBlockTableRecord->appendAcDbEntity(entId, pEnt);
    353. pBlockTable->close();
    354. pBlockTableRecord->close();
    355. return entId;
    356. }
    357. static double pi()
    358. {
    359. return atan(1.0)*4;
    360. }
    361. bool CMyJig::doIt(const AcGePoint3d &ptCenter)
    362. {
    363. m采用ptCenter=ptCenter;
    364. m采用pEnt=new CMyCurve(m采用ptCenter,m采用ptCenter,6,25);
    365. setDispPrompt(采用T("指定下一点:"));
    366. AcEdJig::DragStatus stat=drag();
    367. if (stat==kNormal)
    368. {
    369. AddToModelSpace(m采用pEnt);
    370. m采用pEnt->close();
    371. return true;
    372. }
    373. else
    374. {
    375. delete m采用pEnt;
    376. return false;
    377. }
    378. }
    379. AcEdJig::DragStatus CMyJig::sampler () {
    380. setUserInputControls((UserInputControls)(AcEdJig::kAccept3dCoordinates|AcEdJig::kNoNegativeResponseAccepted|AcEdJig::kNullResponseAccepted));
    381. static AcGePoint3d pt;
    382. DragStatus stat=acquirePoint(m采用ptCur);
    383. if (pt!=m采用ptCur)
    384. {
    385. pt=m采用ptCur;
    386. }
    387. else if (stat==AcEdJig::kNormal)
    388. {
    389. return AcEdJig::kNoChange;
    390. }
    391. return stat;
    392. }
    393. //-----------------------------------------------------------------------------
    394. //- Jigged entity update
    395. Adesk::Boolean CMyJig::update () {
    396. // AcGeVector2d ver(m采用ptCur.x-m采用ptCenter.x,m采用ptCur.y-m采用ptCenter.y);
    397. // for (int i=1;i<4;i++)
    398. // {
    399. // AcGePoint3d pt;
    400. // ver.rotateBy(2*pi()/3);
    401. // pt.x=m采用ptCenter.x+ver.x;
    402. // pt.y=m采用ptCenter.y+ver.y;
    403. // pt.z=m采用ptCenter.z;
    404. // m采用pEnt->setVertexAt(i-1,pt);
    405. // }
    406. m采用pEnt->reset(m采用ptCur);
    407. return Adesk::kTrue;
    408. }
    409. //-----------------------------------------------------------------------------
    410. //- Jigged entity pointer return
    411. AcDbEntity *CMyJig::entity () const {
    412. return m采用pEnt;
    413. }
    414. acrxEntryPoint.cpp:
    415. #include "StdAfx.h"
    416. #include "resource.h"
    417. #include "..\CMyEntity1\Entity.h"
    418. #include "acgi.h"
    419. #include "myjig.h"
    420. #include "..\..\cmyentity1\cmyentity1\mycurve.h"
    421. //-----------------------------------------------------------------------------
    422. #define szRDS 采用RXST("zff")
    423. //-----------------------------------------------------------------------------
    424. //----- ObjectARX EntryPoint
    425. class CObjectARXApp : public AcRxArxApp {
    426. public:
    427. CObjectARXApp () : AcRxArxApp () {}
    428. virtual AcRx::AppRetCode On采用kInitAppMsg (void *pkt) {
    429. // TODO: Load dependencies here
    430. // You *must* call On采用kInitAppMsg here
    431. AcRx::AppRetCode retCode =AcRxArxApp::On采用kInitAppMsg (pkt) ;
    432. // TODO: Add your initialization code here
    433. return (retCode) ;
    434. }
    435. virtual AcRx::AppRetCode On采用kUnloadAppMsg (void *pkt) {
    436. // TODO: Add your code here
    437. // You *must* call On采用kUnloadAppMsg here
    438. AcRx::AppRetCode retCode =AcRxArxApp::On采用kUnloadAppMsg (pkt) ;
    439. // TODO: Unload dependencies here
    440. return (retCode) ;
    441. }
    442. virtual void RegisterServerComponents () {
    443. }
    444. static double pi()
    445. {
    446. return atan(1.0)*4;
    447. }
    448. static AcDbObjectId AddToModelSpace(AcDbEntity *pEnt)
    449. {
    450. AcDbBlockTable *pBlockTable;
    451. acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead);
    452. AcDbBlockTableRecord *pBlockTableRecord;
    453. pBlockTable->getAt(ACDB采用MODEL采用SPACE, pBlockTableRecord,AcDb::kForWrite);
    454. AcDbObjectId entId;
    455. pBlockTableRecord->appendAcDbEntity(entId, pEnt);
    456. pBlockTable->close();
    457. pBlockTableRecord->close();
    458. return entId;
    459. }
    460. static AcDbObjectId AddToCurrentSpace(AcDbEntity *pEnt)
    461. {
    462. AcDbBlockTable *pBlockTable;
    463. AcDbDatabase *pDb=acdbHostApplicationServices()->workingDatabase();
    464. pDb->getBlockTable(pBlockTable, AcDb::kForRead);
    465. AcDbObjectId currentSpaceId=pDb->currentSpaceId();
    466. AcDbBlockTableRecord *pBlockTableRecord;
    467. if (acdbOpenObject(pBlockTableRecord,currentSpaceId,AcDb::kForWrite)!=Acad::eOk)
    468. {
    469. return AcDbObjectId::kNull;
    470. }
    471. AcDbObjectId entId;
    472. pBlockTableRecord->appendAcDbEntity(entId, pEnt);
    473. pBlockTable->close();
    474. pBlockTableRecord->close();
    475. return entId;
    476. }
    477. static void zffObjectARX采用MyCommand1(void)
    478. {
    479. ads采用point pt;
    480. acedGetPoint(NULL,采用T("指定中心点:"),pt);
    481. CMyJig jig;
    482. jig.doIt(asPnt3d(pt));
    483. }
    484. } ;
    485. //-----------------------------------------------------------------------------
    486. IMPLEMENT采用ARX采用ENTRYPOINT(CObjectARXApp)
    487. ACED采用ARXCOMMAND采用ENTRY采用AUTO(CObjectARXApp, zffObjectARX, 采用MyCommand1, MyCommand1, ACRX采用CMD采用TRANSPARENT, NULL)
    488. https://www.cnblogs.com/NewAutoMan/p/6373661.html
    复制代码

     

     

     

     

    自创实体类从AcDbCurve派生,实现一些类方法并动态绘制
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

    GMT+8, 2024-11-1 09:23 , Processed in 0.148818 second(s), 26 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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