Ansys Learning Forum › Forums › Discuss Simulation › LS Dyna › Commend to import and export .k file in LS-PrePost › Reply To: Commend to import and export .k file in LS-PrePost
What is your goal in using this .bat file? You said you want to read in .k into LSPP. Does this mean you want the bat file to launch LSPP and open a k file using GUI? The command to launch LSPP and open a k file is simply,
C:\Program Files\LSTC\LS-PrePost 4.10\lsprepost4.10_x64.exe input.k
You also said you want the bat file to read and then write a k file. What is being changed when you write this k file? Those changes should be defined in LSPP command file (.cfile). For example, below sample test.cfile will open input.k, translate part 4 by 10 in negative x direction, and then save the file as input_mod.k. The batch command to run this process without GUI access is,Â
"C:\Program Files\LSTC\LS-PrePost 4.10\lsprepost4.10_x64.exe" runc=test.cfile
Note that path is defined in quotes due to spaces in the path. The contents of test.cfile are
$-------------------------------------------------------
openc keyword "input.k"
genselect node add part 4/0Â
translate_model -10 -0 -0
translate_model accept 0 1001001 1001001
transform_model done
save keywordabsolute 0
save keywordbylongfmt 0
save keywordbyi10fmt 0
save outversion 12
save keyword "input_mod.k"
$-------------------------------------------------------
Â
Â