几何尺寸与公差论坛

 找回密码
 注册
查看: 810|回复: 0

【转帖】modify block attribute value with dwgeditor vb api

[复制链接]
发表于 2009-4-13 12:53:13 | 显示全部楼层 |阅读模式
modify block attribute value with dwgeditor vb api
hallo,
i'm trying as follow to modify block attribute property using the visual basic api.
dim m_blk as dwgeditor.block
dim i as integer
for each m_blk in activedocument.blocks
if "block_name" = m_blk.name then
for i = 1 to m_blk.count
dim m_obj as object
set m_obj = m_blk.item(i)
if m_blk.item(i).entitytype = vicattributedef then
if m_blk.item(i).tagstring = "tomatchtag" then
m_obj.textstring = "edited text string"
m_obj.update
m_blk.reload
end if
end if
set m_obj = nothing
next
end if
next
activedocument.save
i can successfully run the code. but doing so does not change the attribute.
what am i missing?
thx a lot for helping
i didn't even know dwgeditor had an api, i cannot seem to find the api help for it nor have i looked for the files to reference to in order to use it. do you have a link to the api so i can take a look?
luke,
for the api help look in the dwgeditor help file. it has a section called developer reference explaining the four available languages. what about testing your autocad lisp skills... ;-)
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
have you checked your code debugging and stepping though each line to see if you actually get into the following if statement:
if m_blk.item(i).tagstring = "tomatchtag" then
...
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 09:24 , Processed in 0.034692 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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