Skip to main content
12-Amethyst
September 13, 2021
Question

Importing .txt file for parameter list

  • September 13, 2021
  • 2 replies
  • 7077 views

Recently I've created a parameter set for selecting a material from a drop down.  This list drives relations used for grabbing dimensions for an auto-bom table.  I'm having trouble importing this list via .txt file, and I'm wondering if there needs to be a specific syntax for the strings int he .txt file?  This list is pretty simple:

"1X4"

"2X4"

"2'' FOAM"

etc.

 

I have been using a mapkey that creates the parameter, and then adds each material, line by line.  As you can imagine, this is pretty tedious to update.. 

 

When I try to go into the parameter and right click in the list window, select import, and select the .txt file, nothing happens.  Any thoughts?

2 replies

tbraxton
22-Sapphire II
22-Sapphire II
September 13, 2021

The typical syntax for a text file used to create parameters from a text file would be:

 

parameter_name_1 = whatever
parameter_name_2 = foo
parameter_name_3 = bar

 

If you are looking to automate the setting the values of multiple parameters in a model then Pro/Program may offer the solution. You can define the parameters in the input section. With this defined, upon regeneration of the model you will be prompted for the source used to assign values to the parameters. One of the options will be from file which will use a previously created text file to define the values.

Pro/Program examplePro/Program example

 

lockarde12-AmethystAuthor
12-Amethyst
September 13, 2021

Thanks for the prompt reply @tbraxton! I formatted my list as you described and still get nada.  Do I need " " because it's a list of strings? Side note: I also tried to export the full list I had created to try and discern the format, and that exported list comes out as a blank csv.  Apologies if I'm being dense, still digesting my first cup of coffee this morning..

tbraxton
22-Sapphire II
22-Sapphire II
September 13, 2021

I suspect I am not understanding exactly what you are attempting to do. I gather you want to define multiple parameters in a part by importing a file. See my remarks in my original response about Pro/Program.

 

One option is to paste the text file contents into the relations definition UI which will create the parameters. You should then delete the relations made from the pasted data once the parameters are defined. You can then export the parameters in xml format for use in importing into other models. When defining strings in the relations UI you will need to use double quote marks as shown here.

 

parameter_1="string value"

 

In my example above for the 3 string parameters, this is what the xml file syntax looks like. An xml file may work out better for what you are trying to do. You should be able to use this as a template to generate an xml file in a text editor to define a list of string parameters.

XML file syntaxXML file syntax

 

 

 

 

kdirth
21-Topaz I
21-Topaz I
September 13, 2021

Here is what I get in a txt file:

kdirth_0-1631537867499.png

I believe you are missing the definition of the parameter columns.

 

Here is what I get in a csv file:

kdirth_1-1631537950701.png

Each column separated by a comma.

There is always more to learn.
lockarde12-AmethystAuthor
12-Amethyst
September 13, 2021

Thanks @kdirth !  Does the information you provided apply to a restricted values list parameter?  I'm trying to create a drop-down list of values like in the image below:

Snag_5b15b0.png

kdirth
21-Topaz I
21-Topaz I
September 13, 2021

Here is one that I have that is restricted:

kdirth_0-1631539584264.png

 

The restriction comes from windchill.  The value input in the model would need to exactly match one of the acceptable values in windchill.  I have not seen a dropdown list in the model parameters.  In our system, adding a value to a column in the windchill attributes adds the parameter to the model.

 

There is always more to learn.