
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
firstly thanks for looking this one over.
I have had a little experience with scripting and programming in the past but generally just learn what I need for the task at hand, then forget it all a week later 😞
What I am attempting to achieve is to get the width, height and length of a group, then duplicate that group multiple times in all axis and position each group next to, along, and on top of the previous duplication.
I'm pretty sure that I am close with this (It works for a none grouped object) but I keep getting an error (-- Runtime error: Not a keyword argument: #pos) at the "pos: [poz_x, pos_y, pos_z]" section of my script (Right at the bottom).
Can anyone help me with this please?
global FindGroupHead
fn FindGroupHead obj =
(
if ((isGroupHead obj)AND(not (isGroupMember obj))) then
(
return obj
)
else
(
if (isGroupMember obj) then
(
FindGroupHead (obj.parent)
)
else
(
return undefined)
)
)
on PickFillMesh picked sel do
(
local SelectedGroupHead = (FindGroupHead sel)
---------- Get Selected Mesh Dimensions
FillMeshWidth = (SelectedGroupHead.max - SelectedGroupHead.min).x
FillMeshLength = (SelectedGroupHead.max - SelectedGroupHead.min).y
FillMeshHeight = (SelectedGroupHead.max - SelectedGroupHead.min).z
---------- Clone Selected Mesh and Position
for HeightAmount = 1 to StackHeight.value do
(
for LenghtAmount = 1 to StackLength.value do
(
for WidthAmount = 1 to StackWidth.value do
(
pos_z = ((HeightAmount-1) * FillMeshHeight)
pos_y = ((LenghtAmount-1) * FillMeshLength)
pos_x = ((WidthAmount-1) * FillMeshWidth)
maxOps.cloneNodes SelectedGroupHead cloneType:#instance --error here>>>-- pos:[pos_x, pos_y, pos_z]
)
)
)
)
Solved! Go to Solution.