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
 Forum for Origin C
 Using own function in Origin C

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
aredart Posted - 09/14/2016 : 05:21:28 AM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Origin 2016

Dear Origin-Team,

I have two problems.

First, I would like to add a Graph Page to an existing Book: I would like to import an analyze my Data in one sheet and plot it in the next sheet in the same book. It is no problem to import, analyze and plot my Data, but the plot always appears in a new Book.
I found out how to add a new Graphsheet per mouseclick, but how does it work with Origin C?
Also I would like to add a Notesheet in the existing book, but the same problem occurs.

Second, I tried to call a function I wrote by myself (and added to 'System') in another Origin C-Skript, as if it were an original Origin-function. The function analyzes my data and does not need any extra variables.
For example (this is taken from your documentation):

void example1()
{
Worksheet wks = Project.ActiveLayer();
wks.AddCol();

Column colA;
colA.Attach(wks, 0);
colA.SetFormula("5*(i-1)");
colA.ExecuteFormula();
}

Now I save example1() in the System-folder and write a new script like this:

void example2()
{
Worksheet wks = Project.ActiveLayer();

if(!wks)
{
return;
}
else
{
example1()
}
}

Its very short, but I hope you can understand how it was meant.
I tried it in many different ways, but it never worked.

I really appreciate any help and readily answer any question.
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 09/18/2016 : 02:56:42 AM
Hi,

1. Answer to question 1
If you want to add notes as sheet, you can go to this page:
http://www.originlab.com/doc/OriginC/ref/Worksheet-EmbedNote
If you want to add graph as sheet, you can go to this page:
http://www.originlab.com/doc/OriginC/ref/Worksheet-EmbedGraph

2. Answer to question 2
You'd better create a header file and then include this header file in your OC file.
For example, you can save example1() as a header file example.h in the same folder with your OC file. In your OC file, include this header file by
#include "example.h"

Hope it can be some help.

Regards,
Yuki
OriginLab

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