l3ob
Aerospace
- Apr 28, 2004
- 56
I'm very new at Catia VB programming and have written a program to create normal lines to through points of an open body and normal to a face. When the first line is created the user is prompt to reverse direction YES/NO. If yes, I want to 'UNDO' the created first line, change the length variable and then create the first and subsequent lines in the opposite direction. I've got it all except the 'UNDO' for the first line.
This is the loop:
For i = 1 to countA
Set reference2 = Part1.CreateReferenceFromObject(hybridShapes1.Item(i))
Set hybridShapeLineNormal1 = hybridShapeFactory1.AddNewLineNormal(reference1, reference2, Length, 0, False)
hybridBody2.AppendHybridShape hybridShapeLineNormal
If ( i = 1 ) then
part1.Update
response = msgbox ("Do you want to Flip?",4)
If (response = 6) then
Length=-25.4
>>>undo goes here<<<
msgbox "reversed direction"
i=0
End if
End if
next
This is the loop:
For i = 1 to countA
Set reference2 = Part1.CreateReferenceFromObject(hybridShapes1.Item(i))
Set hybridShapeLineNormal1 = hybridShapeFactory1.AddNewLineNormal(reference1, reference2, Length, 0, False)
hybridBody2.AppendHybridShape hybridShapeLineNormal
If ( i = 1 ) then
part1.Update
response = msgbox ("Do you want to Flip?",4)
If (response = 6) then
Length=-25.4
>>>undo goes here<<<
msgbox "reversed direction"
i=0
End if
End if
next