CAD实现自定义实体夹点移动(com接口VB语言)

主要用到函数说明:

MxDrawXCustomEvent::MxDrawXCustomEntity::moveGripPointsAt

自定义实体事件,自定义实体夹点被移动,详细说明如下:

参数 说明

LONGLONG lEntity


自定义实体id


IN LONG lGridIndex


夹点索引号


IN McGePoint3d vec


夹点移动的向量

VB代码实现如下:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

        If sEventName = "MxDrawXCustomEntity::moveGripPointsAt" Then

        Dim param88 As MxDrawResbuf

        Set param88 = MxDrawX1.CustomEventParam()

        Set customEntity = MxDrawX1.CallEx("Mx_GetCustomEntity", param88)

        Set sPt = customEntity.GetPoint("startpoint")

        Set ePt = customEntity.GetPoint("endpoint")

        Dim lIndex As Long

        lIndex = param88.AtLong(1)

        Dim offsetPt As MxDrawPoint

        Set offsetPt = param88.AtPoint(2)

        If lIndex = 0 Then

            sPt.x = sPt.x + offsetPt.x

            sPt.y = sPt.y + offsetPt.y

            customEntity.SetPoint "startpoint", sPt

        Else

            ePt.x = ePt.x + offsetPt.x

            ePt.y = ePt.y + offsetPt.y

            customEntity.SetPoint "endpoint", ePt

        End If

        End If

原文地址:https://www.cnblogs.com/yzy0224/p/11003365.html

时间: 2024-08-01 22:42:16

CAD实现自定义实体夹点移动(com接口VB语言)的相关文章

【CAD】自定义实体的步骤(转)

本文介绍了构造自定义实体的步骤.必须继承的函数和必须注意的事项 1.新建一个从AcDbEntity继承的类,如EntTest,必须添加的头文件: "stdarx.h","acadstrc.h", "geassign.h". 2.在该类头文件的类声明中添加宏:ACRX_DECLARE_MEMBERS(EntTest); 3.在该类的cpp文件中,类的前面添加宏: ACRX_DXF_DEFINE_MEMBERS(EntTest, AcDbEntity

CAD绘制自定义实体(com接口)

在cad使用过程中,用户可以绘制自定义实体.点击此处下载演示实例. 调用DrawCustomEntity函数,绘制一个自定义实体对象. 下面代码绘制一个自定义实体,C#代码实现如下: private void DrawMlineCommand() { MxDrawUiPrPoint getPt = new MxDrawUiPrPoint(); getPt.message = "点取第一点"; if (getPt.go() != MCAD_McUiPrStatus.mcOk) { ret

CAD由一个自定义实体事件中的id得到自定义实体对象(com接口VB语言)

由一个自定义实体事件中的id得到自定义实体对象.该函数只能在自定义实体事件中调用. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 If sEventName = "MxDrawXCustomEntity::explode" Then             Dim param66 As M

CAD得到ImageMark数据(com接口VB语言)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 Private Sub MxDrawX1_CustomEvent(ByVal sEventName As String)        If sEventName = "ObjectGripEdit" Then           

CAD绘制一个图象标记对象(com接口VB语言)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 Private Sub DrawImageMarkImp()     'Dim

CAD向控件注册一个命令(com接口VB语言)

主要用到函数说明: MxDrawXCustomFunction::Mx_RegistUserCustomCommand 向控件注册一个命令,用户在命令行输入命令名这个字符串,就会触发执行命令事件 命令事件的id就是该注册时的id值,详细说明如下: 参数 说明 CString sCommandName 命令名称 LONG lId 命令id VB代码实现如下: 1 2 3 4 5 6 Set param2 = New MxDrawXLib.MxDrawResbuf param2.AddString

CAD直接打印,不出现打印对话框(com接口VB语言)

主要用到函数说明: MxDrawXCustomFunction::Mx_Print 直接打印,不出现打印对话框,详细说明如下: 参数 说明 double ptLBx 打印的范围左下角x double ptLBy 打印的范围左下角y double ptRTx 打印的范围右上角x double ptRTy 打印的范围右上角y LPCTSTR pszPrintName 打印机名,如果传为空,取系统默认打印机 LPCTSTR pszPaperName 打印的图纸名,如果传为空,取系统默认打印机设置 LO

CAD执行一个带参数的命令(com接口VB语言)

主要用到函数说明: MxDrawXCustomFunction::Mx_SendStringToExecute 执行一个带参数的命令.详细说明如下: 参数 说明 CString sCmaName 命令名 Param 命令参数 VB中实现代码说明: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Dim param As MxDrawResbuf Set param = New MxDrawRes

CAD与用户互在图面上得到一个矩形框(com接口VB语言)

主要用到函数说明: MxDrawXCustomFunction::ExApp_CutDwg 与用户互在图面上得到一个矩形框,详细说明如下: 参数 说明 IN DOUBLE dX1 保存范围的左下角位置X值 IN DOUBLE IN dY1 保存范围的左下角位置Y值 IN DOUBLE dX2 保存范围的右上角位置X值 IN DOUBLE IN dY2 保存范围的右上角位置Y值 sFile 保存的文件名 主要用到函数说明: MxDrawXCustomFunction::Mx_GetCorner 与