API - Tcode reference and MessageID

API - Tcode reference and MessageID

Anonymous
Not applicable
789 Views
6 Replies
Message 1 of 7

API - Tcode reference and MessageID

Anonymous
Not applicable

Hi community, 

 

I have trouble getting values from tcodes. For example, I want to extract pvT coefficients with tcode 1004 or mechanical properties data but I didn't manage to succeed... Do you have scripts to help me ?

 

Also, I tried to use SystemMessage.GetDataMessage but is there a list of all the messageId that can be extracted from this method ?

 

Thank you for your help

0 Likes
790 Views
6 Replies
Replies (6)
Message 2 of 7

bernor_mf
Advisor
Advisor

Hi @Anonymous ,

I believe PVT coefficients might be protected for this kind of extraction.
Is available in tcode, but could be for write only.


Here is a way to extract data from analysis log:

API example: Extract information from screen out file
For the analysis log, .out file; see details in cmmesage.dat
in folder such as:
C:\Program Files\Autodesk\Moldflow Synergy 2019\data\dat


I did not dig in to how to extract the PVT coefficients using that example, but should be possible.

Share your findings.

 

Hope this helps.
Regards,
Berndt

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
0 Likes
Message 3 of 7

Anonymous
Not applicable

Thank you for your answer. Is this the same for mechanical properties ? I don't know how to read them

 

Thank you

0 Likes
Message 4 of 7

bernor_mf
Advisor
Advisor

Hi,

yes, and tcode 1621.Mechanical properties data, for thermoplastics material.

It is in the cmmesage.dat file.

----
MSCD 1621 6 0 0 0 0 0 5
    
       Mechanical properties data:                    E1  = %11.4G
                                                      E2  = %11.4G
                                                      v12 = %11.4G
                                                      v23 = %11.4G
                                                      G12 = %11.4G
    Pa,1,1
    Pa,1,2
    ,0,3
    ,0,4
    Pa,1,5
----

 

In Pa, so you need to recalculate the found data to MPa.

 

Regards,

Berndt

 

 

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
0 Likes
Message 5 of 7

bernor_mf
Advisor
Advisor

Just wanted to add:

to use this way of getting data, you need to run at least a Fill analysis, to get an Analysis Log to read.

 

Regards,

Berndt

 

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
0 Likes
Message 6 of 7

Anonymous
Not applicable

thank you for your explanations but could you give me more ? What shoudl I do with E1 = %11.4G ? or with Pa,1,1 ?

 

0 Likes
Message 7 of 7

bernor_mf
Advisor
Advisor

Hi,

have a look at examples:

API example: Extract information from screen out file

 

' Read Maximum Injection pressure and the time it occurred
' return the array of numerical values associated with the last instance of Message ID (MSCD) 41400
' MSCD 41400 1 0 0 0 0 0 5
'       Maximum injection pressure          (at %11.4G) = %11.4G
'    s,1,2
'    Pa,1,1
' Note: Please see .../data/dat/shared/cmmesage.dat for format details
Set MM = lMessages.GetMessage(41400,0)
lStr = "Maximum injection pressure occured at " & CStr(MM.GetFloat(1)) & " Pressure =     " & CStr(MM.GetFloat(0)) 
MsgBox CStr(lStr)

 

So for

1621.Mechanical properties data

----
MSCD 1621 6 0 0 0 0 0 5
    
       Mechanical properties data:                    E1  = %11.4G
                                                      E2  = %11.4G
                                                      v12 = %11.4G
                                                      v23 = %11.4G
                                                      G12 = %11.4G
    Pa,1,1
    Pa,1,2
    ,0,3
    ,0,4
    Pa,1,5
----
' Note: Please see .../data/dat/shared/cmmesage.dat for format details
Set MM = lMessages.GetMessage(1621,0)

lStr = "E1= " & CStr(MM.GetFloat(0)) & " E2=      " & CStr(MM.GetFloat(1)) 
MsgBox CStr(lStr)

' or could be:
'lStr = "E1= " & CStr(MM.GetFloat(1)) & " E2=      " & CStr(MM.GetFloat(2)) 
'MsgBox CStr(lStr)

 

"What should I do with E1 = %11.4G ? or with Pa,1,1 ?"

> That is format description. You could leave %11.4G

Pa,1,1, is unit, so in Pa which you might want to recalculate to MPa, and the last number, 1, is the position in array of MM.

 

Hope this clarifies.

Regards,

Berndt

 

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
0 Likes