.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Identifying the object you're hovering over

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
744 Views, 8 Replies

Identifying the object you're hovering over

Hi all,

I'm inserting blocks into my drawing using a jig (thanks to cupocad) and it
works like a charm. However, I these blocks need additional actions. I'm
breaking lines/polylines to make room for the blocks. Now at first I
identified the object that needs to be broken by using a
selectCrossingWindow call and that worked quite nicely. At least I thought
so, until the testers inserted blocks at crossings of lines.

Now during the selection of the insertionpoint, objects you hover over
(i.e. lines) get highlighted. Is there any way to determine what object is
highlighted so I can store the id of that object in my jig? Idealy this
happens during the Sampler function of the jig which I override.

Rinze
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Check recent posts for 'PointMonitor tooltip example'. It will show you how
to get the
entity under the cursor.

"Rinze" wrote in message news:6233215@discussion.autodesk.com...
Hi all,

I'm inserting blocks into my draw...











Message 3 of 9
arcticad
in reply to: Anonymous

http://www.caddzone.com/PointMonitorClient.cs
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 4 of 9
Anonymous
in reply to: Anonymous

You can use the Editor's PointMonitor event to see what
objects are under the pickbox.

See this sample:

http://www.caddzone.com/PointMonitorClient.cs

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");


"Rinze" wrote in message news:6233215@discussion.autodesk.com...
Hi all,

I'm inserting blocks into my draw...











Message 5 of 9
Anonymous
in reply to: Anonymous

arcticad wrote:
> http://www.caddzone.com/PointMonitorClient.cs

Thanks, it's an interesting piece of code, but it doesn't exactly do what I
want. I specifically need the entity that's highlighted. This code gives me
the entity the snapping part of the cursor is over.

I draw 2 lines as a simple cross (+ sign). I echo the id of the entity I'm
hovering over as per example of the pointmonitor. This works nicely until I
come to the point where they intersect. I position the pointer just outside
the intersection, but close enough to let it snap to the intersection. Then
I always get the same id (the last drawn line) regardless of which line is
currently highlighted.

Rinze
Message 6 of 9
Anonymous
in reply to: Anonymous

I found the solution, I need to hook into the rollover event instead of the
pointmonitor. But the pointmonitor at least pointed me in the right
direction (pun intended :))

Rinze
Message 7 of 9
Anonymous
in reply to: Anonymous

Sorry, there may be an error in my example.

It may be that the entity that's highlighted is the *last*
FullSubentityPath, rather than the first, as I noted. You can verify that
with some testing, and I do believe there is some consistency with regards
to that, so if you need more than just the entity (as the rollover event
gives you), then you can still use the PointMonitor event, and get the
correct object.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");


"Rinze" wrote in message news:6234000@discussion.autodesk.com...
arcticad wrote:
> http://www.caddzone.com/...












Message 8 of 9
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> Sorry, there may be an error in my example.
>
> It may be that the entity that's highlighted is the *last*
> FullSubentityPath, rather than the first, as I noted. You can verify that
> with some testing, and I do believe there is some consistency with regards
> to that, so if you need more than just the entity (as the rollover event
> gives you), then you can still use the PointMonitor event, and get the
> correct object.
>

I found that hooking into the RollOver event does exactly what I want and
the code is basically the same as doing it for the PointMonitor. I am
keeping the PointMonitor example because I might be needing it for other
functions (info on the object it's snapping to or something).

So your example is not wasted 🙂
Message 9 of 9
bert.vanpeteghem
in reply to: Anonymous

So you are one of those 3 visitors per month on my blog :). Thanks for the shout 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost