forked from mspace912/iLogic-Development
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDRAWINGSCALE.ILOGICVB
More file actions
33 lines (28 loc) · 1.35 KB
/
DRAWINGSCALE.ILOGICVB
File metadata and controls
33 lines (28 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Sub Main()
If iProperties.Value("Custom", "Scale") <>"NTS" Then
Dim drawingDoc As DrawingDocument = TryCast(ThisDoc.Document, DrawingDocument)
For Each sheetX As Sheet In drawingDoc.Sheets
On Error Resume Next
If (sheetX.TitleBlock Is Nothing) Then Continue For
Dim titleBlockX As TitleBlock = sheetX.TitleBlock
' Dim scaleTextBox As TextBox = GetScaleTextBox(titleBlockX.Definition)
Dim scaleString As String = String.Empty
For Each viewX As DrawingView In sheetX.DrawingViews
If (Not String.IsNullOrEmpty(viewX.ScaleString)) Then
scaleString = viewX.ScaleString
iProperties.Value("Custom", "Scale")=scalestring
Exit For
End If
Next
' Call titleBlockX.SetPromptResultText(scaleTextBox, scaleString)
Next
End If
End Sub
'Function GetScaleTextBox(ByVal titleDef As TitleBlockDefinition) As TextBox
' For Each defText As TextBox In titleDef.Sketch.TextBoxes
' If (defText.Text.IndexOf("<Scale>", StringComparison.OrdinalIgnoreCase) >= 0) Then
' Return defText
' End If
' Next
' Throw New ArgumentException("No prompted entry string containing <Scale> was found in the title block definition: " & titleDef.Name)
'End Function