Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

[Macro CATIA] State of a drawing view

Status
Not open for further replies.

sigmacoder

Mechanical
Joined
Mar 16, 2013
Messages
30
Location
MA
Hello,

How can i know if a drawing view is hidden or not using VBA Code?

thank you!
 
Code:
Sub Ask_Hidden()

Set drawingDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection

Set drawingSheets1 = drawingDocument1.Sheets

Set drawingSheet1 = drawingSheets1.Item("Sheet.1")

Set drawingViews1 = drawingSheet1.Views


For i = 3 To drawingViews1.Count

Set drawingView1 = drawingViews1.Item(i)

selection1.Clear

selection1.Add drawingView1

Dim showstate As CatVisPropertyShow
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties

 visProperties1.GetShow showstate
 
Select Case showstate
 
Case catVisPropertyNoShowAttr
MsgBox "Hidden View"
Case catVisPropertyShowAttr
MsgBox "visible View"

End Select

Next

End Sub

improve to your needs..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top