I need to re-capture the screen in the annotation workbench based on different size to the part, which has different dimension that belongs to that specific size. Thus requiring re-capturing the screeen with the approriate dimensions and hiding the rest. I have the following code in action that's driven by a reaction based on a parameter called Triger. What is not working is the section that can activate "Tolerancing Capture" Workbench that can't find any help from DS
Sub Main()
Dim partDocument1 As PartDocument
Dim part1 As Part
Dim parameters1 As Parameters
Dim annotationSets1 As AnnotationSets
Dim annotationSet1 As AnnotationSet
Dim annotation1 As Annotation
Dim intParam1 As IntParam
Dim oCapture As Capture
Dim selection1 As Selection
Dim name As String
Dim wrkbench As Workbench
Dim name1 As AnyObject
Dim oToleranceZone As ToleranceZone
Dim capture1 As Capture
Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Set parameters1 = part1.Parameters
Set annotationSets1 = part1.AnnotationSets
Set annotationSet1 = annotationSets1.Item("FTA ANNOTATION SET")
partDocument1.Selection.Clear
Set intParam1 = parameters1.Item("TRIGER")
Dim ID As String
'Dim viewer3D1 As cap
Dim viewpoint3D1 As Viewpoint3D
Dim MyCamera As Camera3D
If annotationSets1.Count > 0 Then
For i = 6 To annotationSet1.Captures.Count
On Error Resume Next
Set oCapture = annotationSet1.Captures.Item(i)
' Set annotation1 = oCapture.Annotations
If Err.Number = 0 Then
Set selection1 = partDocument1.Selection
name = oCapture.name
selection1.Search "Name=" & name
intParam1.Value = i
oCapture.DisplayCapture
'Set oCapture = annotationSet1.CaptureFactory.CreateCapture
Set MyCamera = CATIA.ActiveWindow.ActiveViewer.NewCamera()
MyCamera.Viewpoint3D.Zoom = 0.02
CATIA.ActiveWindow.ActiveViewer.Viewpoint3D = MyCamera.Viewpoint3D
MyCamera.name = name
CreateCapture
'************************************************************************************
'this section is where I am trying to active the "tolerancing Capture" workbench to I can Capture the changes on the screen
MyCamera.ActiveCamera
CATIA.StartCommand "set Current"
CATIA.StartCommand "UnSet Current"
part1.Update
Clear.selection1
Else
Err.Clear
End If
On Error GoTo 0
Next
End If
selection1.Search "Name=SECTION VIEW"
CATIA.StartCommand "Display Capture"
part1.Update
End Sub
Any help will be appreciated
Sub Main()
Dim partDocument1 As PartDocument
Dim part1 As Part
Dim parameters1 As Parameters
Dim annotationSets1 As AnnotationSets
Dim annotationSet1 As AnnotationSet
Dim annotation1 As Annotation
Dim intParam1 As IntParam
Dim oCapture As Capture
Dim selection1 As Selection
Dim name As String
Dim wrkbench As Workbench
Dim name1 As AnyObject
Dim oToleranceZone As ToleranceZone
Dim capture1 As Capture
Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Set parameters1 = part1.Parameters
Set annotationSets1 = part1.AnnotationSets
Set annotationSet1 = annotationSets1.Item("FTA ANNOTATION SET")
partDocument1.Selection.Clear
Set intParam1 = parameters1.Item("TRIGER")
Dim ID As String
'Dim viewer3D1 As cap
Dim viewpoint3D1 As Viewpoint3D
Dim MyCamera As Camera3D
If annotationSets1.Count > 0 Then
For i = 6 To annotationSet1.Captures.Count
On Error Resume Next
Set oCapture = annotationSet1.Captures.Item(i)
' Set annotation1 = oCapture.Annotations
If Err.Number = 0 Then
Set selection1 = partDocument1.Selection
name = oCapture.name
selection1.Search "Name=" & name
intParam1.Value = i
oCapture.DisplayCapture
'Set oCapture = annotationSet1.CaptureFactory.CreateCapture
Set MyCamera = CATIA.ActiveWindow.ActiveViewer.NewCamera()
MyCamera.Viewpoint3D.Zoom = 0.02
CATIA.ActiveWindow.ActiveViewer.Viewpoint3D = MyCamera.Viewpoint3D
MyCamera.name = name
CreateCapture
'************************************************************************************
'this section is where I am trying to active the "tolerancing Capture" workbench to I can Capture the changes on the screen
MyCamera.ActiveCamera
CATIA.StartCommand "set Current"
CATIA.StartCommand "UnSet Current"
part1.Update
Clear.selection1
Else
Err.Clear
End If
On Error GoTo 0
Next
End If
selection1.Search "Name=SECTION VIEW"
CATIA.StartCommand "Display Capture"
part1.Update
End Sub
Any help will be appreciated