May 1, 2005
at 5:27 pm /
#11049
Okay…I couldn’t find much in the way of online documentation for automation errors, so I’d like people to test this script and let me know if they receive the same automation error.
[pre class=’ip-ubbcode-code-pre’]
Language = VBScript
Option Explicit
‘***********************************************
‘Tests the SetOrientation command
‘***********************************************
Dim Scene
Dim SceneGroup
Dim ActiveObjectCount
Dim OriginalMesh
Dim OriginalMeshName
Dim OriginalGroup
Dim ox
Dim oy
Dim oz
Sub Main (3DCApp)
‘get the scene
Set Scene = 3DCApp.GetActiveScene
‘get the active object count
ActiveObjectCount = Scene.GetActiveObjectCount
‘only proceed if there is an active object
If ActiveObjectCount = 0 Then
MsgBox ‘Please select an object.’
Else
Set OriginalMesh = Scene.GetActiveObject(0)
Set OriginalGroup = OriginalMesh.GetParentGroup
ox = InputBox(‘Select X orientation (must be between -1 and 1)’, ‘SetOrientation Test’, ‘0’)
oy = InputBox(‘Select Y orientation (must be between -1 and 1)’, ‘SetOrientation Test’, ‘1’)
oz = InputBox(‘Select Z orientation (must be between -1 and 1)’, ‘SetOrientation Test’, ‘0’)
OriginalGroup.SetOrientation Nothing, 0, ox, oy, oz, ox, oy, oz
End If ‘end checking for active objects
End Sub
[/pre]
If it fails for me but works for others, then odds are it’s a problem with my system. But if it fails for everyone else, chances are it’s either a problem with the script or a problem with 3DC itself.
Let me know if it works for you.
Instructions: First select an object, then run this script on it, following the prompts. If the values aren’t changed, nothing different should happen. But if you enter different values, then the object and its group bounding box should be rotated appropriately.
-Mel