几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】need help with drawing view refenrce (http://www.dimcax.com/hust/showthread.php?t=4835)

yang686526 2009-04-12 09:52 PM

【转帖】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


所有的时间均为北京时间。 现在的时间是 04:35 PM.