Skip to main content
1-Visitor
November 19, 2019
Question

Batch processing - removing entities from xml files and flatten the files

  • November 19, 2019
  • 1 reply
  • 4023 views

Here is my script

 

set Arbortext="C:\Program Files (X86) \PTC\Arbortext Editor\bin\x86\editor.exe"

for %%i in (*.xml) do (

"C:\Program Files (X86) \PTC\Arbortext Editor\bin\x86\editor.exe" -c -b "doc_flatten all undeclare" %%i

)

 

I cant get the changes to save to each file.  Any help appreciated.

1 reply

16-Pearl
November 20, 2019

In this case you should use the doc_save command and in fact this takes a parameter to allow it to flatten entities too. So, you may either call doc_flatten and doc_save or only doc_save. http://support.ptc.com/help/arbortext/r8.0.0.0/en/index.html#page/Program/acl_ref/help14996.html

Example code:

doc_save(0, 0x2C000)

1-Visitor
November 25, 2019

How do you call 2 functions in same batch process?  if you could provide 2 samples.  one with doc_save alone and one with both.  Thanks.

16-Pearl
November 25, 2019

If you use the all-in-one doc_save method then you don't need to worry about double function calls. The following is untested but should in theory work:

 

set Arbortext="C:\Program Files (X86) \PTC\Arbortext Editor\bin\x86\editor.exe"

for %%i in (*.xml) do (

"C:\Program Files (X86) \PTC\Arbortext Editor\bin\x86\editor.exe" -c -b "doc_save(0, 0x2C000)" %%i

)