cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Customizing the automated file name

Thanus_MR
9-Granite

Customizing the automated file name

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.

1 ACCEPTED SOLUTION

Accepted Solutions
sjuraj
13-Aquamarine
(To:Thanus_MR)

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

}
}

 

View solution in original post

6 REPLIES 6


@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.


Martin Hanák
RPN
17-Peridot
17-Peridot
(To:Thanus_MR)

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.

Thanus_MR
9-Granite
(To:RPN)

Could you please elaborate how to actually deploy this on my creo, Thanks in advance.

sjuraj
13-Aquamarine
(To:Thanus_MR)

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.

sjuraj
13-Aquamarine
(To:Thanus_MR)

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.

Top Tags