iPick exception

Forum for reporting problems
Post Reply
atrev
Posts: 24
Joined: Tue Jul 30, 2013 9:19 am

iPick exception

Post by atrev »

This code for picking seems to work a lot of the time, but sometimes it gets an AccessViolationException and kills the application without being able to catch
it is placed within mouse move for the kcad control

Code: Select all

Dim pick As IPick = CType(Me.AxKernCADnet1.GetView, IPick)
Dim item As IItem = pick.GetItemAt(e.x, e.y)

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: iPick exception

Post by nickz »

It should work. What kind of objects you have? Do you have a small model or test application/case?
Also the GetItemAt() is pretty expensive. It needs to analyse the whole model. Mouse move events are very intensive. There are hundreds of them in even simple mouse move. So I would recommend a different interface for picking. There is mouse hover handling, for example. Or you could pick a point and then request detection. See all this in Pick sample
Nick

atrev
Posts: 24
Joined: Tue Jul 30, 2013 9:19 am

Re: iPick exception

Post by atrev »

One way to reproduce is to use the pick object code in the cross view section, load a mesh, do a cross section, detach the intersection lines and mouse over them, and an exception will occur. This kind of error is easy to reproduce, but also can be caught. Somes exceptions caused by IPick cannot seem to be caught, and caught an immediate closure of the application or the control freezing and not recovering, but hopefully this may lead to a fix. I have attached an image

Thanks
Attachments
exception.png
exception.png (212.23 KiB) Viewed 13991 times

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: iPick exception

Post by nickz »

Atrev,
The pick example does not have cross view. So you must be talking about your application? I do not have it. There probably is a bug, but it can be happening in a very specific situation. I could be guessing forever what your code is doing. My approximation in pick example worked OK.
Could you send me a test case in a compliable sample? You can add your code to Pick to reproduce or extract some simplification from your app.
Regards
Nick

atrev
Posts: 24
Joined: Tue Jul 30, 2013 9:19 am

Re: iPick exception

Post by atrev »

The exception seems to be caught internally to the kernelcad control, but whatever the error is it also seems to kill the application sometimes, under condtions we can't seem to mimic on purpose. I'm attaching a sample.

I've embedded the Gear.glm as a test. Hopefully it loads straight away when you open it.
Use the button the cut the part, then mouseover the intersection in the second control. We run all our applications trying to reduce exceptions to a minimum, and this one seems to have worse results, so hopefully this will help find a solution
Attachments
PickExample.zip
(221.47 KiB) Downloaded 730 times

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: iPick exception

Post by nickz »

atrev,
We have reproduced and fixed it in the today's 3754 update
Thanks for reporting
Nick

Post Reply