Move Drawing View with SHIFT key
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In another 3D package I know you can move all drawing views on a drawing by holding down SHIFT.
In Inventor you have to make a box selection or CTRL selection for this.
I'm trying to do that CTRL selection on all views except the ISO view with an iLogic rule under a button (V-key).
Making that selection works, but Inventor doesn't see it as such as soon as I want to move the views.
Anyone have an idea?
FYI, see video: With the rule you see the drawing view nodes in the browser pane light up, when I then click on a drawing view with the mouse, the highlight only remains active on that view, the others go out.
In contrast, with a CTRL selection, everything remains highlighted when you select one view afterwards.
In both iLogic and VBA the behavior is the same, see code.
Option Explicit
Private Declare PtrSafe Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Declare PtrSafe Function SetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Const VK_CONTROL = &H11
Private keys(256) As Byte
Private save As Byte
Private Sub SetCtrlKey()
GetKeyboardState keys(0)
save = keys(VK_CONTROL)
keys(VK_CONTROL) = &H80
SetKeyboardState keys(0)
End Sub
Private Sub ResetCtrlKey()
keys(VK_CONTROL) = save
SetKeyboardState keys(0)
End Sub
Public Sub DrawingView_Selection_VBA()
Dim oDoc As DrawingDocument
Dim oSheet As Sheet
Dim oView As DrawingView
Set oDoc = ThisApplication.ActiveDocument
Set oSheet = oDoc.ActiveSheet
Dim oSelectSet As SelectSet
Set oSelectSet = oDoc.SelectSet
oSelectSet.Clear
'SetCtrlKey
For Each oView In oSheet.DrawingViews
If oView.Name Like "*VIEW*" And Not oView.Name Like "*ISO*" Then
'SetCtrlKey
Call ThisApplication.CommandManager.DoSelect(oView)
'oSelectSet.Select (oView)
'ResetCtrlKey
End If
Next
'ResetCtrlKey
End Sub
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSelectSet As SelectSet = oDoc.SelectSet
oSelectSet.Clear
Dim objColl As ObjectCollection
objColl = ThisApplication.TransientObjects.CreateObjectCollection
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView' = oSheet.DrawingViews.Item(1)'Select View for Item number
For Each oView In oSheet.DrawingViews
Logger.Info(oView.Name & " - " & oView.ViewType & " - " & oView.Type)
If Not oView.Name Like "*ISO*" Then
'ThisApplication.CommandManager.DoSelect(oView) ' Select View
'oSelectSet.Select(oView)
objColl.Add(oView)
End If
Next
oSelectSet.SelectMultiple(objColl)