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
 LAYOUTS IN 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

mdl3051

USA
4 Posts

Posted - 09/25/2001 :  4:08:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I've written a pretty extensive LabTalk script that creates a very nice, large set of worksheets and graphs at the touch of a button. My problem is that I want to create a set of Layouts, hopefully templates, that contain various combinations of these graphs. I have 3 basic problems

1)The first problem is that I can't do a "SAVE AS TEMPLATE" like I can on graphs and worksheets.
2)I can't find a command that will drop a particular graph/worksheet on the layout without user intervention.
3)I can't create one layout that looks exactly like I want and then replace the graphs/worksheets with different ones w/o deleting the first ones. What I would like to do is right-click on the graph and perform something like "REPLACE GRAPH WITH...."

I'm very impressed with OriginPro but this lack of automation on the layouts is throwing me a curveball.

Marvin Landrum
Texas Instruments
m-landrum1@ti.com

rtoomey

USA
184 Posts

Posted - 09/26/2001 :  09:59:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
mdl3051,

  1. Although not supported, one can attempt to save a layout window using the following command:

    save -t windowName fileName; // fileName must be a full path description


  2. You are correct. No such command exists. However, a suggestion has been made to add this command in a future version of Orign.


  3. Layout pages display graphs/worksheets based on window name. Since this is the case, couldn't you just duplicate those windows that are being displayed in the layout? Once you've duplicated them, you could delete the original versions and replace them at will...without any loss of data. It's just a thought. Duplicating a window is accomplished by using the following command:

    window -d windowName; // where windowName is the name of the active window




- rtoomey



Go to Top of Page

mdl3051

USA
4 Posts

Posted - 09/27/2001 :  1:07:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
3. The reason I can't do this is that I would like to use the same layout format (placement/size of graphs&worksheets, etc..) multiple times in one project. In other words, I would like to use a layout template to show similar plots/worksheets with different names. So basically what I want to do is manipulate the layout template to point to different window names.
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 09/27/2001 :  5:02:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you are only dealing with graphs in your layouts then why not just create graph templates composed of multiple graphs? I work with several templates like this. You just have to keep track of the layers associated with each graph and plot the right data to the right layer.

But I do agree that it would be nice to work with templates through LabTalk. That way you would be able to have a full sized graph (easier to work with) and a layout.

Craig Storey
Origin WebRing Member - http://nav.webring.yahoo.com/hub?ring=originwebring
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 01/10/2002 :  09:30:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Marvin,

I had the same problem. I used merge graphs, but this is not what you and I want.

Yes, you can save a Layout template!

1. Open a new Layout: Menubar|New..|Layout|OK
2. Add your text, create dummy graphs like TempGraph1, TempGraph2, ...
3. Position, and size your (dummy) graphs
4. Right mouse click on layout window top frame and choose "Save Template"
5. You will be asked "save as Layout.otp?". Click yes.
6. Rename the file Layout.otp to your file name, e.g. MyLayout.otp
7. In the script open your layout by: win -t Layout MyLayout MyLayoutName (this is not in the manual)
8. There will be the place holders TempGraph1, TempGraph2, etc...
9. To assign other graphs to these place holders do the following:
win -r OtherGraph1 TempGraph1; // rename;
win -r TempGraph1 OtherGraph1; // rename back;
win -a MyLayoutName; // activate layout;
doc -uw; // update window;

It's not very elegant, but it worked for me. Hope this works also for you.

best regards,
Tilman.
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 01/15/2002 :  05:01:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Scaling Worksheets/Matrices in Layouts?

Sometimes you also want to have the raw data or calculated numbers instead (or additionally) on your printout.
By this above mentioned re/back-name method you can also include matrices into layouts.

But now I have the problem that I cannot scale the worksheet/matrices in the layout. The size of the font and the columns and rows stays always the same. Columns or rows are displayed or removed just as many of them fit into the scaling frame.
Of course, I could modify the display control of the original worksheet/matrices (double click into the upper left corner) to a smaller font size. But to get the right size for the printout I have to make the original matrix so small that I can't read it on the screen anymore.
Why can't worksheets/matrices be scaled just like graphs?
Any suggestions for workarounds? Tilman.
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 10/17/2003 :  08:26:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rtoomey,

regarding your comment to mdl3051's question

2)I can't find a command that will drop a particular graph/worksheet on the layout without user intervention.

2. You are correct. No such command exists. However, a suggestion has been made to add this command in a future version of Origin.

Did anything happen in this direction in the meantime?

Now, I am again looking for the same thing. Maybe with V7 there is an elegant solution with OriginC? That you can define the graph, the size, the position, etc.
You can handle all the other object properties BMP1.x, BMP.dx, etc. in LabTalk. Is there maybe anything new in LabTalk like BMP1.link$=Graph1 ??

Please let me know, Tilman.

Go to Top of Page

kmcelroy

USA
13 Posts

Posted - 08/17/2005 :  10:17:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can treat graphs in layouts as you would text boxes in graphs, so you can resize and arrange them. I assume that this goes for anything in a layout (worksheets, etc..) but have not tried anything but graphs. This seems to be a workaround for a template-type approach. Below is a sample of my script.

-kat

[ArrangeLayout]
//Note that "Layout1", "BMP" and "BMP1" are not universal. They appear
//to be the default for a new layout with new graphs attached in my
//version of Origin.
getnumber "How many graphs?" (NumGrphs);
inch = 354.36; //# pixels per inch
pgW = 8.08*inch; //width of a portrait Layout
pgL = 10.6*inch; //length of a portrait Layout
CurRatio = Layout1!BMP.height/Layout1!BMP.width; //aspect ratio
win -a Layout1; //activate layout
if(NumGrphs == 1)
{
page -o l; //set page to landscape
Layout1!BMP.height = pgW-inch;
Layout1!BMP.width = Layout1!BMP.height/CurRatio;
Layout1!BMP.left = inch/2;
Layout1!BMP.top = inch/2;
}
else
if (NumGrphs == 2)
{
page -o p; //set page to portrait
Layout1!BMP.height = pgL/2-inch/2;
Layout1!BMP1.height = Layout1!BMP.height;
Layout1!BMP.width = Layout1!BMP.height/CurRatio;
Layout1!BMP1.width = Layout1!BMP1.height/CurRatio;
Layout1!BMP.left = (pgW-Layout1!BMP.width)/2;
Layout1!BMP1.left = Layout1!BMP.left;
Layout1!BMP.top = inch/2;
Layout1!BMP1.top = pgL-Layout1!BMP.height-inch/2;
}
else type Too many graphs!;



Edited by - kmcelroy on 08/17/2005 10:22:19 PM

Edited by - kmcelroy on 08/17/2005 10:23:16 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