KB no longer maintained - Voxler is a retired product. Golden Software retired products are still supported, but no longer receive new features or updates. Many of Voxler's features are moving to Surfer . Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for opening a Voxler project containing a heightfield module and then exporting to 3D DXF.
To run this script:
- Copy the script below, or download the attached BAS file: 3dDXF_Export.BAS.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Voxler 4\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
'*************************************************************** ' 3dDXF_Export.bas ' ' This script opens the Helens (contour map).voxb sample file and exports the file to 3D DXF. ' Change the file path on line 32 to choose a different file to open. ' The export options that are commented out can be changed and added back in as needed. ' Change the file path on line 56 to a location that exists on your computer before running. '**************************************************************** ' If Voxler is running, retrieve the current instance of Voxler. Otherwise, ' create a new instance of Voxler. Function VoxlerApplication() On Error Resume Next Set VoxlerApplication = GetObject(, "Voxler.Application") If Err.Number <> 0 Then Set VoxlerApplication = CreateObject("Voxler.Application") End If On Error GoTo 0 End Function Sub Main 'Retrieve running instance of Voxler or create a new instance of Voxler Dim VoxlerApp As Object Set VoxlerApp = VoxlerApplication() 'Make Voxler visible VoxlerApp.Visible = True 'Access CommandApi Set CommandApi = VoxlerApp.CommandApi 'Open an existing file CommandApi.Construct ("Open") CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\Helens (ContourMap).voxb") CommandApi.DoOnce() 'Export the HeightField module to a 3D DXF 'Change the export Path to one that exists on your computer CommandApi.Construct("Export") CommandApi.Option("GuiEnabled", "False") CommandApi.Option("ClearOptions", "False") CommandApi.Option("Filter", "dxf") CommandApi.Option("Module", "HeightField") 'CommandApi.Option("ModuleId", "0") CommandApi.Option ("Options","FileCompatibility=21") CommandApi.Option ("Options", "FormatASCII=1") 'CommandApi.Option ("Options", "MaxBitmapSizeInMB=10") 'CommandApi.Option ("Options","AllColorsSame=0") 'CommandApi.Option ("Options","AllCStylesSame=0") 'CommandApi.Option ("Options","AllWidthsSame=0") 'CommandApi.Option ("Options", "AllTextToAreas=0") CommandApi.Option("Options","FillSolidAreas=0") 'CommandApi.Option ("Options", "UseSpatialInfo=0") 'CommandApi.Option ("Options","ColorMapping=0") 'CommandApi.Option("Options", "RenderMarkers=0") CommandApi.Option("Path", "C:\Temp\test2.dxf") CommandApi.Option("PersistOptions", "True") CommandApi.Do() End Sub
Updated March 13, 2018
Comments
0 comments
Please sign in to leave a comment.