CSScene Object

The CSScene Object represents a 3DCrafter Scene. It provides functions to modify the scene, general purpose helper functions, and functions that provide information about 3DCrafter's current state.

Groups CreateGroup
  GetRootGroup
  GetGroupCount
  GetGroup
  GetBoneCount
  GetBone
Shapes CreateShape
  GetShapeCount
  GetShape
Cameras GetCameraCount
  GetCamera
Materials CreateMaterial
shape Selection GetSelectedBonesCount
  GetSelectedBone
  GetSelectedCamerasCount
  GetSelectedCamera
  GetSelectedGroupsCount
  GetSelectedGroup
  GetSelectedLightsCount
  GetSelectedLight
  GetSelectedShapeCount
  GetSelectedShape
General GetAnimationKeyFrameCount
  SetAnimationKeyFrameCount
  GetAnimationKeyFPS
  SetAnimationKeyFPS
  GetGridDetails
  GetUnits
  GetSnapToMode
  GetSnapToShapeInterval
  GetSnapToPointInterval
  GetApplicationMode
  GetApplicationModeTime
  GetGroupCustomFieldID
  GetShapeCustomFieldID
  GetMaterialCustomFieldID
Helper Functions RotatePoint
  FormatScientific
  FormatExport
  FormatExportMeters
  FindFile

 

GetSnapToMode

Gets the current 3DCrafter snap-to mode.

Syntax

shape.GetSnapToMode() as Variant

Remarks

0 = Never
1 = Edges
2 = Centers

GetSnapToShapeInterval

Gets the shape snap-to interval.

Syntax

shape.GetSnapToShapeInterval() as Variant

GetSnapToPointInterval

Gets the point snap-to interval.

Syntax

shape.GetSnapToPointInterval() as Variant

GetApplicationMode

Gets the current mode of 3DCrafter.

Syntax

shape.GetApplicationMode() as Variant

Remarks

0 = Standard Modelling Mode
1 = Animation Mode

GetApplicationModeTime

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

Syntax

shape.GetApplicationModeTime() as Variant

GetGridDetails

Gets details about 3DCrafter's grid.

Syntax

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

GetUnits

Gets the units that 3DCrafter is using.

Syntax

shape.GetUnits() As Variant

Remarks

0=Meters
1=Centimeters
2=Feet

RotatePoint

Rotates a Point around a given axis.

Syntax

shape.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

shape.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

shape.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 3DCrafter modeller units into meters and then into a string appropriate for an export function.

Syntax

shape.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.

FindFile

Gets the full path for the supplied file name. 3DCrafter will return the path of the first file that matches the provided name within 3DCrafter's standard list of search paths.

Syntax

shape.FindFile(FileName As Variant) As Variant

GetGroupCustomFieldID

Gets the identifier associated with a custom CSGroup field name.

Syntax

shape.GetGroupCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field using the GetCustomFieldValue/SetCustomFieldValue methods of the CSGroup shape.

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

GetShapeCustomFieldID

Gets the identifier associated with a custom CSShape field name.

Syntax

shape.GetShapeCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field using the GetCustomFieldValue/SetCustomFieldValue methods of the CSShape shape.

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

GetMaterialCustomFieldID

Gets the identifier associated with a custom CSMaterial field name.

Syntax

shape.GetMaterialCustomFieldID(CustomFieldName As Variant) As Variant

Remarks

This provides the identifier required to get/set the value of a custom field using the GetCustomFieldValue/SetCustomFieldValue methods of the CSMaterial shape.

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

 

GetRootGroup

Gets the CSGroup shape that is the root group of the scene.

Syntax

shape.GetRootGroup() As CSGroup

GetGroupCount

Gets the number of CSGroup shapes in the scene.

Syntax

shape.GetGroupCount() As Variant

GetGroup

Gets the specified CSGroup shape.

Syntax

shape.GetGroup(Index As Variant) As CSGroup

CreateGroup

Creates a CSGroup shape.

Syntax

shape.CreateGroup() As CSGroup

Remarks

The group is not added to the scene until it is added as a child to another group using the AddChild method.

GetBoneCount

