Hi Cad Admin,
You can do that via the mouse event handlers.
Convert the coordinates of the mouse to the drawing's using the modelview transform's. That'll convert the screen coordinates to the drawings. Make sure to get the transform matrix within the event handler method because it's constantly changing.
The rest is up to you.
Thanks for the information, I looked in the API help, and didn't see any examples. Do you know of any, or have you done anything like this in the past?
Could this be used on views, to determine left or right of each view individually. Really don't care of sheet coords, just selection in each view, if it were on the left or right side of a drawing view.
Yes. it can be done on views. You should the outline of your drawing view (.GetOutline() method ). That will return an array of doubles representing the xs and ys of the two corners (lowest and highest corner - you're basically getting the endpoints of the diagonal) of the bounding box of the view. Then you need to compare the x of the mouse left click with those of the two corners to see if the user click was either on the left or the right.
I'm going through the GetOutline API sample info bellow, I got it to report all view data. How would i only get the Info for "a selected" view only?
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim outline() As Double
Dim pos() As Double
Dim fileName As String
Dim errors As Long
Dim warnings As Long
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
Set swView = swDraw.GetFirstView
Do While Not swView Is Nothing
outline = swView.GetOutline
pos = swView.Position
MsgBox "View = " + swView.Name & vbCrLf & _
" X and Y positions = (" & pos(0) * 1000# & ", " & pos(1) * 1000# & ") mm" & vbCrLf & _
" X and Y bounding box minimums = (" & outline(0) * 1000# & ", " & outline(1) * 1000# & ") mm" & vbCrLf & _
" X and Y bounding box maximums = (" & outline(2) * 1000# & ", " & outline(3) * 1000# & ") mm" & vbCrLf & _
" Position locked? " & swView.PositionLocked
Set swView = swView.GetNextView
Use ActivateView Method (IDrawingDoc) to activate the view and then get the view object using ActiveDrawingView Property (IDrawingDoc).