Graphical Digitization Data To File

Started by bruceam, January 28, 2014, 01:06:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bruceam

I am using Visio 2010 Pro, and within this framework, I have created a series of Smartshapes that allow me to "digitize" the characteristic curves of the electronic parts I uses.  I place the smart shape at the origin of a graph that I want to digitize (usually one I have copied from a datasheet as a graphical image), and then enter the scale factors and offsets for the "X" and the "Y" axises of the smart shape.  I then move the smart shape's control point along the graphical line, and "X" & "Y" coordinates are displayed to arbitrary precision.  I simply write down the ordered pairs.  I can used them Excel or any other data crunching program.

What I would really like would to have is a button or a keystroke command that would write/append the present data point to an Excel spreadsheet file, a database file (MS Access or some other database like MySQL, PostGreSQL, etc ...), or at least a comma (or tab) separated text file that I could import into these programs.

Does anyone have an idea how this final feature could be implemented?

Thank you in advance!

Bruceam

Jumpy

#1
You could add a user defined cell for the list of X and of Y values to your smartshape.
-> User.XList, User.YList
Then add an action (right click menu) to clear the lists.
-> Menu: ="Clear", Action: =SETF(GETREF(User.XList),"")+SETF(GETREF(User.YList),"")
Then add an action (right click menu) to add the current value/position of the control to the list
-> Menu: ="Add", Action: =SETF(GETREF(User.XList),User.XList & ";" & User.X)+SETF(GETREF(User.YList),User.YList & ";" & User.Y)
Here was assumed that the default separator for list items is ";" and that the calculated values for X/Y are stored in User.X / User.Y.

You can add further actions, for example remove last item of the list, but that is more complicated.

If you don't want to use Actions and "only" shapesheet magic for this, you can do similar with VBA macros started with key-shortcuts.

For the last part, storing the values in a Database ot Excelsheet you will likely need custom code anyway.

The above method stores the values in the shape first and then transfers them to a DB in one go (even though I gave no ready solution for that last part because it depends on what you realy want to do with the data.).

You can change this approach and store each value as it comes, direct in the DB. Don't know if that is better?




bruceam

Jumpy,
Thank you for your suggestion.  I will look into both the "Actions" and the "VB" solutions. 

Thanks again!

bruceam