Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to check solid visibility in VB ?

Status
Not open for further replies.

PSI-CAD

Computer
Feb 13, 2009
997
Hi,

In the below code, I didn't succeed to test the solid visibility. Something is wrong in the syntax NXOpen.SmartObject.VisibilityOption.Visible....

Thanks in advance to help me


For Each body In bodies
If body.name = solide1 Then
objects1(0) = body
If NXOpen.SmartObject.VisibilityOption.Visible(solide1) Then
'
s.DisplayManager.BlankObjects(objects1)
Else
'
s.DisplayManager.ShowObjects(objects1, DisplayManager.LayerSetting.ChangeLayerToSelectable)
End If
End If
Next body

Regards
Didier Psaltopoulos
 
Replies continue below

Recommended for you

The visibility option as shown in your code above only applies to smart objects, not all graphical objects in the display. There are a number of factors that affect object visibility within a part, the 2 main ones are the hidden status (.IsBlanked) and the object's layer visibility. The .AskVisibleObjects method is also useful; it is made for drafting views, but also gives some information on modeling views.

www.nxjournaling.com
 
Hi Cowski,

Thanks

I found the solution with the following code

For Each body In bodies
If body.name = solide1 Then
objects1(0) = body
Dim disProps As UFObj.DispProps

ufs.Obj.AskDisplayProperties(objects1(0).Tag, disProps)

If disProps.blank_status = UFConstants.UF_OBJ_BLANKED Then
' la ligne ci-dessous sert à afficher
s.DisplayManager.ShowObjects(objects1, DisplayManager.LayerSetting.ChangeLayerToSelectable)
Else
' la ligne ci-dessous sert à cacher
s.DisplayManager.BlankObjects(objects1)
End If
End If
Next body


Regards
Didier Psaltopoulos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor