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
 Origin Forum
 2022b SR1: copy/paste mask
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

Posted - 07/14/2022 :  09:37:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1 9.9.5.167
Windows 7 Pro SP1 x64

Greetings!

I need to transfer masks from multiple columns to another worksheet.

Is there a neat way of doing this?

Thank you.

---
Andrey

snowli

USA
1379 Posts

Posted - 07/14/2022 :  10:09:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

Do you mean copy mask locations only, not data.
We don't support it.

One workaround is first copy paste data with mask to the new sheet. mask will be copied as well.
Then copy the expected data (without mask) there. The mask will be kept.

Thanks, Snow



Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/14/2022 :  12:35:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

Hi Andrey,

Do you mean copy mask locations only, not data.
We don't support it.

One workaround is first copy paste data with mask to the new sheet. mask will be copied as well.
Then copy the expected data (without mask) there. The mask will be kept.

Thanks, Snow



Got it.
Thanks.

Can I transfer masks using LT?

---
Andrey
Go to Top of Page

snowli

USA
1379 Posts

Posted - 07/14/2022 :  2:21:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't fully understand how u want to transfer mask. Maybe u can send a sample opju.

To mask with Labtalk, u can refer to mark command. https://www.originlab.com/doc/LabTalk/ref/Mark-cmd#-s1.2C_-s2.2C_..._-s9.3BSet_mask_with_masking_value

Thanks, Snow
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/14/2022 :  3:35:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

I don't fully understand how u want to transfer mask. Maybe u can send a sample opju.

To mask with Labtalk, u can refer to mark command. https://www.originlab.com/doc/LabTalk/ref/Mark-cmd#-s1.2C_-s2.2C_..._-s9.3BSet_mask_with_masking_value

Thanks, Snow



Dear Snow,

What I need is very simple. I have a sheet with masked cells. I want to mask the same locations on the other sheet.

Mark
command is the right command.
However: how can I get a range of the masked cells and store it to a range variable (to pass it to mark command on the next step)?


---
Andrey
Go to Top of Page

snowli

USA
1379 Posts

Posted - 07/14/2022 :  4:02:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I need to check with our developer if we can add it.ORG-25496

For now, i tried this works
colcopy irng:=[Book1]Sheet1!1:5 orng:=[Book2]Sheet1!1:5 mask:=1; //it will copy data from book1 to book2 including mask status
undo; //it undo the copy but mask is left

Thanks, Snow
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/15/2022 :  01:32:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

I need to check with our developer if we can add it.ORG-25496

For now, i tried this works
colcopy irng:=[Book1]Sheet1!1:5 orng:=[Book2]Sheet1!1:5 mask:=1; //it will copy data from book1 to book2 including mask status
undo; //it undo the copy but mask is left

Thanks, Snow



Dear Snow,

Great trick!
This works perfectly for static data.

However if the target cells/columns contain formulas or operations/XFs the trick probably won't work.

---
Andrey
Go to Top of Page

minimax

348 Posts

Posted - 04/09/2024 :  03:41:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

In Origin 2024b Beta2 build, we added a "Copy Mask Status" menu and LT mark command like
//syntax: mark -ss/sl [file] [range];
range r1=[book1]1!, r2=[book2]1!;
mark -ss "C:\test\abc.dat" r1;	//save
mark -sl "C:\test\abc.dat" r2;	//load


Would you mind to take a try when have time?
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/09/2024 :  10:20:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

Hi Andrey,

In Origin 2024b Beta2 build, we added a "Copy Mask Status" menu and LT mark command like
//syntax: mark -ss/sl [file] [range];
range r1=[book1]1!, r2=[book2]1!;
mark -ss "C:\test\abc.dat" r1;	//save
mark -sl "C:\test\abc.dat" r2;	//load


Would you mind to take a try when have time?



Great news!

I will test during this week.

---
Andrey
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/11/2024 :  09:18:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

Hi Andrey,

In Origin 2024b Beta2 build, we added a "Copy Mask Status" menu and LT mark command like
//syntax: mark -ss/sl [file] [range];
range r1=[book1]1!, r2=[book2]1!;
mark -ss "C:\test\abc.dat" r1;	//save
mark -sl "C:\test\abc.dat" r2;	//load


Would you mind to take a try when have time?



GUI's "Copy Mask Status" menu works like a charm!

As for LT command: can you explain the syntax of -ss and -sl switches, please?
As I see ss stores the range's masks to a text file, while sl loads the masks from the text file and applies it to the specified range.
Right?
Is this possible to do via Windows clipboard, that is without an intermediate text file?

https://www.originlab.com/doc/LabTalk/ref/Mark-cmd

---
Andrey

Edited by - AKazak on 04/11/2024 09:19:16 AM
Go to Top of Page

minimax

348 Posts

Posted - 04/12/2024 :  01:29:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

Your understanding on -ss and -sl switches is correct.

If you do not care about file, you may simply run script like
win -a Book1;
mark -ss; //a file in OS temp folder will be created
win -a Book2;
mark -sl; //use above file directly


Both the file and range arguments are optional and you can omit it.

But if you even do not want to keep a temp file, you can try using menu -e command, like

range r1=[Book1]1!, r2=[Book2]1!;
layer -o r1 { work -s 0 0 0 0; menu -e 39434; } // 39434 is menu id for Copy Mask Status
layer -o r2 { work -s 0 0 0 0; menu -e 57637; } // 57637 is menu id for Paste


see
https://www.originlab.com/doc/LabTalk/ref/Menu-cmd#-e.3B_Execute_the_menu_command_with_the_specified_ID

But menu -e is kind of dpepending on OS active window's execution, we suggest "mark -ss;" should be better.




Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/12/2024 :  04:49:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Got it.
Well done!

Off-topic: do we have a complete list of command abbreviations, like "work" stands to "worksheet"?

---
Andrey
Go to Top of Page

minimax

348 Posts

Posted - 04/12/2024 :  05:11:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Off-topic: do we have a complete list of command abbreviations, like "work" stands to "worksheet"?



All Labtalk command can use abbreviation in general.

I do not search all doc page yet, following page mentions it.

https://www.originlab.com/doc/en/LabTalk/guide/Getting-Started-with-LT

Commands can be abbreviated as long as it's unique. Both the following work.
Go to Top of Page

snowli

USA
1379 Posts

Posted - 05/16/2024 :  5:08:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

We added Copy Mask Status context menu in Origin 2024b.
Highlight column(s), right click and choose Copy > Copy Mask Status.
Then go to your destination worksheet select the starting column header to paste.

This is also supported in Copy Columns to xfunction. U can uncheck Copy Data and check Copy Mask to only copy mask positions.

Thanks, Snow
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