Print at Jul 9, 2020, 7:29:07 PM

Posted by dorin at Apr 29, 2019, 9:52:56 AM
Re: Multiple paste & Distribute on high (on z axes)
Message in a Bottle -The Police - 1979
As I say "If You don't like it AS IS than DIY".
I've start to write an plug-in for this but I encounter a problem:
Look at the screenshot:

The items are added in 3D and in Furniture list but only the last are draw in 2D.
If I save the file and reopen the items are there but is not what I want or expect.
Here is the code responsible for this:

UndoableEditSupport undoSupport = plugin.getUndoableEditSupport();
// HomeView view = plugin.getHomeController().getView();
float dx = 0;
float dy = 0;
int step = (int) stepsField.getValue();
float Xo = (float) xField.getValue();
float Yo = (float) yField.getValue();
for (int p = 1; p <= step; p++) {
dx += Xo;
dy += Yo;
// Attempt add/move items
plugin.getHomeController().getPlanController().moveItems(items, dx, dy);
// Attempt to use drop or paste
// plugin.getHomeController().drop(items, null, dx, dy);
// plugin.getHomeController().paste(items);
undoSupport.postEdit(new AbstractUndoableEdit() {

I mess something but I don't know what.
I've catch my ears and maybe someone read this and drop me an lifeline sad
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law