Smart Custom Trees

Daniel
Updated on

To create your own custom Trees, please do the following:

IMPORTANT > You must only use the Fill and 2D line tools (i.e. not the spline, arc or circle tools) for the below to work properly.

A. Plan View

  1. On a new worksheet create the plan view of your custom Tree, using the fill tool – the Fill can include holes. Next select the 2D Line Tool, ensure its Geometry Method is set to Single and trace the outline of your custom shape with the Magic Wand (Spacebar and click);
    For best results create a shape that has square proportions.
    Align the centre of all your drawn elements with the Archicad Origin (0,0).
  2. Select all newly drawn elements and save the as an Object…
    File > Libraries and Objects > Save Selection as > Object…
    …and name the new Object file in a descriptive way, e.g. ‘Blocky Tree – Plan’.
  3. Confirm the Object’s Basic Settings and save into the Embedded Library;
  4. Load the provided ‘Custom Tree Template’ Object into the Embedded Library of your current Archicad File;
    File > Libraries and Objects > Open Object … choose Browse for File (from the Open Library part dropdown)
  5. Next duplicate this object via…
    File > Save as
    ….into the embedded Library with a distinctive name, e.g. ‘Blocky Tree’;

    NOTE > It is important to save every new object as a new Library Part because Archicad will assign each object with unique ID (GUID). GUID is used for library part identification. If there are 2 objects with matching GUID but different name, Archicad will consider both objects the same and will alternate using both randomly.

    TIP > It is sufficient to save an object as New Library Part only once, as a new GUID is allocated upon creation. Any further changes must be saved with Create New Library Part unchecked.
  6. Open your previously saved object from step 2, i.e. ‘Blocky Tree – Plan’
    File > Libraries and Objects > Open Object…
  7. Inside the 2D script window of the ‘Blocky Tree’ object, locate, select and copy (⌘+C) the scale value for Dimension A
    (At the beginning of the script, associated with mul2 command)
  8. Now switch to the ‘Blocky Tree’ object and go to the Master Script window.
    Replace the parameter dim_A2D_custom value with your copied parameter for Dimension A from step 7;

    NOTE> The scale value manages the future plan shape graphical scaling factor.
  9. Switch back to the ‘Blocky Tree – Plan’ object’s 2D script window.
    Locate, select and copy all fill polygon node coordinates;

    NOTE: 2D fill is associated with the poly2_b{ } command
  10. In the ‘Blocky Tree’ object’s Master script window, replace parameters after !#insert nodes coordinates# prompt under “tree_plan” section inside with the copied values from ‘Blocky Tree – Plan’;
  11. Inside the 2D script window of the ‘Blocky Tree – Plan’ object, locate, select and copy the 2D vector commands with nodes coordinates;

    NOTE: 2D vector elements should consist only of line2 commands!
  12. Back in the ‘Blocky Tree’ object’s master script window, replace the parameters after the !#insert line nodes for tree plan shape# prompt under “tree_plan” section with the values from your ‘Blocky Tree – Plan’ object;
  13. This completes the plan shape script of your new custom Smart Tree, now save your ‘Blocky Tree’ object, via…
    File > Save

B. Elevation

  1. Create an elevational tree shape on a new Worksheet using a combination of 2D lines (do not use splines, arcs or circles as they need to be converted) and one fill (without outline). As above the Fill can include holes.

    On a new worksheet create the Elevation of your custom Tree, using the fill tool – create one Fill only, the Fill may include holes. Next select the 2D Line Tool, ensure its Geometry Method is set to Single and trace the outline of your fill with the Magic Wand (Spacebar and click);

    IMPORTANT > The centre of the base of the tree must be located at the Archicad origin (0,0).
    NOTE > To allow for all features and best graphics, your custom tree shape should be symmetrical around a centreline;
  2. Select all newly drawn elements (Fill and all Lines) and save them as an Object…
    File > Libraries and Objects > Save Selection as > Object…
    …and name the new Object file in a descriptive way, e.g. ‘Blocky Tree – Elevation’.
  3. Confirm the Object’s Basic Settings and save into the Embedded Library;
  4. Open the previously saved ‘Blocky Tree – Elevation’ object…
    File > Libraries and Objects > Open Object…
  5. Inside the 2D script window of the ‘Blocky Tree – Elevation’ object, locate, select and copy (⌘+C) the scale values for Dimension A (Tree shape width) and Dimension B (Tree shape height)
    (At the beginning of the script, associated with mul2 command)
  6. Now switch to the ‘Blocky Tree’ object and go to the Master Script window.
    Replace the parameter dim_A_custom value (tree shape width) and dim_Z_custom value (tree shape height) with your copied parameters from the previous step above;

    NOTE> The scale value manages the future plan shape graphical scaling factor.
  7. Switch back to the ‘Blocky Tree – Elevation’ object’s 2D script window.
    Locate, select and copy all fill polygon node coordinates;

    NOTE > 2D fill is associated with the poly2_b{ } command
  8. In the ‘Blocky Tree’ object’s Master script window, replace parameters after !#insert nodes coordinates# prompt under “tree_elevation” section with the copied values from the ‘Blocky Tree – Elevation’ object;
  9. Inside the 2D script window of the ‘Blocky Tree – Elevation’ object, locate, select and copy the line2 commands with nodes coordinates;

    NOTE > If the Tree Elevation was created as per the tutorial above only line2 commands will be present – if not please start over with your elevation.
  10. Convert each row of line2 parameters from code syntax:

    line2 x1, y1, x2, y2
    …into code syntax:
    X1, y1, x2, y2,

    NOTE > This task is best done in a spreadsheet editor, e.g. Microsoft EXCEL or the Apple Numbers app

    TIP > Use Edit GDL Library Parts Toolbar to Find line2 string and replace it with empty space. Then copy only numbers from each row into spreadsheet editor

    IMPORTANT > The last row does not end with a comma (,) but with a number!
  11. In the ‘Blocky Tree’ object’s Master script window, replace parameters after !#insert elevation shape nodes coordinates# prompt under “tree_elevation” section with the edited values from the ‘Blocky Tree – Elevation’ object;
  12. This completes the plan shape script of your new custom Smart Tree, now save your ‘Blocky Tree’ object, via…
    File > Save
    …to avoid loosing all your hard work.

To use your custom Tree, please do the following

  1. Link the Folder where your Custom Tree object is located into your project…
    Library File > Libraries and Objects > Library Manager > Add
  2. Select the.Smart Tree object, then open the custom settings under 2D Representation…
    2D View > Plan View > Symbol Style > select Custom and type the Name of the custom object into the text field, e.g. Blocky Tree
  3. Do the same for…
  4. 2D View > Elevational View > Symbol Style > select Custom and type the Name of the custom object into the text field, e.g. Blocky Tree

Happy foresting.

© 2021 macinteract pty. ltd. abn 44 155 154 653. terms and legal.