Difference between revisions of "CleanOGS"

From scripting
Jump to: navigation, search
(Created page with " Sub CleanOGS(CurOGS As OrderedGeometricalSet) Dim SecondPart As Part Set SecondPart = GetContainingPart(CurOGS) If CATIA.ActiveDocument.Selection.Count <> 0 Then CATI...")
 
(No difference)

Latest revision as of 05:14, 22 April 2017

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