Skip to content

Commit cfda901

Browse files
committed
Updated
1 parent 371b48f commit cfda901

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
' Title: View Label Copy To Clipboard
2+
' Description: Copy one view label (formatted text) to clipboard
3+
' Version: 0.1
4+
5+
' Notes:
6+
' - Includes all formatted text
7+
8+
9+
' Check a document is open
10+
If ThisApplication.Documents.VisibleDocuments.Count = 0 Then
11+
MessageBox.Show("A Drawing Document needs to be open")
12+
Exit Sub
13+
End If
14+
15+
' Check active document
16+
If ThisApplication.ActiveDocumentType <> Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
17+
MessageBox.Show("A Drawing Document needs to be open")
18+
Exit Sub
19+
End If
20+
21+
' Initialise selection
22+
Dim oVLsource As Inventor.DrawingViewLabel = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingViewLabelFilter, "Select view label to copy")
23+
24+
' Check selection was made
25+
If oVLsource Is Nothing Then
26+
MessageBox.Show("Nothing was selected")
27+
Exit Sub
28+
End If
29+
30+
' Create view label string object and set to view label
31+
Dim strLabel As String = oVLsource.FormattedText
32+
33+
' Copy view label to clipboard
34+
System.Windows.Forms.Clipboard.SetText(strLabel)
35+
36+

Scripts/DRG_View Label Copy.iLogicVb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
' Title: View Label Copy
2+
' Description: Copy one view label (formatted text) to another view
3+
' Version: 0.1
4+
5+
' Notes:
6+
' - Includes all formatted text
7+
8+
' Check a document is open
9+
If ThisApplication.Documents.VisibleDocuments.Count = 0 Then
10+
MessageBox.Show("A Drawing Document needs to be open")
11+
Exit Sub
12+
End If
13+
14+
' Check active document
15+
If ThisApplication.ActiveDocumentType <> Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
16+
MessageBox.Show("A Drawing Document needs to be open")
17+
Exit Sub
18+
End If
19+
20+
' Initialise selection
21+
Dim oVLsource As Inventor.DrawingViewLabel = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingViewLabelFilter, "Select view label to copy")
22+
23+
' Check selection was made
24+
If oVLsource Is Nothing Then
25+
MessageBox.Show("Nothing was selected")
26+
Exit Sub
27+
End If
28+
29+
' Create view label property and set to view label
30+
Dim strLabel As String = oVLsource.FormattedText
31+
32+
LoopLabel :
33+
34+
' Initialise selection
35+
Dim oVLtarget As Inventor.DrawingViewLabel = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingViewLabelFilter, "Select view label to change" & ControlChars.NewLine & " Hold Shift / Ctrl to multi place")
36+
37+
' Check selection was made
38+
If oVLtarget Is Nothing Then
39+
MessageBox.Show("Nothing was selected")
40+
Exit Sub
41+
End If
42+
43+
' Change label to source
44+
oVLtarget.FormattedText = strLabel
45+
46+
Do While My.Computer.Keyboard.CtrlKeyDown Or My.Computer.Keyboard.ShiftKeyDown
47+
GoTo LoopLabel
48+
Loop
49+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy