Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding annotations 1

Status
Not open for further replies.

markwindsurf

Automotive
Nov 2, 2009
24
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
 
Replies continue below

Recommended for you

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

Code:
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
 
Hi,

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

Try this

Code:
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

- Romania
- EU
 
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
 
Ferdo, Correct all sorted now and functioning great.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor