ToolpathSaveInfo

From SDK
Jump to navigation Jump to search
Back.jpg

This object is used only within the GetNameForToolpathFile.lua configuration handler. This file can be used to customise the behavior of the file save mechanism for toolpath. Just before the program displays the File Save dialog when saving a toolpaht, it will check if a file called GetNameForToolpathFile.lua was present when the program started. The path to the file varies depending on the operating system (the equivalent location of public "My Documents") and the program name and version. For Aspire V8.0 on Windows 7, this path is:

C:\Users\Public\Documents\Vectric Files\Config\Aspire 8.0\ GetNameForToolpathFile.lua

For VCarve Pro V8.0 it would be:

C:\Users\Public \Documents\Vectric Files\Config\VCarve Pro 8.0\ GetNameForToolpathFile.lua

An example of a Lua file which just displays some information about the file being saved is shown later.


Properties

.BaseName

Interaction: Read and Write

Returns: (string) base name for toolpath to save without extension. Before saving the default extension from .PostP will be added



.PathName

Interaction: Read and Write

Returns: (string) The full pathname to the file to be saved.  On calling the lua script this field will be empty. If the Lua script sets this value it will be used as the default path for the file open dialog.


.PostP

Interaction: Read Only

Returns: (PostPInfo) The post processor the user has chosen to save the toolpath(s) with.



.ShowFileDialog

Interaction: Read and Write:

Returns: (bool) If both the Lua script sets this to true AND.PathName is not empty, The File Save As dialog will not be displayed by the program and the toolpath will be written to the file specified in .PathName .  If the file in .PathName does NOT have an extension, the default extension from the PostP will be added automatically.



.ToolpathList

Interaction: Read Only

Returns: (ToolpathList) The list of toolpaths being saved.


Example Code: GetNameForToolpathFile

    -- VECTRIC LUA SCRIPT

    require "strict"

     -- [[ --- GetNameForToolpathFile --------------------------------------------------  
    |
    |  Entry point for script
    |
    ]]
    function GetNameForToolpathFile(save_info)

      local tc_support;
      if save_info.PostP.SupportsToolchange then
        tc_support = "Toolchanges Are Supported"
      else
        tc_support = "Toolchanges Not Supported"     
      end
      MessageBox(
                 "GetNameForToolpathFile: " .. 
                 "\nNumber of Toolpaths = "  .. save_info.ToolpathList.Count ..
                 "\nDefault Name = "  .. save_info.BaseName ..
                 "\nPost Processor Name = " ..  save_info.PostP.Name ..
                 "\nPost Processor Extension = "  .. save_info.PostP.Extension ..
                 "\nPost Processor " ..  tc_support 
                 )
       -- save_info.BaseName = "Lua Toolpath Name"
       -- save_info.PathName = "d:\\temp\\Lua Toolpath Name" 
       -- save_info.ShowFileDialog = false    
      return true 
    end -- function end

     -- [[ -------------- main --------------------------------------------------  |
    |  Entry point for script
    |
    ]]

    function main(script_path)
       return true
    end   -- function end  



Back.jpg

References

Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 2.05, published September 12, 2018. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information