Jump to content


Selecting with mouse drag in VB.NET


  • You cannot reply to this topic
No replies to this topic

#1 Mucip İLBUĞA

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 08 July 2024 - 04:04 PM

Hi,
I can select the one object with below code. Well How can I select more than one objects with draging mouse click?

Dim nesne As AcadEntity
Dim nokta As Object

utilty.GetEntity(nesne, nokta, "Nesneyi seçin")




Regards,
Mucip:)

#2 Dsw

    Member

  • Members
  • PipPip
  • 23 posts
  • LocationItaly

Posted 09 July 2024 - 03:48 AM

Hi,
the method "GetEntity" is nice to use if you would like to select only one entity, a better solution is to use "SelectionSet" which have more options.

Regards
Rossano Praderi
----
My open-source and freeware projects
https://sourceforge....ftware/profile/

#3 Mucip İLBUĞA

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 09 July 2024 - 07:16 AM

Hi,
In which help document can I get information about SelectionSet?

Regards,
Mucip:)

#4 Mucip İLBUĞA

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 09 July 2024 - 08:26 PM

Hi,
I found solution. ;)

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
		Dim filterType(0) As Integer
		Dim filterData(0) As Object
		Dim cizgi As AcadEntity
	  
		Try
			ncDoc.SelectionSets("PP1").Delete()
		Catch ex As Exception
		End Try
		filterType(0) = 0
		filterData(0) = "line"
		Dim ssetObj As SelectionSet
		ssetObj = ncDoc.SelectionSets.Add("PP1")

		ssetObj.SelectOnScreen(filterType, filterData)
		If ssetObj.Count < 1 Then
			MsgBox("Hiçbir şey seçilmedi! İşlem sonlanıyor. ", MsgBoxStyle.Critical, "Hata!!")
			Exit Sub
		End If
		Dim lin As AcadLine
		For Each cizgi In ssetObj
			lin = cizgi
			Console.WriteLine(lin.EntityName)
		Next

	End Sub

Regards,
Mucip:)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users