Changing an Objects Visibility

Use the Visible property to set whether a drawing object is visible or not. This method is also available to the Application, Group, and Toolbar objects, although for a Group it is write-only. Set this property True to make an object visible, and False to hide it. Making an object invisible can be useful for performing complex entity creation or modification tasks. This property has the following syntax:

Object.Visible = blnVisible

The following example shows how to implement this method. It hides, and then makes visible, an object.

Public Sub ToggleVisibility()

Dim objDrawingObject As AcadEntity Dim varEntityPickedPoint As Variant

On Error Resume Next

ThisDrawing.Utility.GetEntity objDrawingObject, varEntityPickedPoint, _

"Choose an object to toggle visibility: " If objDrawingObject Is Nothing Then

MsgBox "You did not choose an object" Exit Sub End If objDrawingObject.Visible = False objDrawingObject.Update

MsgBox "The object was made invisible!"

objDrawingObject.Visible = True objDrawingObject.Update

MsgBox "Now it is visible again!"

End Sub

Note Other factors, such as whether the object's layer is frozen or turned off, can override this property.

Was this article helpful?

0 0
100 Bowling Tips

100 Bowling Tips

Playing bowling with your friends can help you decide if it is indeed the hobby that you want to invest your time on today. Aside from that, it can help you get a better feel of the sport. More importantly, when you play with your friends, it would become a more fun activity, which you can look forward to each week.

Get My Free Ebook

Post a comment