×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to activate Annotation Capture thru a macro

How to activate Annotation Capture thru a macro

How to activate Annotation Capture thru a macro

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources