./features/make DXFs
Download Features Source code Forum Ask for support

Make DXFs for solid bodies

The following code loads all STEP files in a directory, applies HLR (hidden line removal) and exports DXF files:

set workdir   MyWorkDir
set targetdir $workdir

# Get all STEP files available in the input directory.
set filenames [glob -directory $workdir -- "*.step"]

notifier -init

foreach inFilename $filenames {
  puts "Next file: $inFilename"
  set basename [lindex [file split $inFilename] end]
  set basename [file rootname $basename]

  puts "Target output file: $targetdir/$basename.dxf"

  load-part $inFilename
  orient-part -apply

  hlr HLR 0 0 0 0 0 1
  save-dxf -var HLR -filename "$targetdir/$basename.dxf"

  notifier -step
}

notifier -finish

In this example, HLR is always being applied in OZ direction. Therefore, to make sure a part is oriented properly, the script includes the orient-part command.