// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: September 2006 // // // // // // setAttrEnumResource(string $nodeType, string $attrShortName, int $enumIndex, string $str) // // // // // Convenience routine to define localizable string resource values // for an attribute's enumerated values. // // // string $nodeType the node type // string $attrShortName the attribute's short name // string $enumIndex the index associated with the enum value (0, 1, 2, etc.) // string $str display string // // // // // Set the attribute enum strings associated with // // attribute "md" on node type "myNode". // // This example shows English resource values, however this // // routine would more often be called in practice to provide // // localized string values. // // // setAttrEnumResource( "myNode", "md", 0, "Disabled"); // setAttrEnumResource( "myNode", "md", 1, "Enabled"); // // // global proc setAttrEnumResource( string $nodeType, string $attrShortName, int $enumIndex, string $str ) { // Key has format n_NNN.a_AA1_enum_XX // Where NNN = node type // AA1 = attribute short name // XX = enum index (number) string $fullId = "n_" + $nodeType + ".a_" + $attrShortName + "_enum_" + $enumIndex; displayString -replace -value $str $fullId; }