Archive site for Autodesk Ecotect Analysis educational resources, notes and tutorials



Solar Component Array

This Wizard will allow for the array of a component object onto any faceted surface... Simultaneously linking the orientation of the component to the angle of solar incidence.

Script Contents (Lang: lua)

cmd("wizard.load COMPONENT_ARRAY.wzd")

cmd("wizard.show")

    -- Store wizard values as local variables.
       OG = tonumber(get("wizard.Page1.Origin.Text"))
       E = tonumber(get("wizard.Page1.End.Text"))
       S = tonumber(get("wizard.Page1.Spacing.Text"))
       Voff = tonumber(get("wizard.Page1.Offset.Text"))

    -- Component Array Script

objects = {}

cmd("app.activate")
cmd("app.center")

NUM = get("selection.count")
set("object.center", NUM, 0, 0, 0)
cmd("object.normal", NUM, 0)
cmd("view.redraw")
pause(1000)

for w = 0,NUM-1,1 do
  objects[w] = {}
  objects[w]['x'], objects[w]['y'], objects[w]['z'] = get("object.center", w)
end

startIndex = get("model.objects")

for q = OG,((NUM-1)-E)/(S+1),1 do
  
  cmd("object.duplicate", NUM, q+100, 0, 0)
  set("object.center", (NUM+1+(q-OG)), objects[(q+(q*S))]['x'], objects[(q+(q*S))]['y'], (objects[(q+(q*S))]['z']+Voff))

end



cmd("object.delete", NUM)

cmd("view.redraw")
cmd("select.zone", 1)

ArrNUM = get("selection.count")
result = get("model.objects")

AttachmentSize
COMPONENT_ARRAY.scr1.05 KB
COMPONENT_ARRAY.wzd137.14 KB

HOW WOULD YOU RATE THIS SCRIPT ?

No votes yet


Navigation

User login

Translate Site To: