DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to work with flags in scripts

I have two problems when used view set flags command in script.

First is how to change the display type of the flags? In my computer, the flag points are too small.

 

Second is how to achieve the "Copy data points" function in script?

In the view window, I need to show the target point on the curve, and engineer will see the target point is right or not, if the target point is wrong, then engineer will change the target point manually, and copy the set flags in a new channel.

Now I use the code below:

'-------------------------------------------------------

Dim MyChn,i,j

j = 1

Set MyChn = data.root.channelgroups(1),Channels.Add("MyChn",DataTypeChnFloat64)

For i = 1 to data.getchannel("[x]/[x]") .size

if ( data.getchannel("[x]/[x]").OperationalFlags(i) = True) then

    MyChn(j) = data.getchannel("[x]/[x]").value(i)

    j = j+1

end if

next

'--------------------------------------------------------------

But the efficiency of executing the above code is too low, it need to check all the data of a channel.

Do we have some better method to achieve this function?

Thanks!

    

0 Kudos
Message 1 of 3
(2,136 Views)

See the following link for a complete example to do what you want.  

 

http://www.savvydiademsolutions.com/view.php?topic=script-to-copy-paste-curve-section-in-view

 

The script will identify a section of a curve to be copied, show this to the user in the View panel, plot a point where the curve should be copied to, and then ask the user to confirm the copy / paste operation.  

0 Kudos
Message 3 of 3
(2,102 Views)