Arichzhy
Automotive
- Aug 20, 2016
- 8
before a macro program running, a sketch(different name in different documents,maybe sketch1,sketch2 or sketch3 ) has be opened. I want to do some drawings in the opened sketch, but I don't know how to do next? following is part of my codes:
Sub CATMain()
Dim InputObjectType(0), Status, Selection
Set Selection = CATIA.ActiveDocument.Selection
InputObjectType(0) = "Line2D"
Status = Selection.SelectElement2(InputObjectType, "select a line", True)
If ((Status = "Cancel") Or (Status = "Undo")) Then
MsgBox "case1"
Exit Sub
ElseIf Status = "Redo" Then
Exit Sub
MsgBox "case2"
ElseIf (Status <> "Redo") Then
Set line1 = Selection.Item(1).Value
Dim sketches1 As Sketches
Set sketches1 = CATIA.ActiveDocument.Part.InWorkObject.HybridSketches
????here how to dim the sketch according to the selected line belongs to
...
End If
End Sub
i am newer in macro ,some one can help me? thanks
Sub CATMain()
Dim InputObjectType(0), Status, Selection
Set Selection = CATIA.ActiveDocument.Selection
InputObjectType(0) = "Line2D"
Status = Selection.SelectElement2(InputObjectType, "select a line", True)
If ((Status = "Cancel") Or (Status = "Undo")) Then
MsgBox "case1"
Exit Sub
ElseIf Status = "Redo" Then
Exit Sub
MsgBox "case2"
ElseIf (Status <> "Redo") Then
Set line1 = Selection.Item(1).Value
Dim sketches1 As Sketches
Set sketches1 = CATIA.ActiveDocument.Part.InWorkObject.HybridSketches
????here how to dim the sketch according to the selected line belongs to
...
End If
End Sub
i am newer in macro ,some one can help me? thanks