Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What am i doing wrong here? I'm collecting the entities i want to move to a new layer on a sheet, and before moving to the next sheet, i'm executing the layer change. However, no matter where i put the statement i fails due to moving to sheet 2 in a mutlisheet setup.
We have an automation app we're running that we're sticking some noted text for the designer. We don't want it to print, so we put it on a no plot layer. However, i can't get it to move to the new layer in a multisheet setup. With one sheet, i can send it with oGeneralNote.Layer = TargetLayer. But that fails on sheet 2 in a multisheet setup for some reason. What am I missing here?
Thanks
Dim odoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet
'create blank collection
Dim objColl As ObjectCollection
objColl = ThisApplication.TransientObjects.CreateObjectCollection()
Dim TargetLayer As Layer
TargetLayer = ThisDrawing.Document.StylesManager.Layers("NoPlot")
For Each oSheet In odoc.Sheets
oSheet.Activate
For Each oGeneralNote In oSheet.DrawingNotes.GeneralNotes
If oGeneralNote.Text.Contains("#DESIGNER NOTE#") Then
MessageBox.Show("Found one", "Title")
objColl.Add(oGeneralNote)
'oSheet.ChangeLayer(objColl, TargetLayer)
'oGeneralNote.Layer = TargetLayer
End If
Next
oSheet.ChangeLayer(objColl, TargetLayer)
Next
Solved! Go to Solution.