select object + the selection point
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
select object + the selection point

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
juno
Guest





Posted: Fri Apr 08, 2005 3:25 am    Post subject: select object + the selection point Reply with 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
Jeff Mishler
Guest





Posted: Fri Apr 08, 2005 3:32 am    Post subject: Re: select object + the selection point Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB