×
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 hide/unhide annotations under a specific camera ?

How to hide/unhide annotations under a specific camera ?

How to hide/unhide annotations under a specific camera ?

(OP)
I like to hide/unhide all the annotations under specific Camera name("Camera 1").
I want to active a particular camera but i am not sure of exact code.
Kindly help me.

Regards,
Ganesh vivek

RE: How to hide/unhide annotations under a specific camera ?

(OP)
Hi,

Please see the example code.

Sub Main()
Dim partDocument1 As PartDocument
Dim part1 As Part
Dim parameters1 As Parameters
Dim annotationSets1 As AnnotationSets
Dim annotationSet1 As AnnotationSet
Dim annotations1 As Annotations
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(1)
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 = 1 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
If name = "All Annotations" Then
oCapture.DisplayCapture
Dim Cameras1 As Cameras
Set Cameras1 = partDocument1.Cameras
Count = Cameras1.Count
For j = 1 To Count
Dim Cam As Camera
Set Cam = Cameras1.Item(j)
CamName = Cam.name
If CamName = name Then
Cameras1.Remove (j)
Exit For
End If
Next


'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



'************************************************************************************
'this section is where I am trying to active the "tolerancing Capture" workbench to I can Capture the changes on the screen
MyCamera.ActiveCamera
'oCapture.ViewPoint MyCamera
'oCapture.ManageHideShowBody = True
Set annotations1 = annotationSet1.Annotations
annotations1count = annotations1.Count
For l = 1 To annotations1count
Set annotation1 = annotations1.Item(l)
selection1.Add annotation1
Dim visPropertySet1 As VisPropertySet
Set visPropertySet1 = selection1.VisProperties
'
visPropertySet1.SetShow 1
selection1.Clear


selection1.Clear
Next

CATIA.StartCommand "set Current"

CATIA.StartCommand "UnSet Current"
part1.Update
Clear.selection1
End If
Else
Err.Clear
End If
On Error GoTo 0
Next
End If

part1.Update


End Sub

Regards,
Ganesh vivek

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