![]() |
【转帖】see what partassembly a drawing points to
see what part/assembly a drawing points to.
hi, when i open a drawing (slddrw), is it possible to figure out which file it points to (sldprt/sldasm)? also, when i open a drawing (without having the part it refers to) the drawing displays as it was last saved. it then starts complaining that i cannot find the file, and the updates the drawing to a blank sheet. is it possible to open without updating, to just see the last saved drawing? nicolai søndergaard lm glasfiber a/s file > find references to figure out which file it points to (sldprt/sldasm) open the drawing with solidworks viewer or e drawing to see the last saved drawing without updating deepak gupta sw2007 sp5.0 sw2009 sp2.1 how do i get to these things through the api? i have tried with modeldoc2.getexternalreferencename() but i'm getting no value from it. also, opening the drawing through e drawings will not work (i think atleast), i need to get the same functionality (or lack thereof) in sw through the api. nicolai søndergaard lm glasfiber a/s nicolai, you can open the drawing in read-only state in sw to avoid the drawing from updating. set the options when using opendoc6 (i'm not yet familiar with opendoc7). or check out the example for opendoc7. it does exactly what you want. dansk? jorn bjarning cswp cad & plm consultant sw2008 sp5 / sw2009 sp2 nicolai regarding how to get the model attached to a drawing. as a drawing can show views of several models you will have to go through the views to get the information you seek. look at view::referenceddocument. i think that is what you need. jorn bjarning cswp cad & plm consultant sw2008 sp5 / sw2009 sp2 edited: 01/21/2009 at 04:46 am by jorn bjarning thank you jorn, opendoc6 did seem to do what i want, except doing it with readonly, didn't display the views, and doing it with viewonly, only displayed the views (we have a frame i wanted aswell). i couldn't get view::referenceddocument to work. in the end i just looked for files in the directory instead. and yes, dansk nicolai søndergaard lm glasfiber a/s i have not actually looked at it, but i would guess that the document manager api would get external references. using this api does require getting a license key from apisupport@solidworks.com. wayne matus texas engineering systems answer for external reference you can use document manager or sldworks::getdocumentdependencies2 originally posted by: nicolai søndergaard thank you jorn, opendoc6 did seem to do what i want, except doing it with readonly, didn't display the views, and doing it with viewonly, only displayed the views (we have a frame i wanted aswell). i couldn't get view::referenceddocument to work. in the end i just looked for files in the directory instead. and yes, dansk say, when you were able to open the referenced model via the stock api in readonly-mode, would this allow you to save the referenced part in a different format? say, a stepfile? solidworks 2008 sp5 win xp pro dell precision 3400 4gb ram nvidia quadro fx3700 169.39_quadro_winxp2k_english_whql(.exe) originally posted by: ivana kolin for external reference you can use document manager or sldworks::getdocumentdependencies2 thanks ivana, this worked out great. @jack: i didn't try step but i had no problems saving a pdf or a dxf. however, doing it with readonly didn't show any of the views on my drawing, only my drawing frame (sheet template). doing it with viewonly saved the views, but not the drawingframe. nicolai søndergaard lm glasfiber a/s quick |
所有的时间均为北京时间。 现在的时间是 05:49 PM. |