Command Result Copy Paste

Hello,
I want to automate a function with the button editor.
Therefore the result of e.g. command _Area is to be copied to the clipboard.
Then the value is to be inserted into the text field at the command _Text.
Thanks for your help.

Kind Regards
Ralf

Hi @Ralf-AnrA,

How about this?

_NoEcho _-RunScript (
Call Rhino.Command("_Area")
tokens = Split(Rhino.CommandHistory, VbCr)
Call Rhino.ClipboardText(tokens(UBound(tokens)- 1))
)

– Dale

Hello Dale,
thanks a lot for your help.
Unfortunately, it’s not quite working out yet.
I tried this:

_CPlane Objekt
_Pause
_ProjectToCPlane Ja
_Echo _-RunScript (
Call Rhino.Command("_Area")
tokens = Split(Rhino.CommandHistory, VbCr)
Call Rhino.ClipboardText(tokens(UBound(tokens)- 1))
Call Rhino.Command("_Text")
Call Rhino.Command("_Paste")
)

But it does not copy the contents of the results row.
Also the Rhino command “_paste” does not help.
I think “_paste” is not executed within the running command “_text”.
I can press ctrl+V to insert the results.
This is then the result which is inserted:

Flächeninhalt = 750.826864 (+/- 1e-07) Quadrat-Millimeter

A long time ago I created complex Marcos in Excel.
There you could read out certain characters of a “string”
Counting from the right or left ( e.g. right 17,23)
Does this also work here?
Then you could extract only the number up to three places behind the comma.
That the result would look like this:
750.826

Thank you very much for your help.
Happy Regards
Ralf

Hi @Ralf-AnrA,

Since you trying to put the area calculation in text, why don’t you just use text fields?

– Dale