![]() |
【转帖】any dwg to bmp export command line programsample code
any dwg to bmp export command line program/sample code?
any dwg to bmp export command line program/sample code? dwgdirect is huge library, and all i want is a command line program taking input dwg file path and output bmp file path and do the export job. thumbnail is too small, so i need to do the export/conversion. can anyone show the code that does that? thanks. try this quickanddirty with dwgdirect: code: imports system.io module mod_000_000_dwg2bmp sub main(byval cmdargs() as string) 'strarg(0)=dwgname 'strarg(1)=zoomextents y/n 'strarg(2)=acadbmpout.height 'strarg(3)=acadbmpout.width dim acadhost as dwgdirectx.odahostapp dim acaddoc as dwgdirectx.acaddocument dim acadbmpout as new dwgdirectx.odabmpout dim i as integer try acadhost = createobject("dwgdirectx.odahostapp") if file.exists(cmdargs(0)) then acaddoc = acadhost.application.documents.open(cmdargs(0)) if ucase(cmdargs(1)) = "y" then acaddoc.application.zoomextents() end if acadbmpout.height = cint(cmdargs(2)) acadbmpout.width = cint(cmdargs(3)) acadbmpout.writefile(acaddoc.database, cmdargs(0).replace(".dwg", ".bmp")) for i = 0 to acadhost.application.documents.count - 1 acadhost.application.documents.item(0).close() next end if catch ex as exception console.write(ex.message.tostring) finally acadhost.application.quit() end try end sub end module ___________ ralph look at "\examples\excustobjs\cmd_bmpout.cpp" vladimir |
所有的时间均为北京时间。 现在的时间是 04:19 PM. |