Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Jakob_Hamburg
in reply to: WCrihfield

Hi @WCrihfield ,

 

Thank you so much for your good explanation.

 

Thank you for your code.

Unfortunately the rule cannot delete all the borders.

 in the above code it says:

'delete all unreferenced BorderDefinitions
	For Each oBDef As BorderDefinition In oDrawingDoc.BorderDefinitions
		If (Not oBDef.IsDefault) AndAlso (Not oBDef.IsReferenced) Then
			oBDef.Delete()
		End If
	Next oBDef

 

The problem seems to be that those borders are "referenced" and therefore cannot be deleted.

 

Jakob_Hamburg_0-1732179795762.png

 

I do not quite understand, why those borders are referenced since they are not on the sheets (because your code deletes the borders on the sheets in line 31).

Is it, that Inventor has not realized that they have been deleted and that is why they are still referenced? 

 

(Autodesk help says: A border definition is referenced whenever it is used on a sheet. A referenced border definition cannot be deleted.)

 

Since the rule cannot delete the borders it adds "copy of..".

Jakob_Hamburg_1-1732180497088.png

 

Do you know how to delete the initial borders in the drawing recourses?