The Origin Forum
File Exchange
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Adding options to the export_page command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

johannes.kastl

Germany
71 Posts

Posted - 04/23/2012 :  3:12:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

as described in originlab.com/forum/topic.asp?TOPIC_ID=10387 Im trying to export all non-hidden graphs in a origin project. As it does not work atm with labtalk, Im trying to solve the problem with origin c.

Writing a little script, compiling, writing another ogs script calling the function, adding a button. Seems like it could work.

But what I am missing is documentation about the export_page function, especially about the options.

Using labtalk I would try it like this

expGraph type:=emf overwrite:=replace path:="%X" filename:="%G--%(page.label$)"
		tr.margin:=2
		tr1.unit:=3 
		tr1.Width:=100
		tr2.tif.dotsperinch:=300


tr1.unit is setting the export to ratio, tr1.width sets the ratio to 100%. tr.margin sets the export mode to use the whole page.

How to do the same with export_page?

I would be glad for any hints, even if you tell me to rtfm. As long as you point out which fm ich should r. I have found not much documentation about export_page.

Thanks in advance!

Johannes

Penn

China
638 Posts

Posted - 04/24/2012 :  04:09:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Johannes,

If using Origin C, you can try the following example.

void test_expgraph_lt()
{
	GraphLayer gl = Project.ActiveLayer();  // get the active graph layer
	if(!gl)
		return;
	
	// construct the LabTalk command
	string strCmd = "expGraph type:=emf overwrite:=replace path:=G:\\";
	strCmd += " filename:=\"";
	strCmd += Project.GetName();  // project name
	strCmd += "--";
	strCmd += gl.GetPage().GetName();  // graph name
	strCmd += "\" tr.margin:=2 tr1.unit:=3 tr1.Width:=100 tr2.tif.dotsperinch:=300;";
	LT_execute(strCmd);  // execute the LabTalk script
}


Penn
Go to Top of Page

Penn

China
638 Posts

Posted - 04/24/2012 :  05:44:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please refer to your original post for the workaround of LabTalk.

Penn
Go to Top of Page

johannes.kastl

Germany
71 Posts

Posted - 04/24/2012 :  4:05:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the answer. I had already found that way. But isnt calling a labtalk 'function' from Origin C a rather ugly way? Or is export_page really missing these options?

Its not urgent anymore, as the labtalk way to export all graphs seems to work. Just out of interest.
Go to Top of Page

Penn

China
638 Posts

Posted - 04/25/2012 :  11:01:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Johannes,

I have checked with our developer about the TreeNode option in the export_page function. The settings is not so powerful as using expGraph, and it is also complicated. So, this usage is not recommended. It is more easier for such case to call expGraph in Origin C, though it does not look so good as you said.

Penn

Edited by - Penn on 04/25/2012 11:02:50 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2008 Originlab Corporation Go To Top Of Page
Snitz Forums 2000