Message 1 of 3
How to use selected objects

Not applicable
07-14-2008
11:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear friends,
here it is a code to select some lines with a section on screen
after selecting the lines , I want to get the start point of every line and the end point
but the VBA has a limitation to make that
look at this code :
Dim ret As Boolean
Me.Hide
ret = AddingSelectionSetNamedThisName("HorizontalLines")
ThisDrawing.Utility.prompt vbCrLf & " Select Horizontal Lines :"
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
FilterType(0) = 0
FilterData(0) = "line" '"line" ' "3dface" , and so on
SSObject.SelectOnScreen FilterType, FilterData
SSObject.Highlight True
Dim i As Long
Dim LineOptained As AcadObject
Dim LineOptainedHandle As Long
Dim StartPoint As Variant
''Dim EndPoint As Variant
For Each LineOptained In SSObject 'or ThisDrawing.ModelSpace
LineOptainedHandle= LineOptained.Handle
StartPoint = LineOptained.startPoint
i = i + 1
Next
Me.Show
end sub
===========================
the results:
==========
the handle or length of any horizontal line will be determined
but other properties of a line object no
how to get some important properties of the acadEntity selected by the user on screen
like maxPoint, minPoint, GetBounderingBox, startPoint, and EndPoint
notice that all above properties could be determined only when u create a line by Addline
HOW TO WORK AROUND THIS ?????
ANYONE MAY HELP ME PLEASE ???
here it is a code to select some lines with a section on screen
after selecting the lines , I want to get the start point of every line and the end point
but the VBA has a limitation to make that
look at this code :
Dim ret As Boolean
Me.Hide
ret = AddingSelectionSetNamedThisName("HorizontalLines")
ThisDrawing.Utility.prompt vbCrLf & " Select Horizontal Lines :"
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
FilterType(0) = 0
FilterData(0) = "line" '"line" ' "3dface" , and so on
SSObject.SelectOnScreen FilterType, FilterData
SSObject.Highlight True
Dim i As Long
Dim LineOptained As AcadObject
Dim LineOptainedHandle As Long
Dim StartPoint As Variant
''Dim EndPoint As Variant
For Each LineOptained In SSObject 'or ThisDrawing.ModelSpace
LineOptainedHandle= LineOptained.Handle
StartPoint = LineOptained.startPoint
i = i + 1
Next
Me.Show
end sub
===========================
the results:
==========
the handle or length of any horizontal line will be determined
but other properties of a line object no
how to get some important properties of the acadEntity selected by the user on screen
like maxPoint, minPoint, GetBounderingBox, startPoint, and EndPoint
notice that all above properties could be determined only when u create a line by Addline
HOW TO WORK AROUND THIS ?????
ANYONE MAY HELP ME PLEASE ???