11-16-2022
10:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-16-2022
10:21 AM
OK, I misunderstood. I thought the one prompt you were talking about was the one at the end. Here is a version with a question before the loop, asking if you want to proceed with updating all drawing styles.
'This logic runs thru all of Drawings Styles and updates them.
Sub Main()
OpenDoc = ThisDoc.Document
oStyles = OpenDoc.StylesManager.Styles
oAns = MessageBox.Show("Do you want to update all Styles in this drawing?", _
"Update Drawing Styles", MessageBoxButtons.YesNo, MessageBoxIcon.Question, _
MessageBoxDefaultButton.Button2)
If oAns = DialogResult.Yes Then
'Runs thru all Styles and update them, if needed
For Each oStyle As Style In oStyles
If Not oStyle.UpToDate Then oStyle.UpdateFromGlobal
Next
End If
Try : OpenDoc.Save : Catch : End Try
'Tells user that Styles have been updated.
MessageBox.Show("Drawing Styles have been Updated" & vbCr & oFile)
End Sub
Wesley Crihfield
(Not an Autodesk Employee)