ToolDatabase: Difference between revisions

From SDK
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
[[Category:SDK]]
[[Category:SDK]]
The ToolDatabase object gives access to the single Tool database within the program. Currently this object can only be used to select an existing tool from the database.   
The ToolDatabase object gives access to the single Tool database within the program. Currently this object can only be used to select an existing tool from the database.   


==Constructor ==
==Constructor ==


===ToolDatabase===  
===ToolDatabase===  
Returns a new object which gives access to the single Tool database for the program.  
'''Returns''' A new object which gives access to the single Tool database for the program.  
::''e.g         
::''e.g         
::''local tooldb = ToolDatabase()''
::''local tooldb = ToolDatabase()''
===:GetTool(ToolDBId tooldb_id) ===
Return the tool from the database with the given Id.
===ToolDBId ===
This is an object used to locate a selected tool with its location in the tool database. It is retrieved by the tool through Tool.ToolDBId and is useful for saving and loading defaults.
--Constructor --
ToolDBId(string section, string key_prefix) – constructor Create an Id object from the contents of the registry
Section – string – section name in the registry
Key_prefix – string – prefix for the registry keys (could be empty) in case multiple tools are used in the same gadget


==Methods==   
==Methods==   
Line 30: Line 17:
'''For Example:'''   
'''For Example:'''   


  <nowiki>local tool_database = ToolDatabase()  
<nowiki> local tool_database = ToolDatabase()  
  local tool = tool_database:SelectTool() </nowiki> 
  local tool = tool_database:SelectTool() </nowiki> 




===:GetTool(ToolDBId tooldb_id) ===
:GetTool(ToolDBId tooldb_id)  
Return the tool from the database with the given Id.
Return the tool from the database with the given Id.  
 




[[File:Back.jpg|right|50px|link=Toolpaths]]
[[File:Back.jpg|right|50px|link=Toolpaths]]
==References==
==References==
'''Please Note:''' The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at [https://gadgets.vectric.com/developerinfo.html Vertric Developer Information]
'''Please Note:''' The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at [https://gadgets.vectric.com/developerinfo.html Vertric Developer Information]

Latest revision as of 17:12, 1 May 2024

Back.jpg

The ToolDatabase object gives access to the single Tool database within the program. Currently this object can only be used to select an existing tool from the database.

Constructor

ToolDatabase

Returns A new object which gives access to the single Tool database for the program. 
e.g
local tooldb = ToolDatabase()

Methods

:SelectTool()

Displays the Tool Database dialog and allows the user to choose a tool which is returned from this method.

For Example:

 local tool_database = ToolDatabase() 
 local tool = tool_database:SelectTool()   	


GetTool(ToolDBId tooldb_id)

Return the tool from the database with the given Id.


Back.jpg

References

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