11-16-2022
12:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-16-2022
12:41 PM
Thanks for the guidance. With your help, I'm really close.
If I run the iLogic manually, does exactly what I need it to do.
But, if I attach it to an Event Trigger so that on Drawings it runs "After Open Document, it errors.
What am I missing?
'This logic runs thru all of Drawings Styles and updates them. Sub Main() OpenDoc = ThisDoc.Document oStyles = OpenDoc.StylesManager.Styles 'Sets Update dialog to initially False Dim RequiresUpdate = False 'Runs thru all Styles and switches to RequiresUpdate to True For Each oStyle As Style In oStyles If Not oStyle.UpToDate Then RequiresUpdate = True Next If RequiresUpdate = True Then ' Pop up message asking if you want to update styles oAns = MessageBox.Show("Update to Current Drawing Styles?", "Styles Update", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, 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 'Tells user that Styles have been updated. ' MessageBox.Show("Drawing Styles have been Updated!" + vbCrLf + vbCrLf + "PLEASE Review all Dimensions and Balloons" & vbCr & oFile) End If Try : OpenDoc.Save : Catch : End Try If oAns = DialogResult.Yes Then 'Tells user that Styles have been updated. MessageBox.Show("Drawing Styles have been Updated!" + vbCrLf + vbCrLf + "PLEASE Review all Dimensions and Balloons" & vbCr & oFile) End If End Sub
Best,
Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Inventor Certified User / Vault Professional Influencer