Cancel
Showing results for 
Search instead for 
Did you mean: 

Scroll message window with API dialog box opened

Pioneer
Pioneer

Hello,

 

With my API dialog box opened, Is there a way to scroll the messages in the message window?

A portion of my API spits out a message which needs to read before proceeding with the next step of API. I noticed that i couldn't scroll to read all the messages with the dialog box opened. I appreciate any kind of help.

 

Thank you

10 REPLIES

Re: Scroll message window with API dialog box opened

Legend
Legend

Hello KR,

 

 

You can resize message window before starting your application. If you have a lot of messages this won't solve the problem and graphic window become smaller.

 

If you can specify what info you would like to get from API I can try to give better advice. 

For example it is possible to check if Femap API function succeded and if not check error code (zReturnCode):

Dim rc As zReturnCode
rc = App.feDelete(FT_PROP, 1)

 

Yarko

Re: Scroll message window with API dialog box opened

Pioneer
Pioneer
The info that will be displayed in the message window are not general checks. It is related to ouputs from selected elements based on which the model is tweaked. The first button in the API checks the output where the message is displayed in the window and the second button tweaks the model based on the message.

Could you please share the info on how to resize the message window?

Is scrolling the message window impossible with the API dialog box active?

Thank you
KR

Re: Scroll message window with API dialog box opened

Legend
Legend

When application runs dialogbox it blocks everything. You need to close it to be able to access femap. 

 

By resizing message window I meant to do it manually (using mouse) before you start your application. 

 

Another idea is to split your application on 2 separate ones.

 

Can you show me the example of message your use as input?

 

Yarko

Re: Scroll message window with API dialog box opened

Pioneer
Pioneer

 

This is the message that i see in the window. I have n number of load cases for which certain elements results are read. i cannot split the application into 2 parts. May be export this message to excel?

 

LC1 FWD_CC,CC,AA,BB
--------------------------------------------------------------------------------------------
1                   Property_AA           0.00
 
2                   Property_AA           0.00
 
3                   Property_AA         -75.99
 
4                   Property_AA           0.00
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB         251.52
 
1000               Property_CC         872.94
 
2000               Property_CC       -653.17
 
--------------------------------------------------------------------------------------------
LC2 DOWN_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         -29.28
 
2                   Property_AA         97.72
 
3                   Property_AA         -28.11
 
4                   Property_AA           5.05
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC3 UP_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         -14.01
 
2                   Property_AA         -16.91
 
3                   Property_AA         28.98
 
4                   Property_AA         -2.47
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC3 INBD_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         60.83
 
2                   Property_AA         21.08
 
3                   Property_AA         95.91
 
4                   Property_AA         -5.64
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC4 AFT_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         -99.94
 
2                   Property_AA         102.31
 
3                   Property_AA         32.09
 
4                   Property_AA         -30.96
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
FWD DECOMP_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         147.45
 
2                   Property_AA       -125.14
 
3                   Property_AA         -30.35
 
4                   Property_AA         51.91
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
AFT DECOMP_BB,CC,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA           0.00
 
2                   Property_AA           0.00
 
3                   Property_AA           9.59
 
4                   Property_AA         -47.43
 
18                 Property_BB           0.00
 
100               Property_BB       -385.44
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC         687.60
 
--------------------------------------------------------------------------------------------
AFT DECOMP_BB,BB,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA           0.00
 
2                   Property_AA           0.00
 
3                   Property_AA         23.94
 
4                   Property_AA         -60.26
 
18                 Property_BB           0.00
 
100               Property_BB       -477.78
 
200               Property_BB         523.42
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC1 FWD_BB,BB,AA,BB
--------------------------------------------------------------------------------------------
1                   Property_AA           0.00
 
2                   Property_AA           0.00
 
3                   Property_AA         -94.36
 
4                   Property_AA           0.00
 
18                 Property_BB           0.00
 
100               Property_BB         734.12
 
200               Property_BB       -605.29
 
300               Property_BB           0.00
 
400               Property_BB         299.97
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC1 FWD_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA         534.40
 
2                   Property_AA       -480.11
 
3                   Property_AA       -146.55
 
4                   Property_AA         229.04
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
AFT DECOMP_AA,AA,AA,AA
--------------------------------------------------------------------------------------------
1                   Property_AA       -364.26
 
2                   Property_AA         391.12
 
3                   Property_AA         68.15
 
4                   Property_AA       -102.98
 
18                 Property_BB           0.00
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC1 FWD
--------------------------------------------------------------------------------------------
1                   Property_AA         484.61
 
2                   Property_AA       -452.49
 
3                   Property_AA       -187.10
 
4                   Property_AA         251.50
 
18                 Property_BB         471.91
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00
 
--------------------------------------------------------------------------------------------
LC1 FWD
--------------------------------------------------------------------------------------------
1                   Property_AA         472.07
 
2                   Property_AA       -443.81
 
3                   Property_AA       -188.65
 
4                   Property_AA         253.33
 
18                 Property_BB         453.73
 
100               Property_BB           0.00
 
200               Property_BB           0.00
 
300               Property_BB           0.00
 
400               Property_BB           0.00
 
1000               Property_CC           0.00
 
2000               Property_CC           0.00

Re: Scroll message window with API dialog box opened

Legend
Legend

Now it's clear what you are trying to do. If you have all the data you can export it to excel and then use excel in button2 function.

 

I suppose it should be possible to share this data using global variables but I have to check this for vb6. I will experiment in the evening and let you know if will find something.

 

Yarko

 

 

Re: Scroll message window with API dialog box opened

Pioneer
Pioneer
Thank you. I was looking at fefileprint2(). Do you think if i can possibly write the messages to a text file and get it to open on the side.

Re: Scroll message window with API dialog box opened

Legend
Legend

If manual input is OK, you can use feFilePrint2 to output data into a file. 

 

If you preffer to automate procedure then it's better to output into excel. In this case you can read data automatically using button2. If you need example how to export to excel, you can find it here:

https://community.plm.automation.siemens.com/t5/Femap-Discussion-Forum/API-to-read-data-from-a-text-...

 

I've tried also to solve your problem using global variables but it seems that solution can quite complex in vb6. 

 

Yarko

Re: Scroll message window with API dialog box opened

Pioneer
Pioneer
What do you mean by if manual input is ok? I'm trying to use App.feFilePrint2(False,4,"C:\Users\fn330548\Desktop\msg.txt")
Do you know what format it should be saved? i cannot get to open it with notepad or wordpad. Thank you for your help.

Re: Scroll message window with API dialog box opened

Legend
Legend

Dear KR,

 

 

By manual input I meant that you have to open file, copy text and paste in your tool. It requires you to do this everytime your application is run.

 

I've checked function feFilePrint2 and for me it also gives strange output. I would like to suggest you to use simple vb6 functions to write text to file. Following example write text 3 lines to text file: 


Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim intFile As Integer
    Dim strFile As String
    strFile = "D:\file.txt" 'the file you want to save to
    intFile = FreeFile
    Open strFile For Output As #intFile
        Print #intFile,  "Hello"
        Print #intFile,  "Test1"
        Print #intFile,  "Test2"
    Close #intFile

End Sub

In result I got 3 lines in txt file. Hope this help.

 

Yarko