// =========================================================================== // 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. // =========================================================================== // // Description: // To get the list of file rules customized by user. // It should be the file rules list of current workspace // excluding the primary, secondary and translators list. // global proc string[] np_getCustomDataFileRules() { string $results[]; string $fileRuleList[] = `workspace -q -fileRuleList`; string $primaryFileRuleList[] = np_getPrimaryProjectFileRules(true); string $secondaryFileRuleList[] = np_getSecondaryProjectFileRules(true); string $translatorFileRuleList[] = np_getTranslatorDataFileRules(true); //Remove primary file rule name from file rule list of current workspace. int $listSize = size($primaryFileRuleList); string $primaryFileRuleNameList[]; for($i = 0; $i < $listSize; $i+=3) { $primaryFileRuleNameList[$i] = $primaryFileRuleList[$i+1]; } $fileRuleList = stringArrayRemove($primaryFileRuleNameList, $fileRuleList); //Remove secondary file rule name from file rule list of current workspace. $listSize = size($secondaryFileRuleList); string $secondaryFileRuleNameList[]; for($i = 0; $i < $listSize; $i+=3) { $secondaryFileRuleNameList[$i] = $secondaryFileRuleList[$i+1]; } $fileRuleList = stringArrayRemove($secondaryFileRuleNameList, $fileRuleList); //Remove translator file rule name from file rule list of current workspace. $listSize = size($translatorFileRuleList); string $translatorFileRuleNameList[]; for($i = 0; $i < $listSize; $i+=2) { $translatorFileRuleNameList[$i] = $translatorFileRuleList[$i]; } $fileRuleList = stringArrayRemove($translatorFileRuleNameList, $fileRuleList); $listSize = size($fileRuleList); for($i = 0; $i < $listSize; $i++) { string $item = $fileRuleList[$i]; $results[$i*2] = $item; $results[$i*2 +1] = `workspace -q -fre $item`; } return $results; }