05-07-2019 01:15 AM
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!
05-09-2019 03:09 AM
05-09-2019 08:50 AM - edited 05-09-2019 08:52 AM
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.