Jump to content
ktbjx

How will you simulate a mouse click?

Recommended Posts

i am new on Autocad VBA, i found this code somewhere..

thsa what i need but i want to change the

SelectOnScreen part..

Here's the code:

Public Sub LineDetail()

Dim oSS As AcadSelectionSet

Dim oEntity As AcadEntity

Dim iFilterCode(0) As Integer

Dim vFilterValue(0) As Variant



 On Error Resume Next

 Application.ActiveDocument.SelectionSets("Lines").Delete

 On Error GoTo 0

 

 Set oSS = Application.ActiveDocument.SelectionSets.Add("Lines")

 iFilterCode(0) = 0: vFilterValue(0) = "Line"

 oSS.SelectOnScreen iFilterCode, vFilterValue

 If oSS.Count Then

   For Each oEntity In oSS

     Dim oLine As AcadLine

     Set oLine = oEntity

     With oLine

       MsgBox "StartPoint: " & .StartPoint(0) & ", " & .StartPoint(1) & ", " & .StartPoint(2) & vbCrLf & _

              "EndPoint  : " & .EndPoint(0) & ", " & .EndPoint(1) & ", " & .EndPoint(2)

     End With

   Next oEntity

 End If

End Sub

i think its this code that i need to change?

oSS.SelectOnScreen iFilterCode, vFilterValue

but IDK how, is there a way for me to atleast select the previous line i selected???

plus, the code loops when i select multiple lines..

i only want to select 1 LINE at a time...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×