|
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 |
|