• 大小: 27.21MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-04
  • 语言: 其他
  • 标签: 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  ArxPro3\ArxPro3\
     文件    34819072  2017-03-31 15:17  ArxPro3\ArxPro3.ncb
     文件        1241  2017-03-24 10:28  ArxPro3\ArxPro3.sln
     文件       49664  2017-03-31 15:17  ArxPro3\ArxPro3.suo
     文件         116  2017-03-29 11:18  ArxPro3\ArxPro3\acad.err
     文件        3427  2017-03-31 14:06  ArxPro3\ArxPro3\acrxEntryPoint.cpp
     文件        2444  2017-03-24 10:28  ArxPro3\ArxPro3\ArxPro3.cpp
     文件        2150  2017-03-24 10:28  ArxPro3\ArxPro3\ArxPro3.rc
     文件        9969  2017-03-30 15:21  ArxPro3\ArxPro3\ArxPro3.vcproj
     文件        2771  2017-03-31 15:17  ArxPro3\ArxPro3\ArxPro3.vcproj.ZGC-20151109RCS.Administrator.user
     文件       10178  2017-03-31 14:58  ArxPro3\ArxPro3\CustomEntity.cpp
     文件        5826  2017-03-31 14:58  ArxPro3\ArxPro3\CustomEntity.h
     文件        1895  2017-03-24 10:28  ArxPro3\ArxPro3\DocData.cpp
     文件        1692  2017-03-24 10:28  ArxPro3\ArxPro3\DocData.h
     文件        2246  2017-03-31 15:08  ArxPro3\ArxPro3\DrawEntityJig.cpp
     文件        1803  2017-03-31 14:58  ArxPro3\ArxPro3\DrawEntityJig.h
     文件        2632  2017-03-30 15:34  ArxPro3\ArxPro3\DwgDatabaseUtil.cpp
     文件        1636  2017-03-29 15:29  ArxPro3\ArxPro3\DwgDatabaseUtil.h
     文件         430  2017-03-24 10:28  ArxPro3\ArxPro3\Resource.h
     文件        1371  2017-03-24 10:28  ArxPro3\ArxPro3\StdAfx.cpp
     文件        4551  2017-03-24 10:28  ArxPro3\ArxPro3\StdAfx.h
     目录           0  2017-03-24 13:30  ArxPro3\ArxPro3\Win32\
     目录           0  2017-03-31 15:16  ArxPro3\ArxPro3\Win32\Debug\
     文件       91784  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\acrxEntryPoint.obj
     文件       17335  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\ArxPro3.obj
     文件         868  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\ArxPro3.res
     文件       15374  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\BuildLog.htm
     文件      152052  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\DocData.obj
     文件       14224  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\DwgDatabaseUtil.obj
     文件         910  2017-03-24 13:47  ArxPro3\ArxPro3\Win32\Debug\HYArxPro3.arx.embed.manifest
............此处省略32个文件信息

评论

共有 条评论