MATHCAD, Geomagic Freeform, Mecsoft VisualCAM & CAD CAM CNC software support discussion forum. Moderated.

Moderators: caddit, evanish, Moderators

#545 by caddit
Sun Apr 05, 2009 6:54 am
Hi wallclimber85,

Sorry about the late reply. There are a few ways to do this - some require special variable syntax but it isn't hard and doesn't require extra software. T-FLEX has powerful ability to link databases (including spreadsheets) directly into 3D designs.

Basic Concept:
Excel -> Database -> Variable -> Update

1 Create Excel File
I use Excel 2003 for this. Create a simple excel file with sheet 1 looking like this and save:

Hint: After selection, default is to link external files using full path. You can edit the directory path part of the filename for reletive path, in case you want to move the excel file with T-FLEX .grb file to another hard disk location later. Also, if you later want to change a T-FLEX model with excel, open the excel file first then the T-FLEX model, otherwise T-FLEX may lock the Excel file as "read only".

Note: For T-FLEX, the first record (row) of a DB table always defines the names of the columns. We can use any name we want for each column - CADDIT in this case for column #1:) SAVE THE FILE. T-FLEX can also create entire value option menus for parameters, when a column has multiple values.

2 Create a Database in T-FLEX
This might be intimidating for some who never work with databases (like in SolidWorks?) but it is very useful for advanced functions.
From T-FLEX MENU: Parameters -> Database

A new window opens called Database Editor. You can have many databases defined in a T-FLEX model file.
From Database Editor MENU: File -> New database

A new window opens called Database Properties. Give this T-Flex database some kind of name ("demo" in this example), and click the "Reference" checkbox. The "File Name" browse function will now be enabled, find your excel file you saved on the hard disk and select it. Then select the TABLE NAME (Or SHEET name in the case of Excel files) you have the data on... Sheet1$ in our case. Click SAVE DATABASE.


Note: T-FLEX 3D CAD can import data from DBase, FoxPro, Paradox, Access & Excel as well as text and CSV files.

3 Apply Each Database Field as a Model Variable
Now create a new Variable from a selected field of this T-FLEX database:
From T-FLEX MENU: Parameters -> Variables

A new window opens called Variable Editor for editing model variables.
From Variable Editor MENU: Variable -> New

A new window opens called Variable Properties. Give this T-Flex variable some kind of name ("len" in this example), and type the following for Expression and click OK: val( 1, demo.CADDIT )
*Please note that even the spaces are important in syntax as shown above


This means: val[ue of] (Row #1, of database name "demo".Column name "CADDIT")
We named our imported Excel database "demo". We labeled the source data column of our excel file "CADDIT". More about using the VAL function in Variable Expressions in T-FLEX help.

Now you can apply that Variable to any Parameter in the model (using "Insert Variable" right click menu option when editing a model variable, or use the F8 key). When you change AND SAVE the Excel file, T-FLEX should warn you that external data has changed and ask if you want to update the model (sometimes you may need to click "regenerate model"). Note that in 2D sketch, Excel driven dimensions only update construction geometry - not graphic lines! (this is another powerful incentive to use construction lines in T-FLEX). Be sure to save the T-FLEX .grb file after updating.

As I said, this is just one way. If you have your data in DBase or Access format, there are commands to link directly to the file without creating a T-FLEX database. Right now there is no direct ODBC support that I know of.

Give it a go and see if that helps!

#560 by wallclimber85
Tue Apr 21, 2009 3:17 pm
Can T-Flex read office 2007? I keep getting the following error: "Error reading Database contents". When I select the excell document of choice it doesnt give me the option to select a sheet. Please help.
#561 by caddit
Tue Apr 21, 2009 3:26 pm

I 'm not sure we chose to stick with Office 2003. But Excel does have an option to "Save As.." Excel 2003 format spreadsheet. Try saving your excel file that way (as 2003 workbook) and see if it makes any difference.

#562 by wallclimber85
Tue Apr 21, 2009 6:10 pm
No difference. Would it be because of a trial version?

#590 by wallclimber85
Thu Apr 30, 2009 1:56 pm
T-FLEX Parametric CAD 11 Evaluation Release
#591 by caddit
Thu Apr 30, 2009 2:29 pm
Hi wallclimber85,

I'm sure this question must have been a little annoying for you, but I guess what I meant was the complete version number. Several improvements have been made to the code since the DVD release and its possible that you are hitting some sort of old bug for your particular system ( :? )

Find out the exact version of T-FLEX CAD from the T-FLEX menu:
Help -> "About..." and look at the number toward the bottom for "Build:" - it should say something like "". That is the full version we are looking for, sorry...

Is it also possible for you to email us a sample spreadsheet/excel workbook you are having trouble with for us to have a look in the lab and do some tests? Please send it to:


We will have a look. The latest version of T-FLEX CAD is 11.28 BTW, you can download it here: ... ucts_id=59

#595 by wallclimber85
Fri May 01, 2009 2:39 pm
The build that I have is I tried the example spreadsheet in the instructions above, that's where I had trouble. I will send the spreadsheet that i would like to work with T-Flex. Thanks again for your help.
#596 by caddit
Mon May 04, 2009 2:49 am
Hi wallclimber85,

There didn't seem to be any problem in 11.0.28 of selecting a sheet from your Excel file. Instead of getting any "Error reading Database contents", we see the list of tables corresponding to the sheets of the workbook as usual:


There could be a few things at play here. First you can try to download and install the latest version of T-FLEX over the version you have now: ... ucts_id=59

This might have been a bug in I can't imagine that this would be some kind of permissions error and the file reads fine in our lab so it can't be the format.

#599 by wallclimber85
Mon May 04, 2009 8:09 pm
I'm not getting any sheet names after I select the workbook. I have updated to version
#600 by caddit
Wed May 06, 2009 5:37 am
Hi wallclimber85,

Please have a closer look at the tutorial, there are a few things to make sure you are doing:

1) the key point is to "name" the required part of the Excel table. (see the step "give this database some kind of a name" in original tutorial of this thread)

2) Make sure you turn off any Excel file protection settings. In Excel make sure the file is not password protected and is writable from the operating system.

3) Are you using Vista? Just curious...

Outside that, I can suggest you try on another computer and see if you have any different results. Our lab and our offshore developers have not had any problem to read the Excel file you have sent per email, so it must be some small thing that just isn't being followed...
#1674 by Sledhead
Tue Oct 18, 2011 1:58 am
Hey there how's it going down under over there? Just had a question for you guys about this old posted thread regarding wallclimber85's attempt to reference an excel spreadsheet within a t-flex design. First off, I would just like to mention that I, too was experiencing problems attempting to do the exact thing, I am running on windows Vista platform, however I did eventually succeed in bringing the spreadsheet in to form a t-flex database. The problem I am now having, as I believe was also the original intent of wallclimber is that I am trying to use the database to define the line of what is a parabola, (and what will become the edge of a 3d solid model of a parabolic shape) with the database consisting of some 4 thousand X & Y variables. So, I hope you now realize my problem is that I am uncertain as to HOW to assign these variables all at once(almost like snap) to the parameters of the line, besides through creating 4000 nodes and then assigning each a variable one by one which, I hope you see, would prove to be very time consuming. Is there any other way possible of assigning multiple variables at a time in order to solve this very time consuming problem? I am currently learning how to use t-flex on a promotional version of the software and would definitely be interested in acquiring the software for future work if the operation which I seek is possible. Thank you for taking the time to read this very exhausting request to be sure, and I would appreciate any help you may have to offer.