- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i have an ilogic rule which i use and it works quite well. It looks through all the views on a drawing and checks to see if the scale is the same scale as the first view on the sheet. If there are any that are not then it will display a message saying 'Some views are not the same.' I would like to change this dialog so if it does identify any that have a different scale it will show a list of each view and which sheet it is on. I have a had a try of it my iLogic knowledge is very limited so i couldn't get it to work. I've attached the code i currently use.
Thanks.
Dim oDrawDoc As DrawingDocument
Dim oSheet As Sheet
Dim oCurrentSheet As Sheet
Dim oSheets As Sheets
Dim oView As DrawingView
Dim oViews As DrawingViews
Dim oScale As Double
Dim oFView As String
On Error Resume Next
'get the current drawing
oDrawDoc = ThisDoc.Document
'get the active sheet
oCurrentSheet = oDrawDoc.ActiveSheet
'get the sheets collection
oSheets = oDrawDoc.Sheets
'look at each sheet
For Each oSheet In oSheets
oFlag = True 'set flag to default value
oSheet.Activate 'activate the sheet
oViews = oSheet.DrawingViews 'get the views collection
oFView = oSheet.DrawingViews(1).Name 'adds the NAME of the first view in sheet to oFView
oScale = ActiveSheet.View(oFView).Scale 'sets the SCALE of the first view to OScale
'look at each view
For Each oView In oViews
'compare view scale to 1st view scale
If oView.Scale <> oScale Then
oFlag = False 'trip the flag
End If
Next
'alert user if flag is tripped (indicating differing scales)
If oFlag = False Then
MessageBox.Show("Some drawing views on " & _
oSheet.Name & " are not the same scale. Please make all scales on this sheet the same.", "Check Scales")
End If
Next
'set original sheet as active
oCurrentSheet.Activate
Solved! Go to Solution.
Link copied