How to enter process parameters in batches for automatic analysis

How to enter process parameters in batches for automatic analysis

1292909313
Enthusiast Enthusiast
479 Views
4 Replies
Message 1 of 5

How to enter process parameters in batches for automatic analysis

1292909313
Enthusiast
Enthusiast

There are 37 different process settings in the picture below, how do I get the software to automatically set these process parameters and analyze them? Instead of manually changing the process parameters every time the scheme is re-replicated.

0 Likes
Accepted solutions (1)
480 Views
4 Replies
Replies (4)
Message 2 of 5

bernor_mf
Advisor
Advisor

@1292909313 

Hi,

this is possible with Synergy API.

 

I suggest you record your workflow in a macro.

This will give the basic code needed.

Such as: Open study , set parameters, save to new name and close.

 

Suggest to put parameters in file, that could be read.

 

So some programming needed to accomplish this automation.

 

Unfortunately, I do not have an off the shelf solution for this, but hope this gives some ideas. 

 

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 5

h-fujitaDXJU5
Enthusiast
Enthusiast
Accepted solution

Hi.

 

I have another method. Almost all steps are same as bernor_mf's solution.

Using "studymod" command with Windows batch file(.bat).

Moldflow Insight Help | The studymod utility | Autodesk

 

Base study file + modifier XMLfiles -> specific molding condition study files

37 XML files and a 37 line .bat file are needed.

 

(1)First, you specify TCODE from tcode.dat file in Moldflow folder or Macro recording

(2)Make modifier XML file each molding condition by some what your favorite macro. I will write down below.

Moldflow Insight Help | Example 1 - Editing process settings | Autodesk

(3)"studymod base.sdy mod01.xml" 37times in .bat file

(4)run .bat file in Synergy command shell

 

Regards.

 

-----Excel VBA Example to generate modifier XML file from Excel table format

Sub GenerateXML()
Dim header(20) As String, footer(5) As String


Let header(1) = "<?xml version=""1.0"" encoding=""utf-8""?>"
Let header(2) = "<StudyMod title=""Autodesk StudyMod"" ver=""1.00"">"
Let header(3) = " <UnitSystem>Metric</UnitSystem>"
Let header(4) = " <Material ID=" & """" & Sheets(1).Range("Q3") & """" & "/>"
Let header(5) = " <Property>"
Let header(6) = " <TSet>"
Let header(7) = " <!--Process controller-->"
Let header(8) = " <ID>30011</ID>"
Let header(9) = " <SubID>1</SubID>"
Let footer(1) = " </TSet>"
Let footer(2) = " </Property>"
Let footer(3) = "</StudyMod>"

 

Open ThisWorkbook.Path & "\" & Sheets(1).Range("E3") & ".bat" For Append As #2 'Windows batch file

 

For i = 1 To 10
    Open ThisWorkbook.Path & "\" & Sheets(1).Range("W" & i + 6) For Append As #1 'Modifier XML file
    For j = 1 To 9
        Print #1, header(j)
    Next j
    'Write each molding condition to XML
    For j = 14 To 17
        Print #1, "<!--" & Sheets(1).Cells(5, j) & "-->"
        Print #1, " <TCode>"
        Print #1, " <ID>" & Sheets(1).Cells(6, j) & "</ID>"
        Print #1, " <Value>" & Sheets(1).Cells(i + 6, j) & "</Value>"
        Print #1, " </TCode>"
    Next j

    '(now j=18)
    Print #1, "<!--" & Sheets(1).Cells(5, j) & "-->"
    Print #1, " <TCode>"
    Print #1, " <ID>" & Sheets(1).Cells(6, j) & "</ID>"
    Print #1, " <Value>" & Sheets(1).Cells(i + 6, j) & "</Value>"
    Print #1, " <Value>" & Sheets(1).Cells(i + 6, j + 1) & "</Value>"
    Print #1, " <Value>" & Sheets(1).Cells(i + 6, j + 2) & "</Value>"
    Print #1, " </TCode>"

   

    'Write last 3 lines
    For j = 1 To 3
        Print #1, footer(j)
    Next j
    Close #1
    ' Append a Windows command line to the .bat file
    Print #2, "studymod " & Sheets(1).Range("U" & i + 6) & " " & Sheets(1).Range("V" & i + 6) & " " & Sheets(1).Range("W" & i + 6)
Next i
Close #2

End Sub

hfujitaDXJU5_0-1734414176869.png

 

 

Message 4 of 5

1292909313
Enthusiast
Enthusiast

Thanks a lot, I've solved this with python

Message 5 of 5

1292909313
Enthusiast
Enthusiast
Thanks a lot, I've solved this with python