高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|