Skip to main content
1-Visitor
May 12, 2015
Question

Data utility to force name to uppercase

  • May 12, 2015
  • 5 replies
  • 2497 views

Hi,

we would like to enforce all names being uppercase, both on creation and during rename.

Had the idea of creating a custom data utility to drive this which could be fired on a rename. Is it also possible to reference a data utility in an OIR or would we need to check for check in and fire the utility then?

Cheers

5 replies

23-Emerald II
May 21, 2015

What about putting an Uppercase constraint on the attribute?

5-21-2015 5-08-11 PM.png

The constraint types are mentioned here:

http://www.ptc.com/cs/help/windchill_hc/wc101_hc/index.jspx?id=TypeMgrAttrConstraintRuleRef&action=show

1-Visitor
May 22, 2015

HI,

that will fix the uppercase part, but also now looking at doing some sanity checking such as replacing underscores with spaces and possible some escape characters so that you can force certain characters to lower case such as when specifying a bolt size eg M10x35.

Currently looking into either using a validator or a listener as also need to be able to check on rename.

23-Emerald II
May 22, 2015

I think a validator could be used here. The following article provides an example of how to check name and number in the rename wizard. You should be able to modify this to suit your purposes:

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS119050

1-Visitor
May 22, 2015

Does anyone know why this solution does not apply to CAD Documents?

IMPORTANT NOTE: This does not apply to the CAD Documents (EPMDocument) rename action

23-Emerald II
May 22, 2015

Mark,

A different wizard/set of code is used to rename CAD Documents, which is why the code in the article will not work for that type.

The supported approach for CAD Documents is to use a listener. See https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS121491.