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!

Catia V5 windows arrangement

Status
Not open for further replies.

JeniaL

Mechanical
Jun 3, 2014
547
IL
Hello to all,

When I run code to cursor everything works well (Catia windows arranged vertically).
But when I run the same code in auto mode nothing happens (no arrangement).

Code:
Dim Part As Document
        Part = myCatia.Documents.Open("xxxxxxxxxxxxxxxx.CATPart")
        Part = myCatia.ActiveDocument

        '----Arrange Catia V5 windows----
        Dim CatiaWindows As Windows
        CatiaWindows = myCatia.Windows
        CatiaWindows.Arrange(CatArrangeStyle.catArrangeTiledVertical)

        '----Feature select and copy----
        Dim MySelection As Selection
        MySelection = myCatia.ActiveDocument.Selection
        MySelection.Search("CATStFreeStyleSearch.GSM3DCurveOffset + CATGmoSearch.GSM3DCurveOffset,all")
        myCatia.StartCommand("copy")

I just want to open file, copy named feature and past it into another CATPart using SelectElement2.
I dont want to switch between windows that is why I want to use arrangement.

Any help will be greatly appresiated,

Jenia Ladkov.
 
Replies continue below

Recommended for you

what you are saying is that the windows don't become arranged?

Code:
'----Arrange Catia V5 windows----
        Dim CatiaWindows As Windows
        CatiaWindows = myCatia.Windows
        CatiaWindows.Arrange(CatArrangeStyle.catArrangeTiledVertical)

With me is working fine.

Tiago Figueiredo
Tooling Engineer
 
Works fine if I run code line by line (F11).
In auto mode I get following
New_Bitmap_Image_yms5kc.jpg


Only works for me if I move code after message box right before selection

Code:
MsgBox("Select Geometrical set where copied element will be inserted.", vbOKOnly, "Features to copy")
        Dim CatiaWindows As Windows
        CatiaWindows = myCatia.Windows
        CatiaWindows.Arrange(CatArrangeStyle.catArrangeTiledVertical)
        status = PasteSel.SelectElement2(ObjectFilter, "Select Geometrical set...", False)
        myCatia.StartCommand("paste")
 
Do you really need that message box? Don't forget that you a message on the status bar provided SelectElement2.

Probably Catia don't have time to arrange the windows before message box.


you can try the following if you really want that message:

Code:
        Dim CatiaWindows As Windows
        CatiaWindows = myCatia.Windows
        CatiaWindows.Arrange(CatArrangeStyle.catArrangeTiledVertical)
        status = PasteSel.SelectElement2(ObjectFilter, "Select Geometrical set...", False)
        myCatia.StartCommand("paste")
myCatia.RefreshDisplay = True
MsgBox("Select Geometrical set where copied element will be inserted.", vbOKOnly, "Features to copy")



Tiago Figueiredo
Tooling Engineer
 
Tiago thanks for the suggestion. I don't need any messages in my applications because I know exactly how it works. When it comes to users it's like what the heck do I have to do. That is why I add images, explanations or whatever during program run.
Untitled_g7y3db.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top