×
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

Catia VBA - how to determine if an object is hidden

Catia VBA - how to determine if an object is hidden

Catia VBA - how to determine if an object is hidden

(OP)
What I would like to do: determine if an object is "hidden" or not.

I cannot seem to find the correct property for an object that specifies whether or not it is "hidden". As you can see below, there is a property available under .Application.Visible but that value is always true...

Is there a "visibility" property for objects that can be used? For example if I search in catia, specifying the attribute of visibility = hidden, this performs exactly as I desire.

code:

Dim part As part
Set part = partDocument.part
Dim myBodiesList As hybridBodies
Set myBodiesList = part.hybridBodies

For Each myBody In myBodiesList
If myBody.hybridBodies.Count = 0 Then
Set myShapesList = myBody.HybridShapes
GetShapes myShapesList
ElseIf myBody.Application.Visible Then
GetMyHybridBodies_PutInList myBody
End If
Next myBody

RE: Catia VBA - how to determine if an object is hidden

Hi

Recorded CATScript, selecting all hidden objects.

Language="VBSCRIPT"

CODE --> CATScript

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "Visibility=Invisible,all"

End Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: Catia VBA - how to determine if an object is hidden

you can use Selection.VisProperties.GetShow to get the status of show/noshow

Eric N.
indocti discant et ament meminisse periti

RE: Catia VBA - how to determine if an object is hidden


CODE -->

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 

______

Alex ,

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