cancel
Showing results for 
Search instead for 
Did you mean: 

How to get visible points in Drawing

Pioneer
Pioneer

Hello,

 

I have created one view with multiple points in it.

 

Some of them are hidden and some of them are visible.

So how to get only visible points from active view?

5 REPLIES

Re: How to get visible points in Drawing

Honored Contributor
Honored Contributor

One solution would be to use the .AskVisibleObjects method then iterate through the returned objects, looking for point objects.

Re: How to get visible points in Drawing

Valued Contributor
Valued Contributor

Hi Bhavik,

 

Please follow the below code.

 

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display


For Each MyPoint As Point In workPart.Points
If MyPoint.Visibility = SmartObject.VisibilityOption.visible Then
msgbox("got you")

'Do your stuff....

End If
Next

 

Hope it helps.

 

Regards,

Abhi

Re: How to get visible points in Drawing

Valued Contributor
Valued Contributor

Hi Bhavik,

 

yes, Hope I got the solution.

 

try this,

 

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display


For Each po As Point In workPart.Points
If po.IsBlanked = False Then
MsgBox("got you")

'Do your stuff....

End If
Next

 

Please let me know if it works,

 

Regards,

Abhi

 

Re: How to get visible points in Drawing

Pioneer
Pioneer

Hi Cowski,

 

Thanks for the help.

Now i am getting required result.

Re: How to get visible points in Drawing

Pioneer
Pioneer

Hi Abhi,

 

yes, your method is also working as expected.

 

And I have used below method.

Dim tempPoint As Point
Dim DispObjs() As DisplayableObject
DispObjs = View.AskVisibleObjects()


For Each tempobj As DisplayableObject In DispObjs
If TypeOf tempobj Is Point Then
tempPoint = tempobj
' MsgBox(tempobj.Name)
End If
Next