Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catalog Browser through VBA

Status
Not open for further replies.

sri91

Mechanical
Aug 29, 2019
42
IN
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
 
Replies continue below

Recommended for you

Thank you ferdo
I have tried sleep, loop, wait... In all the cases application is going to sleep in the sense user can not perform any operation in that time.

Thanks
Sri
 
Sorry, I am not sure what is modal form. Can you please explain. I have done it in catvba project.

Thanks
Sri
 
Hi,
If I am not using form and using only module then what to be done.

Thanks
Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top