由一个自定义实体事件中的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" ThenDim param66 As MxDrawResbufSet param66 = MxDrawX1.CustomEventParam()Dim lBlockRecId As LonglBlockRecId = param66.AtLong(1)Dim customEntity As MxDrawCustomEntitySet customEntity = MxDrawX1.CallEx("Mx_GetCustomEntity", param66)If customEntity.IsHave("startpoint") ThenElseExit SubEnd IfIf customEntity.IsHave("endpoint") ThenElseExit SubEnd IfSet database = MxDrawX1.GetDatabaseDim blkRec As MxDrawBlockTableRecordSet blkRec = database.ObjectIdToObject(lBlockRecId)Set sPt = customEntity.GetPoint("startpoint")Set ePt = customEntity.GetPoint("endpoint")blkRec.AddLine sPt, ePtEnd If |