几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】any dwg to bmp export command line programsample code (http://www.dimcax.com/hust/showthread.php?t=15108)

yang686526 2009-05-04 04:03 PM

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