The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Extracting Result of polyarea Command

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
BennettS Posted - 11/02/2018 : 08:05:58 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2018b (64-bit)
Operating System: Windows 7

What ist the correct way to get the result from the polyarea command into an usable form to write it into a cell?
As far as I understood, the value of the "area" Output gets written in the result window, but is not accessible from the script window in an easy way.
So either asking for the value with a simple

area=;

after running the command or using it in a similar form to one of these methods

csetvalue col:=[Fit]Sheet1!col(A)[1] formula:="area";
[Fit]Sheet1!Cell(1,2) = area;

does not work.

Thanks for your help.
4   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 11/08/2018 : 11:55:49 AM
Hi BennettS,

Yes, this x-function sets the result to the specified (numeric) variable.

If you want to print something to Result Log, you can redirect the destination by setting the
"type.redirection" property to 16 like:
type.redirection=16;     //Output is redirected to Result Log
type -a Area: $(myarea,.3);  //or to print worksheet contents, run type.wks(Result);
type.redirection=32768;  //Output is set back to default
https://www.originlab.com/doc/LabTalk/ref/type-obj

Please try.

--Hideo Fujii
OriginLab
BennettS Posted - 11/08/2018 : 04:51:25 AM
Hi Hideo,

your solution works perfectly, thank you.
So the output from this X-function has to be stored immediately on execution and accessing the result log is not possible with Labtalk?

As for the rd option, I found it as a general remark here
https://www.originlab.com/doc/LabTalk/guide/XF-Input-and-Output
and tested if it was usable in this case too.
Hideo Fujii Posted - 11/07/2018 : 11:59:24 AM
Hi BennettS,

I don't see "rd" parameter in the polyarea x-function in:
https://www.originlab.com/doc/X-Function/ref/polyarea

As far as I tried, the following code worked:
polyarea iy:=(col(1),col(2)) type:=abs area:=myarea;
range rr=[Result]!col(1);
rr[1]=myarea;
Make sense?

--Hideo Fujii
OriginLab
BennettS Posted - 11/07/2018 : 05:22:01 AM
A bit more digging got me the the rd Option for X-functions, but

polyarea iy:=(col(4),col(10)) type:=abs rd:=[Result]sheet1!;

does not lead to any result, although I can't tell of that's a specific problem with only polyarea or more general.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000