CanvasApplication Object

The CanvasApplication object provides helper functions, information about 3D Canvas' current state and allows you to get the active Scene.

General GetGridDetails
  GetUnits
  GetPath
  GetSnapToMode
  GetSnapToObjectInterval
  GetSnapToPointInterval
  GetCanvasMode
  GetCanvasModeTime
  AddGroupCustomField
  GetGroupCustomFieldID
  AddObjectCustomField
  GetObjectCustomFieldID
  AddMaterialCustomField
  GetMaterialCustomFieldID
Scene GetActiveScene
Helper Functions RotatePoint
  FormatScientific
  FormatExport
  FormatExportMeters
  GetTexturePath
  GetMSTrainSimulatorUtilsPath
Import/Export ExportToDirectX
  ExportToMD2
  ExportToMSFlightSimulatorAircraft
  ExportToMSFlightSimulatorScenery
  ExportToMSTrainSimulator
  ExportToPOV
  ExportToRIB
  ExportToW3D
  ImportFromBioVision
Reserved GetCSG

 

GetPath

Gets the path of 3D Canvas.

Syntax

object.GetPath() as Variant

GetSnapToMode

Gets the current 3D Canvas snap-to mode.

Syntax

object.GetSnapToMode() as Variant

Remarks

0 = Never
1 = Edges
2 = Centers

GetSnapToObjectInterval

Gets the object snap-to interval.

Syntax

object.GetSnapToObjectInterval() as Variant

GetSnapToPointInterval

Gets the point snap-to interval.

Syntax

object.GetSnapToPointInterval() as Variant

GetCanvasMode

Gets the current mode of 3D Canvas.

Syntax

object.GetCanvasMode() as Variant

Remarks

0 = Standard Modelling Mode
1 = Animation Mode

GetCanvasModeTime

Gets the canvas mode's current time. This will always be 0 for Standard Modelling Mode.

Syntax

object.GetCanvasModeTime() as Variant

GetActiveScene

Gets the active scene.

Syntax

object.GetActiveScene() As CanvasScene

GetGridDetails

Gets details about 3D Canvas' grid.

Syntax

object.GetGridDetails(GridOriginX As Variant,
GridOriginY As Variant,
GridOriginZ As Variant,
GridSize As Variant,
GridInterval
As Variant)

GetUnits

Gets the units that 3D Canvas is using.

Syntax

object.GetUnits() As Variant

Remarks

0=Meters
1=Centimeters
2=Feet

RotatePoint

Rotates a Point around a given axis.

Syntax

object.RotatePoint(PointX As Variant,
PointY As Variant,
PointZ As Variant,
AxisX As Variant,
AxisY As Variant,
AxisZ As Variant,
Angle As Variant,
ResultPointX As Variant,
ResultPointY As Variant,
ResultPointZ
As Variant)

Remarks

Angle is in Radians. pi Radians = 180 Degrees.

FormatScientific

Translates the provided number into a scientific notation string appropriate for an export function.

Syntax

object.FormatScientific(Number As Variant) As Variant

Remarks

This function ensures that an export function always formats numbers in a correct way regardless of the regional settings of the computer. 3D File formats are universally stored using the English numbering style where "one and one half" is represented as "1.50". Microsoft Windows however outputs numbers using the regional settings of the computer. This will not work for most export formats since they often delimit items with commas.

FormatExport

Translates the provided number into a string appropriate for an export function.

Syntax

object.FormatExport(Number As Variant) As Variant

Remarks

This function ensures that an export function always formats numbers in a correct way regardless of the regional settings of the computer. 3D File formats are universally stored using the English numbering style where "one and one half" is represented as "1.50". Microsoft Windows however outputs numbers using the regional settings of the computer. This will not work for most export formats since they often delimit items with commas.

FormatExportMeters

Translates the provided number from 3D Canvas modeller units into meters and then into a string appropriate for an export function.

Syntax

object.FormatExportMeters(Number As Variant) As Variant

Remarks

This function ensures that an export function always formats numbers in a correct way regardless of the regional settings of the computer. 3D File formats are universally stored using the English numbering style where "one and one half" is represented as "1.50". Microsoft Windows however outputs numbers using the regional settings of the computer. This will not work for most export formats since they often delimit items with commas.

GetTexturePath

