Scripting File Import Export

Prerequisites

  • The following methods are exposed by the ImportExport object implemented by the module Thinkbox.Sequoia.Conversion

  • Before calling these methods, you must ensure the module is imported.

import Thinkbox.Sequoia.Conversion 1.0

Methods

<String> ImportExport.convertPointFile ( <QUrl>input, <QUrl>output )

  • Converts the input point file supplied as first argument to the point file supplied as second argument.

  • The file extension of the output file defines the target file format.


<void> ImportExport.exportMesh ( <String>nodeId, [<String>worldspace=”World”], [<QUrl>filename=””], [<String>documentId=””] )

  • Exports the mesh of a Mesher or Mesh Loader object.

  • The first argument is the node ID of the object to be exported.

  • The second, optional argument is a string defining the export space:

    • World : World Space (default),

    • UCS : UCS Space,

    • Object : Object Space

  • The third, optional argument is the file name to save to.

    • If not specified or set to empty string “”, a file dialog will pop up so the user can provide the file name interactively.

  • The fourth, optional argument is the document ID of the Document to export from.

    • When not specified or set to empty string “”, the Active Document will be used.


<void> ImportExport.exportHacksawMesh ( <bool>worldspace, <String>nodeId, [<String>filename=””], [<String>documentId=””] )

  • Exports the Mesher as multiple Partitions using the Hacksaw feature.

  • The first boolean argument controls the World vs. UCS space mode:

    • true : World Space,

    • false : UCS Space

  • The second argument is the node ID of the object to be exported.

  • The third, optional argument is the file name to save to.

    • If not specified or set to empty string “”, a file dialog will pop up so the user can provide the file name interactively.

  • The fourth, optional argument is the document ID of the Document to export from.

    • When not specified or set to empty string “”, the Active Document will be used.


<void> ImportExport.exportPoints ( <bool>worldspace, <String>nodeId, [<QUrl>filename=””], [<String>documentId=””] )

  • Exports the points of a Point Loader, Point Region Of Interest, or Surface Points object.

  • The first boolean argument controls the World vs. Object space:

    • true : World Space,

    • false : Object Space

  • The second argument is the node ID of the object to be exported.

  • The third, optional argument is the file name to save to.

    • If not specified or set to empty string “”, a file dialog will pop up so the user can provide the file name interactively.

  • The fourth, optional argument is the Document ID of the Document to export from.

    • When not specified or set to empty string “”, the Active Document will be used.


<String> ImportExport.openSaveFileDialog ( <String>caption, <String>dir, <String>filter )

  • Opens a Save File dialog.

  • The first string argument defines the caption of the dialog.

  • The second string argument defines the initial directory to open in.

  • The third string argument defines the file format filter string.

  • Returns the file name specified via the dialog, or an empty string “” if cancelled.


<void> ImportExport.saveTextFile ( <String>data, <QUrl>dir )

  • Saves string data to a text file.

  • The first argument defines the string data to be saved.

  • The second argument specifies the filename of the text file.


<String> ImportExport.loadTextFile (<QUrl>dir);

  • Loads the content of a text file and returns it as a string value.

  • The argument specifies the filename of the text file to load from.