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

匿名 (未验证) 提交于 2019-12-02 23:41:02

由一个自定义实体事件中的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 MxDrawResbuf
Set param66 = MxDrawX1.CustomEventParam()
Dim lBlockRecId As Long
lBlockRecId = param66.AtLong(1)
Dim customEntity As MxDrawCustomEntity
Set customEntity = MxDrawX1.CallEx("Mx_GetCustomEntity", param66)
If customEntity.IsHave("startpoint") Then
Else
Exit Sub
End If
If customEntity.IsHave("endpoint") Then
Else
Exit Sub
End If
Set database = MxDrawX1.GetDatabase
Dim blkRec As MxDrawBlockTableRecord
Set blkRec = database.ObjectIdToObject(lBlockRecId)
Set sPt = customEntity.GetPoint("startpoint")
Set ePt = customEntity.GetPoint("endpoint")
blkRec.AddLine sPt, ePt
End If
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!