Gets the full path for the supplied texture file name.

Syntax

object.GetTexturePath(TextureFileName As Variant) As Variant

GetMSTrainSimulatorUtilsPath

Gets the path to the Microsoft Train Simulator "Utils" folder where modelling utilities are located.

Syntax

object.GetMSTrainSimulatorUtilsPath() As Variant

ExportToDirectX

Exports the group, all child groups and child objects to a DirectX file.

Syntax

object.ExportToDirectX(ExportGroup as Object,
Filename as Variant,
IncludeAnimation as Variant,
IncludeRootAnimation as Variant,
IncludeSkeleton
as Variant,
SilentExport as Variant)

ExportToMSTrainSimulator

Exports the group, all child groups and child objects to a Microsoft Train Simulator file.

Syntax

object.ExportToMSTrainSimulator(ExportGroup as Object,
Filename as Variant,
DistanceLevels as Variant,
IgnoreObjects as Variant,
ConsolidateSubObjects as Variant)

Remarks

DistanceLevels must be 1, 2 or 6. IgnoreObjects is a string that specifies the name group that should be excluded from export. This permits placeholder objects to be used within 3D Canvas that will not be exported to Microsoft Train Simulator. For example if IgnoreObjects is set to "MSTSPlaceholder", any object whose names begin with "MSTSPlaceholder" would not be exported. When set to 1 ConsolidateSubObjects results in 3D Canvas consolidated sub-objects on export. This is the most efficient export method. When set to 0 it results in 3D Canvas exporting sub-objects. Sub-objects are typically only required for signal creation.

GetCSG

Reserved for the use of Amabilis Software.

ExportToMD2

Exports the object to an MD2 file.

Syntax

object.ExportToMD2(ExportObject as Object,
ExportGroup as Object,
Filename as Variant)

ExportToMSFlightSimulatorAircraft

Exports the group, all child groups, and child objects to a Microsoft Flight Simulator Aircraft file.

Syntax

object.ExportToMSFlightSimulatorAircraft(ExportGroup as Object,
Filename as Variant)

ExportToMSFlightSimulatorScenery

Exports the group, all child groups, and child objects to a Microsoft Flight Simulator Scenery file.

Syntax

object.ExportToMSFlightSimulatorScenery(ExportGroup as Object,
Filename as Variant)

ExportToPOV

Exports the group, all child groups, and child objects to a POVRay file.

Syntax

object.ExportToPOV(ExportGroup as Object,
Filename as Variant)

ExportToRIB

Exports the group, all child groups, and child objects to a RIB file.

Syntax

object.ExportToRIB(ExportGroup as Object,
Filename as Variant)

ExportToW3D

Exports the group, all child groups, and child objects to an W3D file.

Syntax

object.ExportToW3D(ExportGroup as Object,
Filename as Variant)

ImportFromBioVision

Imports a BioVision File.

Syntax

object.ImportFromBioVision(Filename as Variant)

AddGroupCustomField

Creates a custom CanvasGroup field.

Syntax

object.AddGroupCustomField(CustomFieldName As Variant) As Variant

Remarks

Returns the custom field value required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasGroup object.

GetGroupCustomFieldID

Gets the identifier associated with a custom CanvasGroup field name.

Syntax

object.GetGroupCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasGroup object.

The custom field name may, or may not exist. If it does not exist -1 will be returned.

AddObjectCustomField

Creates a custom CanvasObject field.

Syntax

object.AddObjectCustomField(CustomFieldName As Variant) As Variant

Remarks

Returns the custom field value required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasObject object.

GetObjectCustomFieldID

Gets the identifier associated with a custom CanvasObject field name.

Syntax

object.GetObjectCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasObject object.

The custom field name may, or may not exist. If it does not exist -1 will be returned.

AddMaterialCustomField

Creates a custom CanvasMaterial field.

Syntax

object.AddMaterialCustomField(CustomFieldName As Variant) As Variant

Remarks

Returns the custom field value required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasMaterial object.

GetMaterialCustomFieldID

Gets the identifier associated with a custom CanvasMaterial field name.

Syntax

object.GetMaterialCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field from an object using the GetCustomFieldValue/SetCustomFieldValue methods of the CanvasMaterial object.

The custom field name may, or may not exist. If it does not exist -1 will be returned.