Cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh Process Simulate ?

Experimenter
Experimenter

Hello all !

 

I have done the following command to auto add properties in the Property List.

But after creating this file, i need to update Process Simulate.

Sans titre.png

 

Int64 x;
try
{
//Open the File
 StreamWriter sw = new StreamWriter("C:\\General\\PartSimulationProperties.xml", false, Encoding.ASCII);

int maxX = Convert.ToInt32(textBox1.Text);

sw.Write("</Property>\n");
sw.Write("</PartPropertyList>\n");
sw.Write("<PartPropertyList ProjectId=\"CA66E950-7BE8-4EBC-97B6-B7C373F1D6DE\">\n");
string propval = "0";

for (x = 1; x <= maxX; x++)
{
propval = Convert.ToString(x);
if (x<1000)
{ propval = "0" + Convert.ToString(x); }
if (x<100)
{ propval = "00" + Convert.ToString(x); }
if (x<10)
{ propval = "000" + Convert.ToString(x); }

sw.Write("<Property><PropertyName>"+propval+"</PropertyName></Property>\n");
}

sw.Write("</PartPropertyList>\n");
sw.Write("</PartPropertyLists>\n");
sw.Write("</emp:TuneDocument>\n");

// If possible, Command ==> refresh Process Simulate ( For now close and open again Process Simulate or change Simulation mode : Standard Mode or Line Simulation Mode)

sw.Close();
}
finally
{ }

 

 

Do you know any methods to refresh Process Simulate, or just to allow Process Simulate to read again the file PartSimulationProperties.xml

Because, if i open "Edit Project Property List" it doesn't refresh :/ I need to close/open PS or change "Simulation Mode" to refresh it.

I have try many codes, like calling the command "Line Simulation Mode/Standard Mode".  Close and open again Process Simulate. But the best way will be something like TxApplication.Refresh();

And unfortunately this function doesn't exist ...

 

Could you help me please ?

Geoffrey

6 REPLIES

Re: How to refresh Process Simulate ?

Valued Contributor
Valued Contributor

Hi, Geoffrey!

 

there is a TxApplication.RefreshDisplay() method.

By the way, you can simply convert Int64 to string with Int64.ToString(String) and I will recomend to use XmlWriter class to generate xml.

Re: How to refresh Process Simulate ?

Experimenter
Experimenter

Hi Witalij !

I know this method (TxApplication.RefreshDisplay()), but this method only refresh all viewers, not the data of Process Simulate.

 

Thank you for your help !

 

Best regards,

Geoffrey

Re: How to refresh Process Simulate ?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi  Geo00031,

 

Do you need to reload the current project or study in Process Simulate?

 

Best Regards,

DianaG

Re: How to refresh Process Simulate ?

Experimenter
Experimenter

Hi Diana,

 

Yes, i need to reload the current project, in the same way as changing mode.

Do you have informations about a possible method ?

 

Best regards,

Geoffrey

Re: How to refresh Process Simulate ?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi  Geo00031,

 

There is an API to load/reload the study:

 

TxEmsGlobalServicesProvider globalServices = new TxEmsGlobalServicesProvider(); 
globalServices.LoadStudy(TxApplication.ActiveDocument.CurrentStudy, TxUpdateDataType.DiscardChanges);

Best Regards,

DianaG

Re: How to refresh Process Simulate ?

Experimenter
Experimenter

Hi Diana !!

 

Thanks again for your help !