ilogic Delete unresolved views in an drawing

ilogic Delete unresolved views in an drawing

qkrtkddud
Explorer Explorer
823 Views
2 Replies
Message 1 of 3

ilogic Delete unresolved views in an drawing

qkrtkddud
Explorer
Explorer

Hi,
I want to make ilogic that deletes uninterpreted sheets from drawing at once. Is it possible?

0 Likes
824 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

This code should remove all unresolved views and parts lists in Active Sheet

Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oPartsList As PartsList

For Each oView In oSheet.DrawingViews
	If oView.ReferencedFile.DocumentFound = False Then oView.delete
	Next
	
For Each oPartsList In oSheet.PartsLists
	If oPartsList.ReferencedFile.DocumentFound = False Then oPartsList.delete
	Next

 

0 Likes
Message 3 of 3

MichaëlStienstra
Participant
Participant

Small arrangement. If No unresolved views are found an message box will pop up.

Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oPartsList As PartsList

For Each oView In oSheet.DrawingViews
	If oView.ReferencedFile.DocumentFound = False Then oView.Delete
	Next
	
For Each oPartsList In oSheet.PartsLists
	If oPartsList.ReferencedFile.DocumentFound = False Then 
	oPartsList.Delete 
Else
	MessageBox.Show("No unresolved views found", "Put in message box title")
End If
	Next
0 Likes