Application
[Desktop Automation]
application
is not a Lua object that can be created and released. It is a global variable. It facilitates access to the current running Netfabb desktop application. In addition, it generates GUI dialogs.
Properties
Property | Read/write | Type | Description |
---|---|---|---|
lengthunitstring | Read | String | Returns the current unit as string |
showcolortexture | Read/write | Boolean | Set whether color/texture should be displayed |
tier | Read | Number | Returns the current subscription level |
Methods
Name | Syntax | Description |
---|---|---|
createdialog | dialog:object = application:createdialog() | Create a Dialog object. See here for a description of the GUI objects. |
createfolder | application:(path:String) | Creates a folder at the specified location. Does not create intermediate folder levels; for example, starting at D:, D:\temp1\ must be created explicitly before D:\temp1\temp2\ can be created. |
createtaskhandler | taskhandler:object = system:createtaskhandler (url:String, name:String, userid:String, serverkey:String) | Creates a Netfabb taskhandler object. url is http://localhost:8651/tasks/ , for example, name is the worker displayname, userid and serverkey are used in authentication. |
getappdatadirectory | myappdatafolder:string = system:getappdatadirectory(); | Returns the full AppData\Roaming path |
getenvironmentvariable | result:string = application:getenvironmentvariable(Variable: string) | Returns an environment variable as a string |
getluascriptfromlibrary | result:string = application:getluascriptfromlibrary(scriptname: string) | Returns a Lua script as a string from the Netfabb Lua library. The name must match the name in the Netfabb Lua library. |
gettimestamp | application:gettimestamp() | Gets current time in seconds since 1970-01-01. |
loadappserverhublist | hublist = application:loadappserverhublist(URL:String, passphrase:String) | Loads the list of available hubs for the current (logged-in) user from the Netfabb Application Server. url is the server connect string, http://127.0.0.1:8650/ by default, identical to the respective Netfabb setting: ![]() passphrase is empty by default. |
loadappserverproject | result:Boolean = application: loadappserverproject(url:String, projectid:String, folderid:String, itemid:String, userid:String, passphrase:String) | Loads a project from a local server into the application. This discards any previously loaded project. userid and passphrase are optional parameters. Returns true when successful. |
loadfabbproject | result:Boolean = application:loadfabbproject(filename: String) | Loads a FABBPROJECT file |
overwriteexistingappserverproject | result:Boolean = application:overwriteexistingappserverproject(url: String, projectid:String,folderid:String, itemname:String, userid:String, passphrase:String) | Saves the current application project on local server, overwrites an existing project. Returns true when successful. userid and passphrase are optional. |
retrieveglobalvariable | result:String = application:retrieveglobalvariable(key: String) | Retrieve a global variable stored with application:storeglobalvariable . |
savenewappserverproject | result:Boolean = application:savenewappserverproject(url: String, projectid:String,folderid:String, projectname:String, userid:String, passphrase:String) | Saves the current project in the application onto a local server. Returns true if successful. userid and passphrase are optional. |
savecurrentproject | result:Boolean = Application:savecurrentproject() | Saves the current project in the application, returns true when done. |
savefabbproject | result:Boolean = application:savefabbproject (filename:String) | Saves the current state of Netfabb as FABBPROJECT file. |
storeglobalvariable | application:storeglobalvariable (key: String, value: String) | Store a global variable available to all Lua desktop scripts during application runtime. |
triggerdesktopevent | application:triggerdesktopevent('updateparts') | Triggers an event. The event updateparts triggers an update of the displayed meshes in Netfabb. |