// =========================================================================== // 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 // // // // // // getPluginResource(string $pluginName, string $lookUpKey) // // // // Look up a plugin string resource given the plugin name // and unique resource ID. // //

// Lookup keys must be unique. Both the plugin name and the // lookup key are used to uniquely identify the resource. // //

// Plugin script resources are registered and initialized using // the registerPluginResource command. They can be optionally be // overridden with localized values using setPluginResource. // // // string $pluginName Unique Plugin name // string $lookUpKey Unique key for this string resource // // // string: the string resource value associated with the key. // If the key is not found, the return value will be empty. // // // // // Query the value of a menu item's label and use it // // to set the string. // // The plugin name is "myPlugin" and the resource name // // is "showBBoxLabel" // // // string $mLabel = getPluginResource("myPlugin", "showBBoxLabel"); // menuItem -l $mLabel; // // // global proc string getPluginResource( string $pluginId, string $stringId ) { // Form full id string. // Plugin string id's are prefixed with "p_" string $fullId = "p_" + $pluginId + "." + $stringId; int $exists = `displayString -exists $fullId`; if ($exists) { string $str = `displayString -query -value $fullId`; return $str; } else { string $msg = (uiRes("m_getPluginResource.kLookupFailed")); error(`format -s $pluginId -s $stringId $msg`); } }