Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am working on a rule that will rename the sheet name in the browser for easier exporting to DWG. The code below works on some drawings and some drawings it does not work, not sure what i have wrong. The error i get is "Object reference not set to an instance of an object." not sure what this means please help.
SyntaxEditor Code Snippet
Dim oSheets As Sheets = ThisDrawing.Document.sheets Dim oSheet As Sheet For Each oSheet In oSheets oSheet.activate Dim oDrawingView As DrawingView = oSheet.DrawingViews(1) oModel = ActiveSheet.View(oDrawingView.Name).ModelDocument EquipName = iProperties.Value(oModel.DisplayName, "Summary", "Comments") EquipName1=Left(EquipName,3) 'MessageBox.Show(EquipName1) ActiveSheet.Sheet.Name = iProperties.Value("Custom", "EQUIP_CAT") &"-"& iProperties.Value("Custom", "DWG_EQUIP_NAME") & "-" & iProperties.Value("Custom", "DERIVATIVE") & "-" & EquipName1 Next
Solved! Go to Solution.