Gets the number of CSGroup shapes in the scene that behave as bones.

Syntax

shape.GetBoneCount() As Variant

Remarks

In 3DCrafter bones are separate shapes, but in the 3DCrafter API bones are simply groups that have been enabled to affect points as they are moved.

GetBone

Gets the specified CSGroup shape in the scene that behaves as a bone.

Syntax

shape.GetBone(Index As Variant) As CSGroup

Remarks

In 3DCrafter bones are separate shapes, but in the 3DCrafter API bones are simply groups that have been enabled to affect points as they are moved.

GetCameraCount

Gets the number of CSCamera shapes in the scene.

Syntax

shape.GetCameraCount() As Variant

GetCamera

Gets the specified CSCamera shape.

Syntax

shape.GetCamera(Index As Variant) As CSCamera

GetSelectedGroupsCount

Gets the number of selected CSGroup shapes in the Scene.

Syntax

shape.GetSelectedGroupsCount() As Variant

GetSelectedGroup

Gets the specified selected CSGroup shape.

Syntax

shape.GetSelectedGroup(Index As Variant) As CSGroup

GetSelectedBonesCount

Gets the number of active CSGroup shapes in the scene that behave as bones.

Syntax

shape.GetSelectedGroupsCount() As Variant

Remarks

In 3DCrafter bones are separate shapes, but in the 3DCrafter API bones are simply groups that have been enabled to affect points as they are moved.

GetSelectedBone

Gets the specified selected CSGroup shape in the scene that behaves as a bone.

Syntax

shape.GetSelectedGroup(Index As Variant) As CSGroup

Remarks

In 3DCrafter bones are separate shapes, but in the 3DCrafter API bones are simply groups that have been enabled to affect points as they are moved.

GetSelectedLightsCount

Gets the number of selected CSLight shapes in the Scene.

Syntax

shape.GetSelectedLightsCount() As Variant

GetSelectedLight

Gets the specified selected CSLight shape.

Syntax

shape.GetSelectedLight(Index As Variant) As CSLight

GetSelectedCamerasCount

Gets the number of selected CSCamera shapes in the Scene.

Syntax

shape.GetSelectedCamerasCount() As Variant

GetSelectedCamera

Gets the specified selected CSCamera shape.

Syntax

shape.GetSelectedCamera(Index As Variant) As CSCamera

CreateShape

Creates a CSShape shape.

Syntax

shape.CreateShape() As CSShape

Remarks

The shape is not added to the scene until it is added to a group using the AddShape method.

GetSelectedShapesCount

Gets the number of active CSShape shapes in the scene.

Syntax

shape.GetSelectedShapesCount() As Variant

GetSelectedShape

Gets the specified active CSShape shape.

Syntax

shape.GetSelectedShape(Index As Variant) As CSShape

GetShapeCount

Gets the number of CSShape shapes in the scene.

Syntax

shape.GetShapeCount() As Variant

GetShape

Gets the specified CSShape shape.

Syntax

shape.GetShape(Index As Variant) As CSShape

GetLightCount

Gets the number of CSLight shapes in this group.

Syntax

shape.GetLightCount() As Variant

GetLight

Gets the specified CSLight shape.

Syntax

shape.GetLight(Index As Variant) As CSLight

CreateMaterial

Creates a CSMaterial shape. This material will be filled in with the current material from 3DCrafter's Material Palette. You may change these material parameters programmatically.

Syntax

shape.CreateMaterial() As CSMaterial

GetAnimationKeyFrameCount

Gets the number of animation key-frames in the scene.

Syntax

shape.GetAnimationKeyFrameCount() As Variant

SetAnimationKeyFrameCount

Sets the number of animation key-frames in the scene.

Syntax

shape.SetAnimationKeyFrameCount(AnimationKeyFrameCount As Variant)

GetAnimationKeyFPS

Gets the number of animation key-frames per second for the scene.

Syntax

shape.GetAnimationKeyFPS() As Variant

SetAnimationKeyFPS

Sets the number of animation key-frames per second for the scene.

Syntax

shape.SetAnimationKeyFPS(AnimationKeyFPS As Variant)