Skip to content

Commit 8a12d9a

Browse files
committed
Create DRG_Change All View Labels.iLogicVb
1 parent cfda901 commit 8a12d9a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
' Check a document is open
2+
If ThisApplication.Documents.VisibleDocuments.Count = 0 Then
3+
MessageBox.Show("A Drawing Document needs to be open")
4+
Exit Sub
5+
End If
6+
7+
' Check active document
8+
If ThisApplication.ActiveDocumentType <> Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
9+
MessageBox.Show("A Drawing Document needs to be open")
10+
Exit Sub
11+
End If
12+
13+
' Get the active document
14+
Dim oDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
15+
16+
' Iterate through all sheets
17+
For Each oSheet As Inventor.Sheet In oDoc.Sheets
18+
19+
' Check there are views on the sheet
20+
If oSheet.DrawingViews.Count = 0 Then Continue For
21+
22+
' Iterate through all views
23+
For Each oView As Inventor.DrawingView In oSheet.DrawingViews
24+
25+
' Check view is a base view, skip if not
26+
If oView.ViewType <> Inventor.DrawingViewTypeEnum.kStandardDrawingViewType Then Continue For
27+
28+
' Turn on view label if it isn't already
29+
oView.ShowLabel = True
30+
31+
' Set formatted text (this is how you need to add all of your property fields etc.
32+
oView.Label.FormattedText = "<StyleOverride Underline='True'><Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride><Br/><Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property><Br/><Property Document='model' PropertySet='Inventor Summary Information' Property='Keywords' FormatID='{F29F85E0-4FF9-1068-AB91-08002B27B3D9}' PropertyID='5'>KEYWORDS</Property><Br/><StyleOverride FontSize='0.25'>(</StyleOverride><StyleOverride FontSize='0.25'><DrawingViewScale/></StyleOverride><StyleOverride FontSize='0.25'>)</StyleOverride>"
33+
34+
Next ' Next view
35+
Next ' Next sheet

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