明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 821|回复: 3

ownerid属性不能使用?

[复制链接]
发表于 2019-10-11 15:40 | 显示全部楼层 |阅读模式
下面的案例是cad帮助文件中自带的,有人试过可以运行,但是我一运行就报错,问题就出在最后一行的OwnerID属性上,我将这个属性换成width也能正常运行,感觉应该是编译环境的问题,求教各位大佬是否有办法能够解决?

Sub Example_OwnerID()    ' This example creates an MText object in model space    ' and then finds the OwnerID for the object.        Dim MTextObj As AcadMText    Dim corner(0 To 2) As Double    Dim width As Double    Dim text As String    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#    width = 10    text = "This is the text string for the MText object"    ' Creates the MText object    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)    ZoomAll        MsgBox "The OwnerID for the MText object is: " & MTextObj.OwnerID    End Sub
报错内容是:函数或接口标记为限制的,或函数使用了Visual basic中不支持的自动类型
顺便请教一下,cad2010的VBA编译器是否由中文版的?或者有中文包?
发表于 2019-10-11 16:21 | 显示全部楼层
注意你的系统是多少位的,ownerID不行就试试OwnerID32.
 楼主| 发表于 2019-10-11 16:50 | 显示全部楼层
mikewolf2k 发表于 2019-10-11 16:21
注意你的系统是多少位的,ownerID不行就试试OwnerID32.

感谢大佬,换了32就可以了,这难道是因为我64位的系统安装了32位的ide么?
发表于 2019-10-11 17:25 | 显示全部楼层
有中文版,我的2010的VBA就是中文的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 12:51 , Processed in 0.244262 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表