Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
This example works:
This creates a restricted parameter that lists 12 (plus "TBD" - To Be Decided) Yick Sang mold textures under the parameter name "TEXTURE". You must specify the file in your config.pro thusly:
restricted_val_definition <path>
Trouble is, I want more than 12 values and if my line gets longer the file doesn't work any more. Still trying to work out the syntax for that.
By much research and trial-and-error, I have two restricted-value-parameter listings to share with anyone that has a need. Such features are one way to extract useful productivity from your Creo work (by limiting parameters to specific values, and providing tables of useful information - if you've ever had to enter the same information more than twice - MAKE A TABLE). The first is a listing that has just one table. Sometimes that's all you need, and it is often best to combine everything you need into one table anyway (easier to manage choices from a family table):
ND_ParamDefArr_K01 = {
{ Name = SHAPE_NAME ! Name of Material Shape
Type = string
Table = SHAPE
},
{ Name = SHAPE_DESCRIPTION ! Description of Material Shape
Type = string
Table = SHAPE
},
{ Name = SHAPE_MTL ! Default material ASTM
Type = string
Table = SHAPE
},
{ Name = SHAPE_W ! Raw Weight of Material per Unit
Type = real
Table = SHAPE
},
{ Name = SHAPE_A ! Raw Surface Area of Material per Unit
Type = real
Table = SHAPE
},
{ Name = SHAPE_T ! Standard Thickness of Material
Type = real
Table = SHAPE
},
{ Name = Rev_Year
Type = integer
Default = 2011
Enum = {2011,2012,2013,2014,2015,2016,2017,2018,2019,2020}
},
{ Name = Rev_Month
Type = integer
Default = 0
Enum = {0,1,2,3,4,5,6,7,8,9,10,11,12}
},
{ Name = Rev_Day
Type = integer
Default = 0
Range = [0,31]
}
}
ND_ParamTable_K01 = {
NAME = SHAPE
HEAD = SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
ROWS = 'GA_010_32SHEET', '32GA', 'SHEET', 'A1011', 0.4075, 1.3968, 0.0097
'GA_012_30SHEET', '30GA', 'SHEET', 'A1011', 0.5000, 1.7280, 0.0120
'GA_015_28SHEET', '28GA', 'SHEET', 'A1011', 0.6250, 2.1456, 0.0149
'GA_018_26SHEET', '26GA', 'SHEET', 'A1011', 0.7500, 2.5776, 0.0179
'GA_024_24SHEET', '24GA', 'SHEET', 'A1011', 1.0000, 3.4416, 0.0239
'GA_030_22SHEET', '22GA', 'SHEET', 'A1011', 1.2500, 4.3056, 0.0299
'GA_036_20SHEET', '20GA', 'SHEET', 'A1011', 1.5000, 5.1696, 0.0359
'GA_042_19SHEET', '19GA', 'SHEET', 'A1011', 1.7500, 6.0192, 0.0418
'GA_048_18SHEET', '18GA', 'SHEET', 'A1011', 2.0000, 6.8832, 0.0478
'GA_060_16SHEET', '16GA', 'SHEET', 'A1011', 2.5000, 8.6112, 0.0598
'GA_067_15SHEET', '15GA', 'SHEET', 'A1011', 2.8125, 9.6912, 0.0673
'GA_075_14SHEET', '14GA', 'SHEET', 'A1011', 3.1250, 10.7568, 0.0747
'GA_090_13SHEET', '13GA', 'SHEET', 'A1011', 3.7500, 12.0624, 0.0897
'GA_105_12SHEET', '12GA', 'SHEET', 'A1011', 4.3750, 12.9168, 0.1046
'GA_120_11SHEET', '11GA', 'SHEET', 'A1011', 5.0000, 17.2224, 0.1196
'GA_135_10SHEET', '10GA', 'SHEET', 'A1011', 5.6250, 19.3680, 0.1345
'GA_150_09SHEET', '9GA', 'SHEET', 'A1011', 6.2500, 21.5280, 0.1495
'GA_164_08SHEET', '8GA', 'SHEET', 'A1011', 6.8750, 23.6736, 0.1644
'GA_179_07SHEET', '7GA', 'SHEET', 'A1011', 7.5000, 25.8912, 0.1793
'GA_194_06SHEET', '6GA', 'SHEET', 'A1011', 8.1250, 27.9792, 0.1943
'GA_209_05SHEET', '5GA', 'SHEET', 'A1011', 8.7500, 30.1248, 0.2092
'GA_224_04SHEET', '4GA', 'SHEET', 'A1011', 9.3750, 32.2848, 0.2242
'GA_239_03SHEET', '3GA', 'SHEET', 'A1011', 10.0000, 34.4304, 0.2391
'PL001250', 'PL1/8', 'PLATE', 'A36', 5.1000, 18.0000, 0.1250
'PL001875', 'PL3/16', 'PLATE', 'A36', 7.6600, 27.0000, 0.1875
'PL002500', 'PL1/4', 'PLATE', 'A36', 10.2100, 36.0000, 0.2500
'PL003125', 'PL5/16', 'PLATE', 'A36', 12.7600, 45.0000, 0.3125
'PL003750', 'PL3/8', 'PLATE', 'A36', 15.3200, 54.0000, 0.3750
'PL004375', 'PL7/16', 'PLATE', 'A36', 17.8700, 63.0000, 0.4375
'PL005000', 'PL1/2', 'PLATE', 'A36', 20.4200, 72.0000, 0.5000
'PL005625', 'PL9/16', 'PLATE', 'A36', 22.9710, 81.0000, 0.5620
'PL006250', 'PL5/8', 'PLATE', 'A36', 25.5300, 90.0000, 0.6250
'PL007500', 'PL3/4', 'PLATE', 'A36', 30.6300, 108.000, 0.7500
'PL008750', 'PL7/8', 'PLATE', 'A36', 35.7400, 126.000, 0.8750
'PL010000', 'PL1', 'PLATE', 'A36', 40.8400, 144.000, 1.0000
}
BTW only use notepad to edit something like this - turn wordwrap off and your rows can be long - I limit mine to 248 characters (I suspect 256 or a few less may be the max). The spaces between columns isn't absolutely necessary - but makes editing easier. Document your work with comment information (I use ! to start all my comments)
Here is a multi-table version:
ND_ParamDefArr_K01 = {
{ Name = SHAPE_NAME ! Name of Material Shape
Type = string
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
! Multiple tables listed per format in example shown in help "About Table-restricted Parameters"
! {
! Name = <name>
!
! Type = <type> (the basic type - integer, real, string, boolean, etc.)
!
! [Access=<access>]
!
! TABLE = <table-name_1>, <table-name_2>, .., <table-name_n>
!
! }
!
{ Name = SHAPE_DESCRIPTION ! Description of Material Shape
Type = string
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
{ Name = SHAPE_MTL ! Default material ASTM
Type = string
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
{ Name = SHAPE_W ! Raw Weight of Material per Unit
Type = real
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
{ Name = SHAPE_A ! Raw Surface Area of Material per Unit
Type = real
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
{ Name = SHAPE_T ! Standard Thickness of Material
Type = real
Table = SHAPE_SHEET, SHAPE_PLATE, SHAPE_ANGLE
},
{ Name = Rev_Year
Type = integer
Default = 2011
Enum = {2011,2012,2013,2014,2015,2016,2017,2018,2019,2020}
},
{ Name = Rev_Month
Type = integer
Default = 0
Enum = {0,1,2,3,4,5,6,7,8,9,10,11,12}
},
{ Name = Rev_Day
Type = integer
Default = 0
Range = [0,31]
}
}
ND_ParamTable_K01 = {
NAME = SHAPE_SHEET
!
! 'Index Alpha Sort',SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
! 'GA PL 'NAME', 'SHAPE', 'A1011/A36', LBS/U, AREA/U, THICKNESS
!
HEAD = SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
ROWS = 'GA_010_32SHEET', '32GA', 'SHEET', 'A1011', 0.4075, 1.3968, 0.0097
'GA_012_30SHEET', '30GA', 'SHEET', 'A1011', 0.5000, 1.7280, 0.0120
'GA_015_28SHEET', '28GA', 'SHEET', 'A1011', 0.6250, 2.1456, 0.0149
'GA_018_26SHEET', '26GA', 'SHEET', 'A1011', 0.7500, 2.5776, 0.0179
'GA_024_24SHEET', '24GA', 'SHEET', 'A1011', 1.0000, 3.4416, 0.0239
'GA_030_22SHEET', '22GA', 'SHEET', 'A1011', 1.2500, 4.3056, 0.0299
'GA_036_20SHEET', '20GA', 'SHEET', 'A1011', 1.5000, 5.1696, 0.0359
'GA_042_19SHEET', '19GA', 'SHEET', 'A1011', 1.7500, 6.0192, 0.0418
'GA_048_18SHEET', '18GA', 'SHEET', 'A1011', 2.0000, 6.8832, 0.0478
'GA_060_16SHEET', '16GA', 'SHEET', 'A1011', 2.5000, 8.6112, 0.0598
'GA_067_15SHEET', '15GA', 'SHEET', 'A1011', 2.8125, 9.6912, 0.0673
'GA_075_14SHEET', '14GA', 'SHEET', 'A1011', 3.1250, 10.7568, 0.0747
'GA_090_13SHEET', '13GA', 'SHEET', 'A1011', 3.7500, 12.0624, 0.0897
'GA_105_12SHEET', '12GA', 'SHEET', 'A1011', 4.3750, 12.9168, 0.1046
'GA_120_11SHEET', '11GA', 'SHEET', 'A1011', 5.0000, 17.2224, 0.1196
'GA_135_10SHEET', '10GA', 'SHEET', 'A1011', 5.6250, 19.3680, 0.1345
'GA_150_09SHEET', '9GA', 'SHEET', 'A1011', 6.2500, 21.5280, 0.1495
'GA_164_08SHEET', '8GA', 'SHEET', 'A1011', 6.8750, 23.6736, 0.1644
'GA_179_07SHEET', '7GA', 'SHEET', 'A1011', 7.5000, 25.8912, 0.1793
'GA_194_06SHEET', '6GA', 'SHEET', 'A1011', 8.1250, 27.9792, 0.1943
'GA_209_05SHEET', '5GA', 'SHEET', 'A1011', 8.7500, 30.1248, 0.2092
'GA_224_04SHEET', '4GA', 'SHEET', 'A1011', 9.3750, 32.2848, 0.2242
'GA_239_03SHEET', '3GA', 'SHEET', 'A1011', 10.0000, 34.4304, 0.2391
}
ND_ParamTable_K01 = {
NAME = SHAPE_PLATE
!
! 'Index Alpha Sort', SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
! 'GA PL 'NAME', 'SHAPE', 'A1011/A36', LBS/U, AREA/U, THICKNESS
!
HEAD = SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
ROWS = 'PL001250', 'PL1/8', 'PLATE', 'A36', 5.1000, 18.0000, 0.1250
'PL001875', 'PL3/16', 'PLATE', 'A36', 7.6600, 27.0000, 0.1875
'PL002500', 'PL1/4', 'PLATE', 'A36', 10.2100, 36.0000, 0.2500
'PL003125', 'PL5/16', 'PLATE', 'A36', 12.7600, 45.0000, 0.3125
'PL003750', 'PL3/8', 'PLATE', 'A36', 15.3200, 54.0000, 0.3750
'PL004375', 'PL7/16', 'PLATE', 'A36', 17.8700, 63.0000, 0.4375
'PL005000', 'PL1/2', 'PLATE', 'A36', 20.4200, 72.0000, 0.5000
'PL005625', 'PL9/16', 'PLATE', 'A36', 22.9710, 81.0000, 0.5620
'PL006250', 'PL5/8', 'PLATE', 'A36', 25.5300, 90.0000, 0.6250
'PL007500', 'PL3/4', 'PLATE', 'A36', 30.6300, 108.000, 0.7500
'PL008750', 'PL7/8', 'PLATE', 'A36', 35.7400, 126.000, 0.8750
'PL010000', 'PL1', 'PLATE', 'A36', 40.8400, 144.000, 1.0000
}
ND_ParamTable_K01 = {
NAME = SHAPE_ANGLE
!
! 'Index Alpha Sort', SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
! 'GA PL 'NAME', 'SHAPE', 'A1011/A36', LBS/U, AREA/U, THICKNESS
!
HEAD = SHAPE_NAME, SHAPE_DESCRIPTION, SHAPE_MTL, SHAPE_W, SHAPE_A, SHAPE_T
ROWS = 'A_L0500X0500X0125', 'L1/2X1/2X1/8', 'ANGLE EQUAL LEG', 'A36', 0.3800, 0.1094, 0.1250
'A_L0625X0625X0125', 'L5/8X5/8X1/8', 'ANGLE EQUAL LEG', 'A36', 0.4800, 0.1406, 0.1250
'A_L0750X0750X0125', 'L3/4X3/4X1/8', 'ANGLE EQUAL LEG', 'A36', 0.5900, 0.1719, 0.1250
'A_L0875X0875X0125', 'L7/8X7/8X1/8', 'ANGLE EQUAL LEG', 'A36', 0.7000, 0.2031, 0.1250
'A_L1000X0625X0125', 'L1X5/8X1/8', 'ANGLE UN-EQUAL LEG', 'A36', 0.6400, 0.1875, 0.1250
'A_L1000X0750X0125', 'L1X3/4X1/8', 'ANGLE UN-EQUAL LEG', 'A36', 0.7000, 0.2031, 0.1250
'A_L1000X1000X0125', 'L1X1X1/8', 'ANGLE EQUAL LEG', 'A36', 0.8000, 0.2344, 0.1250
'A_L1000X1000X0188', 'L1X1X3/16', 'ANGLE EQUAL LEG', 'A36', 1.1600, 0.3398, 0.1875
'A_L1000X1000X0250', 'L1X1X1/4', 'ANGLE EQUAL LEG', 'A36', 1.4900, 0.4688, 0.2500
'A_L1125X1125X0125', 'L1-1/8X1-1/8X1/8', 'ANGLE EQUAL LEG', 'A36', 0.9000, 0.2813, 0.1250
'A_L1250X1250X0125', 'L1-1/4X1-1/4X1/8', 'ANGLE EQUAL LEG', 'A36', 1.0100, 0.2969, 0.1250
'A_L1250X1250X0188', 'L1-1/4X1-1/4X3/16', 'ANGLE EQUAL LEG', 'A36', 1.4800, 0.4336, 0.1875
'A_L1250X1250X0250', 'L1-1/4X1-1/4X1/4', 'ANGLE EQUAL LEG', 'A36', 1.9200, 0.5625, 0.2500
'A_L1375X0875X0125', 'L1-3/8X7/8X1/8', 'ANGLE UN-EQUAL LEG', 'A36', 0.9100, 0.2656, 0.1250
'A_L1375X0875X0188', 'L1-3/8X7/8X3/16', 'ANGLE UN-EQUAL LEG', 'A36', 1.3200, 0.3867, 0.1875
'A_L1500X1250X0188', 'L1-1/2X1-1/4X3/16', 'ANGLE UN-EQUAL LEG', 'A36', 1.6400, 0.4805, 0.1875
'A_L1500X1500X0125', 'L1-1/2X1-1/2X1/8', 'ANGLE EQUAL LEG', 'A36', 1.2300, 0.3594, 0.1250
'A_L1500X1500X0188', 'L1-1/2X1-1/2X3/16', 'ANGLE EQUAL LEG', 'A36', 1.8000, 0.5273, 0.1875
}
These are just examples. The 'NULL' value becomes important if you want to combine tables for items that have some, but not all the same column information (refer to Help Topic 'Example: Sample Restriction Table'). Notice that each entry in the first column must be unique and sortable (ascending alphanumeric order). Syntax - Brackets, Single Quote Marks, Commas are all very critical.
Hope this helps someone with their Restricted Value Parameter Table endeavors. I have submitted a Product Idea - see Table Restricted Values Editor
If you like the idea - vote it up and give it a 'like'. The only way help make future editions of Creo more useful to us end users is to give an idea enough attention that PTC takes notice!