×
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

Hiding annotations

Hiding annotations

Hiding annotations

(OP)
Does anyone have a Macro that hides annotation sets in top level assemblies, we are spending a lot of time open sub assemblies in large products to hide the text blocks and general notes, and am hoping someone has created a script that would allow us to do this at the top level product?

Thanks hopefully in advance.

Mark

RE: Hiding annotations

work around on that
just record a macro to see how it hides annotations

CODE --> catscript

Sub CATMain()
 
Set  ProductDocument1 = CATIA.ActiveDocument
 
Set Product1 = ProductDocument1. Product
 
Dim ProductDoc1_As_Document
Set ProductDoc1 = Catia.ActiveDocument
 
Dim Selection1_As_Selection
Set Selection1 = ProductDoc1.Selection
 
Product1.ApplyWorkMode DESIGN_MODE
 
selection1.Search "CATAsmSearch.MfConstraint,scr" 'hide Constrains
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
'~ Selection1.Search "CatPrtSearch.Surface,All"       'hide Surfaces
'~ Set visPropertySet1 = Selection1.visProperties
'~ VisPropertySet1.SetShow 1
'~ Selection1.Clear
 
Selection1.Search "CatPrtSearch.AxisSystem,All"      
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.AxisSystem.Name=Axis' 'System*,All"
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.Line,All"            'hide lines
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.Curve,All"             'hide curves
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.Sketch,All"             'hide sketches
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.Point,All"                'hide points
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
Selection1.Search "CatPrtSearch.Plane,All"                'hide planes
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1
Selection1.Clear
 
'~ selection1.Search "CATGmoSearch.OpenBodyFeature,all"        'hide geometrical set
'~ Set visPropertySet1 = Selection1.visProperties
'~ VisPropertySet1.SetShow 1
'~ Selection1.Clear
 
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
 
Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
 
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
 
viewer3D1.Reframe 
Set viewpoint3D1 = viewer3D1.Viewpoint3D
 
 
Set MyWindow = CATIA.ActiveWindow
Set MyViewer = MyWindow.ActiveViewer
 
End Sub 

RE: Hiding annotations

Hi,

I remember this macro smile ...but I believe is not what is need it...

Try this

CODE --> catvbs

Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set selection3 = productDocument1.Selection
selection3.Search "Name=*Annotation*,all"
Set selection4 = productDocument1.Selection
Set visPropertySet1 = selection4.VisProperties
Set visPropertySet1 = visPropertySet1.Parent
visPropertySet1.SetShow 1
selection4.Clear 
End Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: Hiding annotations

(OP)
Ferdo,

Thanks for that have tried both Macros but am getting a message "stating the script entry point entry point could not be found Define a CATMAIN procedure which will be the entry point of the script.

What does this mean? should I put something in the brackets at the top of the script?

Mark

RE: Hiding annotations

(OP)
Ferdo, Correct all sorted now and functioning great.

Thanks

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