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



Column Grid

Make a rectangular column bay.

Script Contents (Lang: lua)

cmd("wizard.load wizardcolumns.wzd")
cmd("wizard.show")

-- Bring ECOTECT to the front if it is not already.
cmd("app.activate")

-- Create a new zone in the current model called 'Circular Geometry'.
add("zone", "Column Bay")



    -- Store wizard values as local variables.
    radius = tonumber(get("wizard.Page2.EditWidth.Text"))
    centerX = tonumber(get("wizard.Page1.EditCenterX.Text"))
    centerY = tonumber(get("wizard.Page1.EditCenterY.Text"))
    centerZ = tonumber(get("wizard.Page1.EditCenterZ.Text"))
    XDimen = tonumber(get("wizard.Page1.XDimension.Text"))
    YDimen = tonumber(get("wizard.Page1.YDimension.Text"))
    extrudeHeight = tonumber(get("wizard.Page2.EditHeight.Text"))
    nodeCount = 0
    inc = 18

    -- Clear the current selection set.
    cmd("select.none");

    -- Create new object.
    o = add("object floor plane", true);
    print(o)

    -- Check for a valid object index.
    if o > -1 then

       for t = 0, 360-inc, inc do
          x = centerX + (sin(t) * radius);
          y = centerY + (cos(t) * radius);
          add("node", o, nodeCount, x, y, centerZ)
          nodeCount = nodeCount + 1
       end

       -- Complete the object so ECOTECT
       -- knows to calc equation & normal.
       set("object.done");

       -- Check to extrude as a cylinder.
       if extrudeHeight > 1 then
          cmd("selection.extrude", 0.0, 0.0, extrudeHeight);
       end
   
 -- Check for a valid object index.
    p = add("object floor plane", true);
    print(p)
    if p > -1 then

       for t = 0, 360-inc, inc do
          x = XDimen + (sin(t) * radius);
          y = centerY + (cos(t) * radius);
          add("node", p, nodeCount, x, y, centerZ)
          nodeCount = nodeCount + 1
       end

       -- Complete the object so ECOTECT
       -- knows to calc equation & normal.
       set("object.done");

       -- Check to extrude as a cylinder.
       if extrudeHeight > 1 then
          cmd("selection.extrude", 0.0, 0.0, extrudeHeight);
       end

   end
    -- Check for a valid object index.
    q = add("object floor plane", true);
    print(q)
    if q > -1 then

       for t = 0, 360-inc, inc do
          x = centerX + (sin(t) * radius);
          y = YDimen + (cos(t) * radius);
          add("node", q, nodeCount, x, y, centerZ)
          nodeCount = nodeCount + 1
       end

       set("object.done");

       if extrudeHeight > 1 then
          cmd("selection.extrude", 0.0, 0.0, extrudeHeight);
       end
      end

    -- Check for a valid object index.
    r = add("object floor plane", true);
    print(r)
    if r > -1 then

       for t = 0, 360-inc, inc do
          x = XDimen + (sin(t) * radius);
          y = YDimen + (cos(t) * radius);
          add("node", r, nodeCount, x, y, centerZ)
          nodeCount = nodeCount + 1
       end


       set("object.done");


       if extrudeHeight > 1 then
          cmd("selection.extrude", 0.0, 0.0, extrudeHeight);
       end


    end
    
end

HOW WOULD YOU RATE THIS SCRIPT ?

Average: 2 (1 vote)


Navigation

User login

Translate Site To: