| Author |
Message |
juno
Guest
|
Posted:
Fri Apr 08, 2005 3:25 am Post subject:
select object + the selection point |
|
|
I would like to be able to select a Line or PLine and get the entity information (startpoint…) and also get the selection point ID.
I have done it a long time ago but I don’t remember what I did.
Any help would be appreciated,
Thank you,
-J
|
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Fri Apr 08, 2005 3:32 am Post subject:
Re: select object + the selection point |
|
|
Dim PickPoint as Variant
Dim objEntity as AcadEntity
ThisDrawing.Utility.GetEntity objEntity, PickPoint, "Select Line: "
--
Jeff
check out www.cadvault.com
"juno" <nospam@address.withheld> wrote in message
news:33110474.1112916380782.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | I would like to be able to select a Line or PLine and get the entity
information (startpoint.) and also get the selection point ID.
I have done it a long time ago but I don't remember what I did.
Any help would be appreciated,
Thank you,
-J |
|
|
| Back to top |
|
 |
MP
Guest
|
Posted:
Fri Apr 08, 2005 3:38 am Post subject:
Re: select object + the selection point |
|
|
Dim oEnt As AcadEntity, vpt As Variant
On Error Resume Next
ThisDrawing.Utility.GetEntity oEnt, vpt, "Pick entity"
If Err Then
'do whatever
Else
' vpt is the point used to select
'oEnt is the entity selected
End if
hth
Mark
....dang jeff, if I hadn't stopped to throw in the error check you might not
have beat me!
:-)
ha ha
"juno" <nospam@address.withheld> wrote in message
news:33110474.1112916380782.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | I would like to be able to select a Line or PLine and get the entity
information (startpoint.) and also get the selection point ID.
I have done it a long time ago but I don't remember what I did.
Any help would be appreciated,
Thank you,
-J |
|
|
| Back to top |
|
 |
antmjr
Guest
|
Posted:
Fri Apr 08, 2005 3:27 pm Post subject:
Re: select object + the selection point |
|
|
be aware that the point that .GetEntity returns does not necessarily belong to the picked object; unfortunately .GetEntity doesn’t support an osnap mode, like, say, EndPoint or Nearest, so it returns the actual point you have picked, which quite never belongs to your object
If you want to select an object by picking a point that belongs to the object for sure, you have to pick a point first…
ThisDrawing.SetVariable "osmode", 513 'end + nearest
p0 = ThisDrawing.Utility.GetPoint
…and then to select the object via .SelectAtPoint, maybe with a filter and some error trappings
intCodes(0) = 0: varCodeValues(0) = "LINE"
ss1.SelectAtPoint ThisDrawing.Utility.TranslateCoordinates(p0, acWorld, acUCS, False) _
, intCodes, varCodeValues
maybe there are other ways, but I don’t know them (I still use acad2002) |
|
| Back to top |
|
 |
juno
Guest
|
Posted:
Fri Apr 08, 2005 7:00 pm Post subject:
Re: select object + the selection point |
|
|
Thank you for the help.
I guess my options are: GetEntity or GetPoint.
I like the GetPoint method, do you have any preference on one over the other method.
-J |
|
| Back to top |
|
 |
|
|
|
|