Message 1 of 3

Not applicable
11-18-2020
11:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
So close to finishing my script now but I have this odd issues happening, I can array a single mesh on selection (x,y,z values determined by spinners) and I can now array a group on selection thanks to @miauuuu but for some reason if I drop my single selection array as the else of an if statement, it fails to know what I am selecting... can anyone help me out here?
It's the 'Else' that always fails here... example message "No "Select" function for false"
on PickFillMesh picked sel do
(
---------- Set Group Selection
local SelectedGroupHead = (FindGroupHead sel)
if sel = isGroupMember sel then
(
---------- Get Selected Group Dimensions
SelectedGroupHead.pivot = SelectedGroupHead.center
SelectedGroupHead.pivot.z = SelectedGroupHead.min.z
FillGroupWidth = (SelectedGroupHead.max - SelectedGroupHead.min).x
FillGroupLength = (SelectedGroupHead.max - SelectedGroupHead.min).y
FillGroupHeight = (SelectedGroupHead.max - SelectedGroupHead.min).z
if MoveToPallet.state == true then
(
SelectedGroupHead.pos = [0-PalletWidth/2-(0-FillGroupWidth/2),0-PalletLength/2-(0-FillGroupLength/2),149]
)
---------- Clone Selected Group 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) * FillGroupHeight)
pos_y = ((LenghtAmount-1) * FillGroupLength)
pos_x = ((WidthAmount-1) * FillGroupWidth)
maxOps.cloneNodes SelectedGroupHead cloneType:#instance offset:[pos_x, pos_y, pos_z]
)
)
)
--delete original group
delete SelectedGroupHead
)
else
(
---------- Set Selection
Select sel
---------- Get Selected Mesh Dimensions
FillMeshWidth = (sel.max - sel.min).x
FillMeshLength = (sel.max - sel.min).y
FillMeshHeight = (sel.max - sel.min).z
---------- Clone Selected Mesh
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)
FillMesh = copy sel pos:[pos_x, pos_y, pos_z]
)
)
)
)
)
Solved! Go to Solution.