Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
While creating a new part in creo, it's automatically taking prt001. Is there any way to make a unqiue customized name while creating a part, Right now we are trying to implementing this on IPEM creo where its integrated to Teamcenter.
Solved! Go to Solution.
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
}
}
@Thanus_MR wrote:
While creating a new part in creo, it's automatically taking prt001. Is there any way to make a unqiue customized name while creating a part, Right now we are trying to implementing this on IPEM creo where its integrated to Teamcenter.
Hi,
Creo does not enable user to set his own standard part name.
Check ProMdl.h. I would use the notifier (*ProMdlCreatePreAction) PRO_MDL_CREATE_PRE, here a ProName can specify the new model name, additional you can lock further rename. With ProMdlObjectdefaultnameGet() your are able to get the next default name by type.
Could you please elaborate how to actually deploy this on my creo, Thanks in advance.
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
}
}
Hi sjuraj,
Thanks for your response, and also will this work for the every object? while creating the part, drawing, assembly and so on. Also looking forward from you on how to deploy this on actual creo, since i dont know much about coding, Thanks in advance.
This works for every object.
If you are not familiar with coding you can hardly deploy this solution. Making only one simple api command is complex task.
API is very powerful way how to customize creo, I suggest everyone to learn coding for Creo.
Eg we have command which will sets all parameter in model base on specific user and project - this can save cca 2 minutes for model. If you have 100 models in asm it can save 200 minutes in one click.