Tape Measure Add-in/Extension with copy/paste


#1

I managed my woodworking projects via an Excel spreadsheet which provides me a ton of information about my project including such things as a cut list, weights and moments of inertia. Part of this process involves going back and forth between Excel and SKU 2017. I will use the SKU tape measure to get a measurement then go back to Excel to enter it.

It would be nice to have an assignable hot-key or a right click context menu in SKU to copy the value of the tape measure to the Windows clipboard so I could just paste it into my spreadsheet.

I don’t know if the SKU API’s will even support this.

Would anyone be interested in developing this tool - if possible?
Thanks - Rick


#2

I have done a cutlist your way in the past.
Do you know you can use a plugin called CUTLIST to create the list for you?

You could copy and paste the excel cutlist into your standard template spreadsheet you describe.


#3

Thanks - but the scope of what my Excel spreadsheet does is massive and way beyond the scope of this conversation. A cut list is only one small thing. What I really need is a way to get the value of the tape measure into the windows clipboard.


#4

Just tried to offer a simple solution, seems it’s a bit more complicated than I understand!

Best of luck anyway


#5

It’s not impossible and I can conceive of a way using AutoHotkey if you do not mind installing it. I do wonder if it’s the best way to get measurements out of SketchUp.


#6

No problem - I appreciate the help.


#7

A right click context menu may be easier and better if you can hook into the API. With a context menu you could have things like copy, snap to axis and other creative things.


#8

It would be a hot key if anything, and not a SketchUp plugin at all so no menu. You would also need to install AutoHotkey if that was not clear. It’s a quick and dirty solution to your request.

If I were writing something like this for myself I would make it so that you could select a component and then send the dimensions directly to the spreadsheet or a file.


#9

Nice idea but Excel, by design, will not let a sub-ordinate container write to its parent container. You would have to pass the address of the consecutive cells to the SKU function - but the SKU program would be outside of the Excel object model so I just don’t see how that would work.

It would be nice to be able to select a component, execute something and capture all three dimensions and the volume in one key stroke - maybe each value space delimited and the result copied to the clipboard.

Then inside the Excel spreadsheet, you could have a cell function that reads the clipboard and parses out all four values and loads them into each cell.

Thanks for chipping in Jim - I like your thinking.


#10

How about someone simply writing a new Tape function with the functionality we have discussed since we are apparently limited in SKU API’s.


#11

I never heard of AutoHotKey. After a brief perusal of its features it could easily be used with Excel to extract and parse clipboard contents. All we would need is a SKU tool to put the 3 dimensions and volume of an object that has focus in the clipboard; space delimited.

This should not be that difficult.


#12

Your trying to do it the hard way. Ruby has a Win32OLE class, which can open and talk to Excel spreadsheets (or any OLE office application.)

Forget the clipboard !


#13

Except I don’t know anything about Ruby. Furthermore, I believe it would be difficult to write to an already open spreadsheet.


#14

Dan - I am sure there are many ways to skin this cat. I really do appreciate yours and everyone else’s feedback on how I might solve this problem,

I do know that integrating back into Excel the way you suggested would be complicated and not as easy as it is to say.

The only programming I do these days is in C++ and VBA inside MS Office applications like Excel for my own benefit. I do maintain a few command line apps I have scattered around many ex-clients. I am retired and I really do not feel like learning yet another programming language after 40 years of writing code.

I either misunderstood the purpose of this community and in that case I apologize for wasting everyone’s time.
Otherwise I obviously did not make my opening statements clear.

So let me be clear - I am looking for someone to do this coding for free or for fee.


#15

Then using Win32OLE will be second nature. Look at the examples, it uses the VBA object model.


#16

Did not know that - can you point me to the examples please?
But I would still rather have someone else do this for free or for fee.


#17

I gave the link above, here it is again: Ruby Standard lib: Win32OLE class

This is the MS link I have bookmarked for use with OLE:

I had posted a basic example I think over at SketchUcation:

There are many old topic threads on SketchUp <-> Excel communication over there in the Developers forum.

I do not do workflow code for free anymore. And I do not have MS Office anymore to test with anyhow.


This other code example I posted a few weeks ago might interest you:


#18

OK found the Ruby API documentation and API’s - much more than what I am willing to learn.
If no one is interested in doing this for free or fee then I guess I go without.


#19

The main problem is that the native SketchUp tools do not have much interface via the API.
We can tell when they are activated and deactivated, but that is about it. The toolstate property is worthless now as all the events are queued up and dumped after the tool operation is complete.

Basically it means whenever we want to interface with a tool, we have to write a full-blown clone in Ruby or C. So this means someone will have to write a clone of the MeasureTool.

Anyhow, if you use the DimensionTool instead, you can double click the values, and use that context menu script I linked above, to get a copy command onto the SketchUp context menu. (Which puts the value onto the Clipboard.)


#20

This gets you half-way there doesn’t it? What I mean is do you have or can you write an Excel function to read data from a text file which is exported from SketchUp?

Alternatively, isn’t Excel able to link a worksheet to external (text) data file and update the worksheet when the data file is updated?