Hello All,
I am new to catia programming. I have to find out the angled view and place a symbol from the catalog. In the code what i have written it is giving the msgbox before it opens the catalog browser. If I keep break point it is working fine. Within that fraction of time it is not able to open the catalog before the msgbox. I am pasting the code below. Any help is appreciated.
For Each view1 In views1
If InStr(view1.name, "Main View") = 0 And InStr(view1.name, "Background View") = 0 Then
If view1.Angle <> 0 Then
Dim angleValue As Double
angleValue = view1.Angle * 180 / pi
view1.Activate
MsgBox "Please select the location in " + view1.name
status = doc1.Indicate2D("Indicate Text Location", TextLocation)
Dim angletext As DrawingText
If angleValue > 0 Then
Set angletext = view1.Texts.Add(CStr(angleValue), TextLocation(0), TextLocation(1))
MsgBox "Please select the STRAITENED VIEW1 symbol from catalog for the view " + view1.name
CATIA.StartCommand ("Catalog Browser")
ElseIf angleValue < 0 Then
Set angletext = view1.Texts.Add(CStr(angleValue * -1), TextLocation(0), TextLocation(1))
MsgBox "Please select the STRAITENED VIEW2 symbol from catalog for the view " + view1.name
CATIA.StartCommand ("Catalog Browser")
End If
End If
End If
Thanks
Sri
I am new to catia programming. I have to find out the angled view and place a symbol from the catalog. In the code what i have written it is giving the msgbox before it opens the catalog browser. If I keep break point it is working fine. Within that fraction of time it is not able to open the catalog before the msgbox. I am pasting the code below. Any help is appreciated.
For Each view1 In views1
If InStr(view1.name, "Main View") = 0 And InStr(view1.name, "Background View") = 0 Then
If view1.Angle <> 0 Then
Dim angleValue As Double
angleValue = view1.Angle * 180 / pi
view1.Activate
MsgBox "Please select the location in " + view1.name
status = doc1.Indicate2D("Indicate Text Location", TextLocation)
Dim angletext As DrawingText
If angleValue > 0 Then
Set angletext = view1.Texts.Add(CStr(angleValue), TextLocation(0), TextLocation(1))
MsgBox "Please select the STRAITENED VIEW1 symbol from catalog for the view " + view1.name
CATIA.StartCommand ("Catalog Browser")
ElseIf angleValue < 0 Then
Set angletext = view1.Texts.Add(CStr(angleValue * -1), TextLocation(0), TextLocation(1))
MsgBox "Please select the STRAITENED VIEW2 symbol from catalog for the view " + view1.name
CATIA.StartCommand ("Catalog Browser")
End If
End If
End If
Thanks
Sri