Scripting OperationMove to work on individual layers #509
Replies: 6 comments 8 replies
-
I also tried using Tools -> Move where I did it copy and paste of all layers with margin left = 400 which did what was expected. I then repeated this exact same command and the result was the same copy overlapping copy view that I have seen above on each layer. |
Beta Was this translation helpful? Give feedback.
-
The Move tool require something to be selected to move. If you don't give the rectangle region you want to move/copy it will auto set to file The first time you run the tool the BoundingRectangle it's equal to your single tile. But the second time you do new OperationMove the ROI will be the sum of two tiles, and then you are moving / copying a blank area that overlaps in the layer.
To solve this you need to strict select the area you just want to copy OR if the copy area it's always the same, dont do a var operation = new OperationMove(SlicerFile)
{
IsCutMove = false,
MarginLeft = 400,
};
for(int layerIndex = startLayer; layerIndex < endLayer; layerIndex ++)
{
operation.SelectCurrentLayer(layerIndex);
operation.Execute(Progress);
} |
Beta Was this translation helpful? Give feedback.
-
@sn4k3 : The pattern option is greyed out in the Tools menu for me - not sure why. Is it possible to obtain the build plate width and height in pixels from within a script? |
Beta Was this translation helpful? Give feedback.
-
Thank you - is it possible to print debug strings from scripts (pop-up box or something displayed within the window) ? |
Beta Was this translation helpful? Give feedback.
-
Ok thanks - I've been writing to the script window so far but yeah, writing to a file would also work. |
Beta Was this translation helpful? Give feedback.
-
@sn4k3 : I've got the image (build plate) resolution is pixels now, how do I find the max pixel x/y for the actual part (green boundary box) ? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to write a script that copies and pastes a subset of layers which are not sequential. I was thinking I could use a for loop to run OperationMove by layer but I'm getting weird results. To simplify things I removed the for loop and tried the below code which should in my mind copy and move layers 20 and then 22. However, the first one works fine but the second results in a copy of a copy type view. What am I doing wrong?
Thanks
Nick
Layer 20 Original
Layer 20 after OperationMove
Layer 22 before
Layer 22 after OperationMove
Beta Was this translation helpful? Give feedback.
All reactions