几何尺寸与公差论坛

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

【转帖】getting the name of a breakline

[复制链接]
发表于 2009-4-13 11:05:25 | 显示全部楼层 |阅读模式
getting the name of a breakline
i'm trying to write a macro that identifies the internal name for drawing objects (currently breaklines) i can't seem to get a handle on anything that will tell me what the selected breakline's name is. here is the current code (originally recorded as a macro and you can clearly see that swx knows what it's name is when it recorded the macro in sub main) i'm running the identify subroutine with a breakline selected.
i've tried casting it as a feature and an annotation but that gives me a type mismatch. any ideas?
dim swapp as sldworks.sldworks
dim part as modeldoc2
dim selmgr as selectionmgr
dim boolstatus as boolean
dim longstatus as long, longwarnings as long
dim feature as feature
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
swapp.activedoc.activeview.framestate = 1
boolstatus = part.extension.selectbyid2("break line17", "breakline", 0, 0, 0, false, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("break line8", "breakline", 0, 0, 0, true, 0, nothing, 0)
part.editdelete
end sub
sub identify()
dim swbreak as breakline
dim annotation as annotation
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
set swbreak= selmgr.getselectedobject6(1, 0)
set annotation = ofeature
debug.print swbreak.name
end sub
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-23 18:22 , Processed in 0.035048 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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