API

From KScan3D

Jump to: navigation, search

Contents

KScan3D Command Line Interface

The KScan3D Command Line interface is accessible by calling KScan3D.exe on the command line or through the API DLL. A path which contains spaces needs to be enclosed in double quotes.

Example: KScan3D.exe script "C:\Users\User\Documents\KScan3D\Scripts\MyScript.script"

To control the application, you must write a script and load it using the "script" command. To communicate from the script to the calling application, variables can be set in the script which can then be queried using the KS3D_ScriptQuery() function after the script has completed. For more about writing scripts, please see the section on Automation.


interactive

Usage
interactive [console]
Example
interactive

Starts KScan3D in interactive mode to allow multiple commands to be sent without starting and stopping all the time. Including the word "console" causes KScan3D to open up a command-line like console for the user to type in. Otherwise the calling application is responsible for managing the input and output pipes. Programming languages that can read / write the standard console input / output streams can use this interface (just ensure that all commands end with a newline (\n) character).

To test the interface we recommend using "KScan3D.exe interactive console"


script

Usage
script <script>
Example
script C:\Users\User\Documents\Scripts\MyScript.script

Runs a script file.


scriptline

Usage
scriptline <script>
Example
scriptline "a = 4"

Runs a line of script. Note: backslashes in path names will need to be escaped to work properly (replace "\" with "\\").


scriptquery

Usage
scriptquery <script variable>
Example
scriptquery "a"

Returns the value of the specified script variable.


exit

Usage
exit
Example
exit

Requests a clean shutdown from KScan3D and the end of interactive mode.


KScan3D DLL Interface

The KScan3D DLL allows the calling application to start an interactive session via any programming or scripting language that supports the loading up of DLL interfaces.


C API command functions


int KS3D_Init(const char* a_PathName)

a_PathName
Full path for the KScan3D executable.

Starts KScan3D in Interactive mode and connects to the input and output pipes to allow direct control over it. Must be called before any KS3D_Command calls. Returns KS3D_RESULT_OK on success, KS3D_RESULT_ERROR on failure.


int KS3D_Command(const char* a_Command)

a_Command
Any interactive command for KScan3D.

Sends the specified command to KScan3D and waits for it to reply that the task is completed. Returns KS3D_RESULT_OK if the command was successful, KS3D_RESULT_ERROR if the command was unsuccessful, and KS3D_RESULT_UNKNOWN if the command was not recognized.


int KS3D_CommandAsync(const char* a_Command)

a_Command
Any interactive command for KScan3D.

Sends the specified command to KScan3D and returns immediately. Always returns KS3D_RESULT_OK.


int KS3D_AsyncResult()

Used to check the result of an asynchronous command from KS3D_CommandAsync(). While the command is still running, this function will return KS3D_RESULT_EXECUTING. For multi-threaded applications, a "while(KS3D_CommandAsync()==KS3D_RESULT_EXECUTING)" loop can be used to determine when the command has completed.


const char* KS3D_ScriptQuery(const char* a_Query)

a_Query
A script variable name.

Queries KScan3D for the current value of a script variable. Returns the value of the variable as a string, or 0 (NULL) if the query failed. String variables are returned as-is, numbers are converted to a string representation before being returned, and nil values are returned as "nil".

Example: For script "a = 4 * 5", KS3D_ScriptQuery("a") returns "20".


int KS3D_Abort()

Used to abort a command while it is being executed, which can be useful for long operations. This can be used in multi-threaded applications when using KS3D_CommandAsync(). Always returns KS3D_RESULT_OK.


int KS3D_Exit()

Shuts down the communication pipes with KScan3D and terminates the application. Failure to call before terminating the calling application may result in data loss and/or error messages from KScan3D. Always returns KS3D_RESULT_OK.


Download


NEXT: Automation and Script Commands



Site Map

APIAbout KScan3DAligning Data
AutomationCombining MeshesCopyright Notice
Creating A Multi-Sensor Setup For Full Body ScanningEditing DataEnd User License Agreement
Exporting DataFAQFinalizing a Mesh
First StepsHardware RequirementsInstallation
KScan3D Driver SwitcherMain PageRelease Notes
Scanning BasicsScanning an ObjectThe Devices Interface
The Project InterfaceThe Settings InterfaceTroubleshooting
Tutorial VideosUsing Multiple Sensors
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox