06-03-2021
01:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-03-2021
01:05 AM
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