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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Mapkey to rename features with dimension data

Matthijs1
2-Guest

Mapkey to rename features with dimension data

I'm trying to create a mapkey that renames my features with an identifier from it's own dimension.

For example

Round 1, which has a radius of 5mm gets names to "R5"

Hole 1 with a diameter of 10 gets renamed to "ø10"

M6 hole gets renamed to "M6"

 

Because of Creo, every featurename has to be unique even though it has a unique feature ID. So to do that I would like to add the feature ID or feature number (Any unique identifier for that specific feature) behind the name.

So Round 1 with feature ID 3864 becomes "R5 (id3864)". Even better would be to make the text invisible using invisible characters but that might be too much to ask.

 

So far I've tried everything but I can't find a way to let the mapkey copy the value of the feature or anything from the feature information window. Rounds don't even have parameters I could try to use.

 

Things to note: We don't have OTK or Jlink and we don't use Round Sets for unrelated reasons, so the Round feature always has the same feature information overview.

 

Can anyone help me out? Would be greatly appreciated!

 

Matthijs

6 REPLIES 6
tbraxton
21-Topaz II
(To:Matthijs1)

I would ask you to explain why you need to do this since it may bring in other options to solve your problem. What you seek is not possible without some programming and use of the APIs or external software.

 

In general, it does not seem like a good idea, and I am a user that likes to name features. If you could add comment lines to the model tree would that solve your problem?

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

Hi T Braxton,

Thanks for your quick response!

 

We often make models that contain multiple different rounds and holes. To keep the model organized and clear for other users to use and/or modify quickly, we'd like to add some information to feature names.

An extra column in the model tree with information would perhaps be viable, though I work at a big company where a format change like this would not be easy to make. So where possible, I'd like to stay within the boundaries that I've got to work with.

 

There's no way for mapkeys to copy text? Changing the name of a feature is easy with mapkeys, It's just that using stored text seems impossible.

I'm okay with the name not being permanently linked to the feature but instead needing a refresh once changed, if that makes a change?

tbraxton
21-Topaz II
(To:Matthijs1)

Some comments and suggestions.

To modify commonly used features, you can build the design intent into the models such that if you need to change a set of holes or other features you can do it with modification to a single parameter. This can be accomplished with relations so you can change all rounds or holes of a certain size to a different dimension value by modifying a single number parameter (as a simple example).

 

With regard to finding features to modify, if you create standard search queries for the types of features that you need to access often, that would be a much more useful approach to locate features for modification IMO. You can create mapkeys to execute these queries if desired.

 

Have you considered using comments in the model tree as shown below along with naming features manually? See below comments from a model tree. These serve to document at a high level the model tree structure so that a user (including the author) is able to quickly determine the structure when coming back to a model.

 

With this approach you can include all M6 hole features under a comment line and group them. This will dramatically reduce the number of names needed to be generated.

 

tbraxton_0-1713979052267.png

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

What you are wanting to do is not going to be possible with just mapkeys (as far as I know). You may be able to use the Web.link API, which is free. But I'm not certain of this as I have not tried to do anything similar to this request before. The VB API is also available for free so that could be another option for you.

Thanks Mike,

 

I've asked my superior to get OTK, Weblink and VB API installed on my laptop. I understand those are all free and should be included in the regular install? I hope that makes it possible for me to create the functionality we need. In the meanwhile, do you have any idea as to how to get this done in OTK? I've never used it before so it's gonna take some time to figure it out I reckon.

RPN
17-Peridot
17-Peridot
(To:Matthijs1)

Hi, for me it looks like that you probably didn’t test your target scenario 😀

 

From your notes:
Round 1, which has a radius of 5mm gets names to "R5". - should work

Hole 1 with a diameter of 10 gets renamed to "ø10" - No Way

M6 hole gets renamed to "M6" - should work

So Round 1 with feature ID 3864 becomes "R5 (id3864)". - No way

 

I checked, a couple, but this is a ProName 31 Len, and _A-Z0-9 may work, that’s it, No blank. No Unicode, no parentheses 🤔

 

Beside of the work you will have to accomplish this, I would check to display one feature parameter, this will give you much more freedom for the display value. 
You could then use feature relation to automatically update the value if a dimension has changed.

In this case you need to copy relations to the feature and with some adjustments you would be good to go.


If you try to program this, expect more the 2 hours 😉, a button to init the names, a notification after Regen, create a new feature und redefine, to update the names, are needed as well (maybe more). 

 

The idea is okay, for some kind of feature. But check what you can do with the model tree OOTB!


Next check the output of a Pro/Program, this listing may very useful to parse.

 

If you just started to program, I would expect min. 10 weeks of hard work! 😎

 

 

 

 

Top Tags