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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Modifying legend size or Copy format with Labtalk
 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 - 06/06/2013 :  08:57:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everyone,

is there a way to use "Copy format" with Labtalk?

I have to adjust the legend of a lot of graphs, especially the size of the outer border. In the graph, by left-clicking on the border, the border can be adjusted and the size can be changed (the minimum size seems to be defined by the text within the legend).

I found no settings anywhere on how much "bigger" (than the text) the legend is. And I found nothing about it in regard to Labtalk.

My only solution at the moment is to copy the dimensions and "paste format" it for each single legend by hand.

Regards,
Johannes


Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0G SR2
Operating System: WinXP

Kathy_Wang

China
159 Posts

Posted - 06/13/2013 :  05:02:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If I understand correctly, you would like to increase the "gap" between the legend border and legend text, right? Unfortunately there is no LabTalk control for that, you can only manually drag and drop the border box. I am attaching an image to illustrate this control in case someone else is reading this post:



So in order to make your work easier, you may call the corresponding sections in the built-in ogs file for copy format and paste format. For example the sample script below will work the same as you manually right click on Graph 1, choose "Copy Format:Dimensions" and then go to every graph window in the project, right click and choose "Paste Format".


//Activate the window of Graph1
win -a Graph1;
//This is equivalent to right click-Copy Format-Dimensions
run.section(file,FmtsCopyDimensions);
//Execute the script in {} for all graph windows in project
doc -e P
{
//In each loop, active the current graph window.
win -a %H;
//This is equivalent to right click-Paste Format
run.section(file,PasteFormats);
}


Kathy
Originlab
Go to Top of Page

johannes.kastl

Germany
71 Posts

Posted - 06/13/2013 :  07:50:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kathy,

you got it. That was exactly what I was looking for.

Maybe you could add a enhancement request for the next release. It would be nice if there was a dialog where one can choose how mach space is between the text/symbols and the surrounding line. The minimum is different, depending on which plot type (bar, line, symbol) and which legend border (left/right, upper/lower). So it is hard to set it exactly equal without copying the format...

Thanks,
Johannes

BTW: Is there an overview how to get the other 'copy format' commands apart from Dimensions? I had a look into the file.ogs but that is pretty big and confusing, so a nice little overlook would be better to remember...

Edited by - johannes.kastl on 06/13/2013 07:52:37 AM
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 06/13/2013 :  10:01:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you have the Script Window open, and click a menu item while holding the Shift + Ctrl keys, the corresponding LT script (if any) will be returned to the script window, and also the menu id.

This will be helpful to get the script for other similar operations.

Kathy
Originlab
Go to Top of Page

johannes.kastl

Germany
71 Posts

Posted - 06/27/2013 :  09:21:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kathy,

finally got time to try out your answer, and it works.

I figured I can 'select' the legend via
GObject foo = legend;
which is necessary to tell labtalk which formats/dimensions/... to copy (in my case the formats/dimensions/... of the legend). Or is there another way?

Thanks,
Johannes
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 07/01/2013 :  03:47:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Johannes,

You may use the page -s command to select the legend object before you copy the dimension.

To get the object name, you may either right click on the legend object, choose Programming Control, or use the list -o command.

Kathy
Originlab

Edited by - Kathy_Wang on 07/02/2013 9:52:41 PM
Go to Top of Page

johannes.kastl

Germany
71 Posts

Posted - 07/01/2013 :  07:16:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Kathy,

thats better than using GObject.

Johannes

BTW: Your links just open 404-error-pages on my machine, but I knew where to look, so I found it anyway.
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 07/02/2013 :  9:56:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by johannes.kastl

Thanks Kathy,

thats better than using GObject.

Johannes

BTW: Your links just open 404-error-pages on my machine, but I knew where to look, so I found it anyway.



Thanks for reporting this Johannes.

It seems there was a redirecting error, now the documentation links should be fixed in my previous post.

Sorry for the inconvenience.

Kathy
Originlab

Edited by - Kathy_Wang on 07/02/2013 10:05:48 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 © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000