Idea

James Rodgers1 avatar image
4 Likes"
James Rodgers1 suggested James Rodgers1 edited

Option to physically separate copies where "Delete and Copy" is used in a parameter table

Currently when the "delete and copy" option is used for objects whose quantity is in a parameters table, the copies are on top of each other in the 3D space. I would suggest that there be an option to space them out using X, Y and maybe Z offsets based on the position of the original. The total offset is the copy number times the entered offset value. I modified the code as if there were X, Y and Z offsets available in the edit window. There is likely a more elegant way of doing this maybe with Vec3 :

  1. treenode reference = param(1);
  2. Variant newValue = param(2);
  3. Variant oldValue = param(3);
  4. Variant X_offset = param(4);
  5. Variant Y_offset = param(5);
  6. Variant Z_offset = param(6);
  7. int isReset = param(7);
  8.  
  9. { // ************* PickOption Start ************* //
  10. /***popup:ParamSetNodeValue*/
  11. /**Delete and Copy Out Objects*/
  12. if (/***tag:condition*//**/isReset/**/) {
  13. Array objects = reference.as(Object).outObjects.toArray();
  14.  
  15. if (objects.length == 0) {
  16. mpt("Error setting parameter " + c.up.up.name + " - Not enough objects in object set"); mpr();
  17. } else {
  18. for (int i = 2; i <= objects.length; i++) {
  19. objects[i].destroy();
  20. }
  21.  
  22. treenode firstObj = objects[1];
  23. double firstX = firstObj.as(Object).location.x;
  24. double firstY = firstObj.as(Object).location.y;
  25. double firstZ = firstObj.as(Object).location.z;
  26. int total = Math.max(1, newValue);
  27. for (int i = 2; i <= total; i++) {
  28. treenode newObj = createcopy(firstObj, firstObj.up);
  29. newObj.name = firstObj.name + "_" + i;
  30. applicationcommand("recreateObjectConnections", newObj, firstObj);
  31. newObj.as(Object).location.x = firstX + X_offset*(i-1);
  32. newObj.as(Object).location.y = firstY + Y_offset*(i-1);
  33. newObj.as(Object).location.z = firstZ + Z_offset*(i-1);
  34. }
  35. }
  36. }
  37.  
  38. } // ******* PickOption End ******* //


copies
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

No Comments

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas