objectArx通过Jig拖动绘制自定义实体


CAD二次开发ObjectArx之自定义实体:其中又通过多次Jig拖动来完成自定义实体的生成
资源截图
代码片段和文件信息
// (C) Copyright 2002-2007 by Autodesk Inc. 
//
// Permission to use copy modify and distribute this software in
// object code form for any purpose and without fee is hereby granted 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM “AS IS“ AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use duplication or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software) as applicable.
//

//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include “StdAfx.h“
#include “resource.h“
#include “DwgDatabaseUtil.h“
#include “CustomEntity.h“
#include “DrawEntityJig.h“

//-----------------------------------------------------------------------------
#define szRDS _RXST(“HY“)

//-----------------------------------------------------------------------------
//----- objectARX EntryPoint
class CArxPro3App : public AcRxArxApp {

public:
CArxPro3App () : AcRxArxApp () {}

virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
// TODO: Load dependencies here

// You *must* call On_kInitAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;

// TODO: Add your initialization code here
CCustomEntity::rxInit();
acrxBuildClassHierarchy();

return (retCode) ;
}

virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
// TODO: Add your code here

// You *must* call On_kUnloadAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;

// TODO: Unload dependencies here

return (retCode) ;
}

virtual void RegisterServerComponents () {
}

// - HYArxPro3.CustomEntity command (do not rename)
static void HYArxPro3CustomEntity(void)
{
// Add your code for command HYArxPro3.CustomEntity here

// 预先设定实体,Jig拖动过程中再进行改变
CCustomEntity* customEntity = new CCustomEntity(AcGePoint3d::kOrigin 200 CDwgDatabaseUtil::PI() / 2);

CDrawEntityJig Jig;
AcDbobjectId entityId;
if (Jig.doIt(customEntity) == kNormal)
{
double radiusTemp = customEntity->radius(); // Jig后实体的半径
double angleTemp = customEntity->angle(); //  Jig后实体的方向角度
entityId = CDwgDatabaseUtil::PostToModelSpace(customEntity);
CDwgDatabaseUtil::Setlayer(entityId _T(“新图层“));
CDwgDatabaseUtil::AddXdata(entityId radiusTemp AcGeVector3d(1 0 0).rotateBy(a

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-03-29 17:11  ArxPro3
     目录           0  2017-03-31 15:08  ArxPro3ArxPro3
     文件    34819072  2017-03-31 15:17  ArxPro3ArxPro3.ncb
     文件        1241  2017-03-24 10:28  ArxPro3ArxPro3.sln
     文件       49664  2017-03-31 15:17  ArxPro3ArxPro3.suo
     文件         116  2017-03-29 11:18  ArxPro3ArxPro3acad.err
     文件        3427  2017-03-31 14:06  ArxPro3ArxPro3acrxEntryPoint.cpp
     文件        2444  2017-03-24 10:28  ArxPro3ArxPro3ArxPro3.cpp
     文件        2150  2017-03-24 10:28  ArxPro3ArxPro3ArxPro3.rc
     文件        9969  2017-03-30 15:21  ArxPro3ArxPro3ArxPro3.vcproj
     文件        2771  2017-03-31 15:17  ArxPro3ArxPro3ArxPro3.vcproj.ZGC-20151109RCS.Administrator.user
     文件       10178  2017-03-31 14:58  ArxPro3ArxPro3CustomEntity.cpp
     文件        5826  2017-03-31 14:58  ArxPro3ArxPro3CustomEntity.h
     文件        1895  2017-03-24 10:28  ArxPro3ArxPro3DocData.cpp
     文件        1692  2017-03-24 10:28  ArxPro3ArxPro3DocData.h
     文件        2246  2017-03-31 15:08  ArxPro3ArxPro3DrawEntityJig.cpp
     文件        1803  2017-03-31 14:58  ArxPro3ArxPro3DrawEntityJig.h
     文件        2632  2017-03-30 15:34  ArxPro3ArxPro3DwgDatabaseUtil.cpp
     文件        1636  2017-03-29 15:29  ArxPro3ArxPro3DwgDatabaseUtil.h
     文件         430  2017-03-24 10:28  ArxPro3ArxPro3Resource.h
     文件        1371  2017-03-24 10:28  ArxPro3ArxPro3StdAfx.cpp
     文件        4551  2017-03-24 10:28  ArxPro3ArxPro3StdAfx.h
     目录           0  2017-03-24 13:30  ArxPro3ArxPro3Win32
     目录           0  2017-03-31 15:16  ArxPro3ArxPro3Win32Debug
     文件       91784  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugacrxEntryPoint.obj
     文件       17335  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugArxPro3.obj
     文件         868  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugArxPro3.res
     文件       15374  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugBuildLog.htm
     文件      152052  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugDocData.obj
     文件       14224  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugDwgDatabaseUtil.obj
     文件         910  2017-03-24 13:47  ArxPro3ArxPro3Win32DebugHYArxPro3.arx.embed.manifest
............此处省略32个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)