package require tcom # --- the file (extensions are assumed based on filetype) set file [file join "c:/" "test"] # --- various dxf output formats set type(R12_dxf) [expr 1] set type(R13_dxf) [expr 5] set type(R14_dxf) [expr 9] set type(R15_dxf) [expr 13] set type(R18_dxf) [expr 25] set type(2000_dxf) [expr 13] set type(2004_dxf) [expr 25] # --- open AutoCAD set app [::tcom::ref createobj AutoCAD.Application] # --- keep it hidden $app Visible 0 # --- get a handle to the Documents collection set docsCollection [$app Documents] # --- open our file as a new document set theDoc [$docsCollection Open $file] # --- save our file as a specific DXF format $theDoc SaveAs $file $type(2000_dxf) # --- close the file $theDoc Close # --- quit from AutoCAD $app Quit
Category Example
