几何尺寸与公差论坛

 找回密码
 注册
查看: 675|回复: 0

【转帖】mouseclick capture

[复制链接]
发表于 2009-4-13 12:56:23 | 显示全部楼层 |阅读模式
mouseclick capture
i am trying to make a stand-alone program, and i need to capture a mouse click event when it happens in sldwrks. how do i go about doing this?
i figured it would be something like:
sub lmouseclick() handles swapp.mouseclick
but i dont see any events in the swapp list for mouse clicks.
if all you need is the location in model space where user selects, you can use selectionmgr.getselectionpoint2. if you need more than that, then you will need to make the program a solidworks add-in and use the mouse events.
wayne matus
texas engineering systems
i just want to know when i a click takes place. i have a function that populates a list box with all the currently selected items, but i would like it update as things are selected as opposed to say when the form gets focus back.
i tried looping the function with a delay:
threading.thread.sleep(15000)
function()
but then my form doesn't ever become visible. my debug shows that it is updating the count of selected components every 15 seconds, but i cant see my form.
edit: forced it to show with a me.visible = true right before the sleep, but the form can't be accessed so i guess that won't provide a work around. >.<
edited: 10/28/2008 at 03:39 pm by blake dahle
it looks like the mouseselectnotify event is the one you would need to monitor. there is a example macro in the 2008 api help file for this.
wayne matus
texas engineering systems
having trouble figuring this out. i have set my variables and created a function for the mouseevent, but i am getting an error on every click and the code in the function doesnt fire.
dim withevents ms as sldworks.mouse
ms = swmodelview.getmouse
private function ms_mouseselectnotify(byval ix as integer, byval iy as integer, byval x as double, byval y as double, byval z as double) as integer handles ms.mouseselectnotify
getselcomplist()
end function
a first chance exception of type 'system.invalidoperationexception' occurred in system.windows.forms.dll
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 09:37 , Processed in 0.035618 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表