查看单个帖子
旧 2009-04-12, 09:52 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】need help with drawing view refenrce

need help with drawing view refenrce
anyone can help pls!
i'm trying to use dm to get the name of the drawingview refence using
iswdmview.referenceddocument...
i've check the help but i'm kind of confused.
what is the good way should i need to have a view selected 1st or should i select it with dm or ???
thanks to the genius that will help!
simon paré
cswp,
mechanical designer
swx 2009 sp 2.1
sub main()
const swfilename as string = "your file"
dim swdoc as swdocumentmgr.swdmdocument10
dim swdmsearchop as swdocumentmgr.swdmsearchoption
dim ndoctype as long
dim nretval as long
dim dmdrview as swdocumentmgr.swdmview
dim dmdrviews as variant
dim i as integer
set classfac = createobject("swdocumentmgr.swdmclassfactory")
set swdocmgr = classfac.getapplication("your code")
if not instr(lcase(swfilename), "slddrw") > 0 then
exit sub
end if
ndoctype = swdmdocumentdrawing
set swdoc = swdocmgr.getdocument(swfilename, ndoctype, false, nretval): debug.assert swdmdocumentopenerrornone = nretval
set swdmsearchop = swdocmgr.getsearchoptionobject
dmdrviews = swdoc.getviews
for i = 0 to ubound(dmdrviews)
set dmdrview = dmdrviews(i)
debug.print dmdrview.referenceddocument
next i
end sub
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)