we have created jlink api command to automate file name while creating new component in assembly
it basically run macro with variable fileName generated during execution of command
in your case you can create command:
public class AutoName extends DefaultUICommandActionListener {
private final Session session;
public AutoName(Session session) {
this.session = session;
}
@Override
public void OnCommand() throws jxthrowable {
String fileName = somehowGenerateFileName();
session.RunMacro("~ Command `ProCmdModelNew`; "
+ "~ <another creo command to select part and filling input with fileName> ;");
//this commands can be seen in manually created macro or in trail file
}
}