CleanOGS

From scripting
Revision as of 05:14, 22 April 2017 by Nickpisca (talk | contribs) (Created page with " Sub CleanOGS(CurOGS As OrderedGeometricalSet) Dim SecondPart As Part Set SecondPart = GetContainingPart(CurOGS) If CATIA.ActiveDocument.Selection.Count <> 0 Then CATI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Sub CleanOGS(CurOGS As OrderedGeometricalSet)
Dim SecondPart As Part
Set SecondPart = GetContainingPart(CurOGS)
If CATIA.ActiveDocument.Selection.Count <> 0 Then
    CATIA.ActiveDocument.Selection.Clear
End If
For X = 1 To CurOGS.Bodies.Count
    CATIA.ActiveDocument.Selection.Add CurOGS.Bodies.Item(X)
    CATIA.ActiveDocument.Selection.Delete
Next
For X = 1 To CurOGS.HybridShapes.Count
    SecondPart.HybridShapeFactory.DeleteObjectForDatum CurOGS.HybridShapes.Item(1)
Next
For X = 1 To CurOGS.OrderedSketches.Count
    CATIA.ActiveDocument.Selection.Add CurOGS.OrderedSketches.Item(X)
    CATIA.ActiveDocument.Selection.Delete
Next 
End Sub