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

Hello

 

I'm not sure, but sick sketch entites seems to be a combination of Reference property is set to true but ReferencedEntity property is nothing. This iLogic should do.

Dim oPartDoc As PartDocument = ThisDoc.Document 

Dim oTrans As Transaction = ThisApplication.TransactionManager.StartTransaction(oPartDoc, "CleanSickSketchEntities")

Try
	
ThisApplication.ScreenUpdating=False
Dim oSketch As PlanarSketch
Dim oSketchEnt As SketchEntity
For Each oSketch In oPartDoc.ComponentDefinition.Sketches
    oSketch.Edit
    For Each oSketchEnt In oSketch.SketchEntities
        If oSketchEnt.Reference = True Then
            If oSketchEnt.ReferencedEntity Is Nothing Then
                If Not oSketchEnt.Type = kSketchPointObject Then
                    'delete sick entity
					oSketchEnt.Delete
					'unlink sick entity to normal sketch ent
					'oSketchEnt.Reference=False
                End If
            End If
        End If
    Next
    oSketch.ExitEdit
Next

Catch
Finally
	ThisApplication.ScreenUpdating = True
	oTrans.End
End Try

 


R. Krieg
RKW Solutions
www.rkw-solutions.com