how to access select object properties
Posted: 20 Jul 2011, 21:39
Hi all,
First of all, thanks for your works ! Cadviewx is exactly what i was seeking for : an activeX available in vb.net to zoom in/out in code !!
However, if i come to this forum is to ask you something.
in my vb.net appli, how can i obtain the properties in code for the selected items in my activeX.
like you can do in Acad with the following code :
Dim ssetObj As IAcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets(0)
compte = ssetObj.Count
If compte > 1 Then
Debug.Print "only the first selected item will be used"
End If
If compte = 0 Then
Debug.Print "you don't have made any selection"
Exit Sub
End If
If ssetObj.Item(0).ObjectName = "AcDbMText" Then
Debug.Print "selection ok : " & ssetObj.Item(0).TextString
End If
For example, i have a DbMText selected, how can i retieved the text inside (or his coordinates) and how to detect that a point have been selected (<== this point is just for fun... if it's impossible, i'll use a button)
I have already read this topic : http://www.cadsofttools.com/forum/viewt ... =15&t=2327
but what i like is how to retrieve the handler or i/j of the selected item in my dwg
i read this one too : http://www.cadsofttools.com/forum/viewt ... =15&t=2239 .... but not sure that cadimport is what i need
My software should only do :
- zoom in/out on a specific point
- when you select an item (Mtext) and click a button , retrieve the text on the mtext <== datas that appears in "properties" tab on the left in fact
Thanks in advance for any help
First of all, thanks for your works ! Cadviewx is exactly what i was seeking for : an activeX available in vb.net to zoom in/out in code !!
However, if i come to this forum is to ask you something.
in my vb.net appli, how can i obtain the properties in code for the selected items in my activeX.
like you can do in Acad with the following code :
Dim ssetObj As IAcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets(0)
compte = ssetObj.Count
If compte > 1 Then
Debug.Print "only the first selected item will be used"
End If
If compte = 0 Then
Debug.Print "you don't have made any selection"
Exit Sub
End If
If ssetObj.Item(0).ObjectName = "AcDbMText" Then
Debug.Print "selection ok : " & ssetObj.Item(0).TextString
End If
For example, i have a DbMText selected, how can i retieved the text inside (or his coordinates) and how to detect that a point have been selected (<== this point is just for fun... if it's impossible, i'll use a button)
I have already read this topic : http://www.cadsofttools.com/forum/viewt ... =15&t=2327
but what i like is how to retrieve the handler or i/j of the selected item in my dwg
i read this one too : http://www.cadsofttools.com/forum/viewt ... =15&t=2239 .... but not sure that cadimport is what i need
My software should only do :
- zoom in/out on a specific point
- when you select an item (Mtext) and click a button , retrieve the text on the mtext <== datas that appears in "properties" tab on the left in fact
Thanks in advance for any help