-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewScale_12.iLogicVb
More file actions
33 lines (31 loc) · 976 Bytes
/
ViewScale_12.iLogicVb
File metadata and controls
33 lines (31 loc) · 976 Bytes
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
Option Explicit On
Option Strict On
Option Infer Off
Sub Main()
Dim oDoc As Document
Dim oIDWFile As DrawingDocument
Dim oSheet As Sheet
Dim oDrawingView As DrawingView
Dim oScale As String
Dim oTime As String
oTime = Now.ToShortDateString
iProperties.Value("Project", "Creation Date") = oTime
oScale = "1 / 12"
oDoc = ThisApplication.ActiveDocument
oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
oIDWFile = TryCast(oDoc, DrawingDocument)
oSheet = oIDWFile.ActiveSheet
For Each oDrawingView In oSheet.DrawingViews
Logger.Info(oDrawingView.ScaleString)
If (oDrawingView.ViewType = DrawingViewTypeEnum.kStandardDrawingViewType) Or
(oDrawingView.ViewType = DrawingViewTypeEnum.kProjectedDrawingViewType)
'Assignment fail if same scale
If oDrawingView.ScaleString <> oScale
oDrawingView.ScaleString = oScale
End If
End If
Next
oSheet.Update
End If
End Sub