cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Create and Designate a Restricted Value Parameter at the same time - Designated = YES

Create and Designate a Restricted Value Parameter at the same time - Designated = YES

Hello,

It would be nice to define an option to designate a parameter when you create it by the Restricted Value Parameter list.

(parameter.lst  &  restricted_val_definition)

For example, add:     Designated = YES    in the parameter.lst

 

ND_ParamDefArr_K01 = {

  { Name = PARAMETER_NAME

    Type = string

    Default = 'BLUE'

    Enum={'BLUE','RED','GREEN','GREY'}

    Access = full

    Designated = YES

  }

}

6 Comments
Aquamarine

Designate box defined in lst.jpg

Regular Member

BRILLIANT......I absolutely love it!  It is a pain to have to go back and designate the parameter because you can't do a check in. 

I am trying to find a workaround using ModelCHECK, if anyone has done it, please comment.

 

Thanks!! 

Aquamarine

I'm not sure exactly what workaround you're looking for, but here goes.

 

In ModelCHECK, use the start checks (.mcs files) to designate the parameter as well as specifying a defined list of acceptable values.  Something like the following:

 

PRT_PARAMETER PART_COLOR STR EQ PDM                    <- to designate the parameter
PRT_PARAMETER PART_COLOR STR EQ LIST_COLORS   <- to call out a list of acceptable values

 

LIST_COLORS RED
LIST_COLORS BLUE
LIST_COLORS GREEN

 

You would still use your restricted value parameter file, so the parameter has the dropdown list in the parameter GUI as well.

 

You may want to consider making the default color in the restricted value parameter file something like "_ENTER_A_COLOR_" and then check for this with ModelCHECK to throw the error. [That way all your parts won't default to "BLUE".]  When the user runs ModelCHECK in update mode, they will be presented with a drop down list for the PART_COLOR parameter in the ModelCHECK GUI.

 

Hope that helps.

 

Regards,

Dan N.

 

Regular Member

Dan,

Thanks for the info.  I am new to Modelcheck  so I am still trying to configure the settings.

 

Let me know if you agree with the following statement.

* You can only designate the parameter only if it already existed in the model.

* You can't ADD and Designate the parameter in the same check.

I tried the following syntax, I think the second (designate section) overrode the create parameters above)

! Create parameter if it does not exist

PRT_PARAMETER DHF_SECTION STR EQ 00 N/A
PRT_PARAMETER TRACEABILITY_METHOD STR EQ UNTRACED
PRT_PARAMETER PART_SUBCLASS STR EQ OTHER
PRT_PARAMETER COATING_FINISH STR NEQ NULL

! Designate parameters
PRT_PARAMETER DHF_SECTION NONE EQ PDM
PRT_PARAMETER TRACEABILITY_METHOD NONE EQ PDM
PRT_PARAMETER PART_SUBCLASS NONE EQ PDM
PRT_PARAMETER COATING_FINISH NONE EQ PDM

Aquamarine

Let me know if you agree with the following statement.

* You can only designate the parameter only if it already existed in the model.

* You can't ADD and Designate the parameter in the same check.

 

I believe your first statement is correct, but I've never tested having just a PDM check without other checks.  It might work if you have just a single line for a parameter and you don't care about the value at all.  It would be easy to check though.  Use PRT_PARAMETER XXX STR EQ PDM, run ModelCHECK and see if XXX is added.

No, you cannot add and designate the parameter in the same check.  If you run ModelCHECK just once, it will give you an error that the parameter doesn't exist and create it (or have you create it).  You then need to run ModelCHECK again for the designate check to work.

 

In your examples above, you should try to keep the parameter type the same in all checks.  You switch from STR to NONE.

In your first three "create parameters" checks, the parameter will be created automatically with the value you have specified.  The COATING_FINISH value would need to be entered by the user via the ModelCHECK GUI.

 

As an FYI, we run ModelCHECK in update mode only, and our mapkeys that run ModelCHECK run it multiple times.  We do this so missing items are created, layers renamed, parameters renamed, etc. in the first check.  Then those items are checked again for layer status, values, etc. in the subsequent ModelCHECK runs.

 

Regards,

 

Dan N.

Regular Member

Dan,

Thanks for the Modelcheck 101.    I learned that if I set the MU_ENABLE to Y   (Under the config_init.mc), using the same syntax above, it will add the parameters in my model and designate them.  MU_ENABLE  will allow modelcheck to add the parameters to the model and the  NONE EQ PDM will designate the parameter.   

 

Still have a lot to learn, but making progress.