Grasshopper Components

Created by Mohamed Khaled Ashmawy, Modified on Mon, 31 Jul 2023 at 05:11 PM by Mohamed Khaled Ashmawy

Adaptive Parts Environment (Ape) has a grasshopper (GH) components library that helps you to define and manipulate parametric blocks, in this article we will explain additional information on all of them:

Ape Input


This component defines which Grasshopper component will become inputs of the adaptive Part. These exposed Parameters will be later modifiable through the UI Panel in Rhino.


Parameters:

  • Input can be of the following Datatypes: 
    • Box
    • Brep
    • Boolean
    • Circle
    • Color
    • Curve
    • Line
    • Mesh
    • Plane
    • Rectangle
    • Surface
    • Number Slider
    • Text
    • Value List
    • Vector
  • Name [optional]: is the title of the input parameter that should be shown in the panel. If nothing is specified the component will set an automated name. For some Input types (Boolean Toggle, Number Sliders) the name of the component will be used. 
  • Anchored [false]: If set to true, the block transformation will not be applied to this input. Setting this value makes only sense for geometric inputs.
  • Multiple [false]: If set to true, the input will allow working with a list of objects. This parameter will only have an effect on geometric inputs. Please also note that “data trees” aren’t supported yet.
  • Category [optional]: several parameters can be grouped into categories, which will be visually highlighted in the UI Panel in Rhino. Several inputs with the same "Category" value, will be grouped.



Ape Attributes


This component defines the attributes of the objects inside your final adaptive part block. They can be set per object


Parameters:

  • Name: The object's name inside the adaptive part block. (The name of the adaptive part block is defined in the ApeBake Component)
  • LayerName: The object's name inside the adaptive part block. If the layer doesn't exist, it will be created. (The block instance layer is defined during the baking process.)
  • LayerColor: The object's name inside the adaptive part block. 
  • ObjectColor: The object's color, if the color source is set to "Object". 
  • WireDensity: Wire density of the Isocurves of the object
  • ColorSource: The color source of the object.


Output:

  • Attributes: All the attributes for your final adaptive part. (Needed for ApeObject)



Ape Object


This component allows you to add Attributes to your (output) geometry.


Parameters:

  • Geometry: Any kind of geometry except blocks.
  • Attributes: Attributes you prepared


Output:

  • Objects: The output ApeObjects for your adaptive part.



Ape ColorSource


This component defines the color source you want to set in the attributes component.


Parameters:

  • You can pick between:
    • ColorFromLayer
    • ColorFromObject
    • ColorFromMaterial



Ape Calculated MetaData


This component defines key values for the final adaptive part, these values get recalculated on every change. 


Parameters:

  • Key: Key for the object's metadata.
  • Value: Value needs to be assigned to metadata.


Output:

  • MetaData: Metadata of your final adaptive part.


Tipp: By right-clicking the component in the area of the black bar, you can define the Type of Value. The following data types are currently supported:

  • Boolean
  • DateTime
  • String (default)
  • Double
  • Integer
  • Color



Ape Publisher


This component defines metadata related to publishing your adaptive block which can be visible after baking it in our User Interface. 


Parameters:

  • Version: The current version of your adaptive block.
  • Description: Description of your adaptive block.
  • Help: Helpers website or email.


Output:

  • MetaData: Publishing metadata of your final adaptive part.



Ape Author


This component defines metadata related to the author of the adaptive block which can be visible after baking in our User Interface. 


Parameters:

  • Publisher: The author's name.
  • Address: The author's address. 
  • Country: The author's country. 
  • Website: The author's website. 
  • E-Mail: The author's email address. 
  • Phone: The author's phone number. 


Output:

  • MetaData: Publishing metadata of your final adaptive part.



Ape Bake


This component bakes your final adaptive part to the current Rhino3D file.


Parameters:

  • Objects: Objects that represent your final adaptive part.
  • Name [Optional]: name of your final adaptive part, if you have already set this up, a counter will be added to the name.
  • Plane [WordlXY]: Plane of the block instance of your final adaptive part.
  • MetaData [Optional]: Optional metadata that you can add to your final adaptive part.



Ape Place


This component allows you to place an already existing Adaptive Part at several places inside the document. While doing so, you can set individual parameters for each instance you placing. Rightclick on the component and click "Select A.P.E. Block". This will extract the input parameters. 

Follow our quick tutorial for more info.


Parameters:

  • SelectAdaptiveBlock: Right-click on the component to activate adaptive block selection.
  • Plane: Block’s default plane, you can also set a new one -or multiple-.
  • Block Parameters: After selecting your Adaptive block the component will extract all the parameters for you to manipulate. What will show up, depends on the Inputs Selected Adaptive Part.


Output:

  • Output: The output geometry.
  • Definition: An AdaptiveBlock geometry output.



TIPP: If you added multiple planes to the component and baked, ApeDefinition will populate your initial block on each plane, and you can manipulate all at once from our User Interface.


Note: Extracted parameters will work within their initial range.


Note: If you’re using a value list in the block’s initial parameter, you will need to manipulate it after importing it with a number slider.



Ape Dropdown


This component creates a conditional dropdown list that controls your AdaptiveBlock in our user interface.


Parameters:

  • Options: Your desired list values.
  • Name: Name of the dropdown.
  • Category: Name of the category holding your dropdowns.


Output:

  • Output: The output value from the list.
  • Index: The output's index.



TIPP: You can use the index as an input value for "APE Dropdown Switch" to create another conditional dropdown list that switches between multiple values depending on your choices, follow this quick tutorial for more info.



Ape Dropdown Switch


This component switches between multiple sets of values to control your AdaptiveBlock in our user interface depending on your choices from "APE Dropdown".


Parameters:

  • Index: "APE Dropdown" output's index to extract an equivalent set of values.
  • Set: Set of values that get triggered once it's the right index, you can add more sets till it matches your indices.


Output:

  • Options: The desired set of values for "APE Dropdown".
  • Set Name: The set name.






TIPP: You need to use "APE Dropdown" one more time to create your new dependent conditional dropdown, follow this quick tutorial for more info.



Define Block


This component gives our users the opportunity to define any geometries in a Rhino3D file to blocks in Grasshopper.


Parameters:

  • Geometry: The geometry you want to turn into a block.
  • Attributes: Set of block attributes that you can define from "Create Attributes" component.
  • Name: The desired block name.
  • Block Origin: The desired block origin point.
  • Overwrite [True]: Boolean value, defines if the block will be overwritten after changes or not.
  • Path [Conditional]: By right-clicking the component you have the option to link your block to another Rhino3D file, by enabling this option you'll have "file path" as a new parameter to set.



Output:

  • Block: The block you just defined ready to use in Grasshopper.



Create Attributes


This component defines a set of attributes for your block.


Parameters:

  • Name: The object's name.
  • Layer Name: The object's layer name.
  • Color: The object's display color.
  • Material Name: The object's render material.
  • Linetype Name: The object's linetype.
  • Group Indices: The indices of the groups to which your object belongs.
  • Plot Weight [mm]: The object's plot weight.
  • Plot Color: The object's plot color.
  • Visibility [Boolean]: It's a boolean value, set it to True for a visible object or False to hide it.
  • UserData Keys: The keys for user data related to the object.
  • UserData Values: The values of user data related to the object.


Output:

  • Attributes: The final set of attributes for your defined block.



Deconstruct Block


This component extracts multiple parameters and attributes from any block.


Parameters:

  • Block: The block you want to extract its parameters.


Output:

  • Geometry: The base geometry of the block.
  • Attributes: Set of block attributes, you can extract it further using "Explode Attributes" component.
  • Name: The block's name.
  • Block Origin: The block's origin point.




Explode Attributes


This component extracts a set of attributes from your block.


Parameters:

  • Attributes: The block's set of attributes.


Output:

  • Name: The object's name.
  • Layer Name: The object's layer name.
  • Color: The object's display color.
  • Material Name: The object's render material.
  • Linetype Name: The object's linetype.
  • Group Indices: The indices of the groups to which your object belongs.
  • Plot Weight [mm]: The object's plot weight.
  • Plot Color: The object's plot color.
  • Visibility [Boolean]: It's a boolean value, set it to True for a visible object or False to hide it.
  • UserData Keys: The keys for user data related to the object.
  • UserData Values: The values of user data related to the object.



Insert Block


This component inserts a block from the current Rhino3D file or any other file you want.


Parameters:

  • Name: The block's name.
  • Block Origin: The block's origin point.
  • Path [Conditional]: By right-clicking the component you have the option to insert any block from another Rhino3D file, by enabling this option you'll have "file path" as a new parameter to set.


Output:

  • Block: The block you inserted.



Block List


This component provides a full list of block names in the current Rhino3D file.


Output:

  • Name: Full list of block names in the current Rhino3D file.



Spark Export .CSV


This component empowers our users to export .csv files.


Parameters:

  • Name: Name of the control to be shown in our UI.
  • Category: Name categorizing controls in our UI.
  • Path: File path to export the CSV file.
  • Header: Header row of the data.
  • Values: Desired values to be added to the CSV file.
  • Delimiter [Conditional]: The delimiter to be used in organizing values, by default it's ".".


Output:

  • Out: The output log of the component.
  • CSV: Generated CSV file to be exported.



Spark Export .TXT


This component empowers our users to export .txt files.


Parameters:

  • Name: Name of the control to be shown in our UI.
  • Category: Name categorizing controls in our UI.
  • Path: File path to export the txt file.
  • Contect: Desired values to be added to the txt file.


Output:

  • Out: The output log of the component.






Spark Bake


This component adds a bake function that gets triggered by a button in our User Interface.


Parameters:

  • Name: Name of the control to be shown in our UI.
  • Category: Name categorizing controls in our UI.
  • Geometry: Geometry to be baked.
  • Attributes: APE Attributes of the geometry.


Output:

  • Out: The output log of the component.



Angular Dimension


This component empowers our users to create angular dimensions.


Parameters:

  • Center: The center point of the angular dimension.
  • Point A: The first point to dimension.
  • Point B: The second point to dimension.
  • Offset: The distance between the angular dimension and base points.
  • Flip Angle [Boolean]: This is a boolean value that allows you to flip the measured angle if you set it to True.
  • Text Override: This is a text value that you can set if you want to override the dimensions text.
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Angular Dimension: The created angular dimension.



Linear Dimension


This component empowers our users to create linear dimensions.


Parameters:

  • Point A: The first point to dimension.
  • Point B: The second point to dimension.
  • Plane: The plane to use for dimension orientation.
  • Offset: The distance between the angular dimension and base points.
  • Text Override: This is a text value that you can set if you want to override the dimensions text.
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Linear Dimension: The created linear dimension.



Radial Dimension


This component empowers our users to create radial dimensions.


Parameters:

  • Center: The center point of the radial dimension.
  • Radius: point on the perimeter of the arc/circle to dimension.
  • Dimension Location: The location wher to place your dimension.
  • Plane: The plane to use for dimension orientation.
  • Use Diameter: Display diameter instead of radius.
  • Text Override: This is a text value that you can set if you want to override the dimensions text.
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Radial Dimension: The created radial dimension.



Ordinate Dimension


This component empowers our users to create ordinated dimensions.


Parameters:

  • Dimension Point: The point to dimension.
  • Leader: The location where to place the leader.
  • Plane: The plane to use for dimension orientation.
  • Text Override: This is a text value that you can set if you want to override the dimensions text.
  • Dimension Point Kink Offset: Offset along dimension point direction.
  • Leader Point Kink Offset: Offset along leader direction.
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Ordinate Dimension: The created dimension.



Radial Dimension


This component helps the users to bring all the dimension styles from the current Rhino3D file.


Parameters:

  •  Once you drop the component to your grasshopper canvas, it automatically reads all the dimension styles in the current Rhino3D file.

Output:

  • Dimension Styles: The imported dimension styles.





Text Dot


This component creates text dots.


Parameters:

  • Point: The point where you want to place the text dot.
  • Text Height: The height of the text inside the dot.
  • Text: The text to display inside the dot.
  • Secondary Text: Optional secondary text of the dot.

Output:

  • Ordinate Dimension: The created text dot.



Text Object


This component creates text objects to certain planes.


Parameters:

  • Text: The text content.
  • Plane: The plane to use for placing the text.
  • Max width: The maximum width of the text before it gets wrapped.
  • Text height: The height of the text.
  • Justification: The justification of the text around the plane, default is the dimension style's default value, you can change the number from 1 to 15 for different styles.
    • Left: 1
    • Center: 2
    • Right: 3
    • Bottom: 4
    • Middle: 5
    • Top: 6
    • BottomLeft: 7
    • BottomCenter: 8
    • BottomRight: 9
    • MiddleLeft: 10
    • MiddleCenter: 11
    • MiddleRight: 12
    • TopLeft: 13
    • TopCenter: 14
    • TopRight: 15
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Text Object: The created text objects.



Leader


This component creates leaders.


Parameters:

  • Points: The points define location and direction of the leader.
  • Text: The text content.
  • Plane: The plane to use for placing the text.
  • Dimension Style: The dimension style to use, you can import it from the current Rhino3D file using "Read Dimension Styles" component.

Output:

  • Leader: The created leaders.



AD Lock


This component locks using APE blocks to certain Domains, Groups, or Users.


Parameters:

  • Domain Name: Domain name of the network.
  • Group Name: Name of the group to which the user belongs.
  • User Name: The user name of the Windows account.




APE Import


This component imports previously saved APE blocks in .apt format with inputs and outputs.


Parameters:

  • Plane: The plane to orient the imported APE block.
  • Import File: Right-click on the component, you can then pick a file path to import your APE block.

Output:

  • Element: The APE block from the imported file.






Add Feature 


This component adds a feature to your profile.


Parameters:

  • Profile 3D: The existing 3D profile.
  • Feature: The feature to be added to your profile.

Output:

  • Profile 3D: The updated 3D profile.

Create Profile3D Length


This component creates a 3D profile extruded with a certain height.


Parameters:

  • Profile 2D: The existing 2D profile to extrude, this input should be defined as a "Section2D".
  • Length: The desired extrusion height.
  • Feature: The feature to be added to your profile.

Output:

  • Profile 3D: The extruded 3D profile.




Create Profile3D Length


This component creates a 3D profile from two miter planes.


Parameters:

  • Profile 2D: The existing 2D profile to extrude, this input should be defined as a "Section2D".
  • MiterStart: a plane that defines the starting level of the 3D Profile.
  • MiterEnd: a plane that defines the top level of the 3D Profile. 
  • Feature: The feature to be added to your profile

Output:

  • Profile 3D: The generated 3D profile.



Create Section2D


This component creates a 2D section from curves.


Parameters:

  • Curves: The input curves that form the 2D section.
  • Name: Name of the 2D section. 
  • Origin Plane: The plane in which the 2D section is created.

Output:

  • Section 2D: The generated 2D section.



Deconstruct Profile3D


This component deconstructs a 3D Profile to its basic elements.


Parameters:

  • Profile 3D: The 3D profile you want to deconstruct.

Output:

  • Section 2D: The original 2D section of the 3D profile.
  • Brep: Brep corresponds to the 3D profile.
  • Features: Features that were contained in the 3D profile.




Deconstruct Section2D


This component deconstructs a 2D Profile to its basic elements.


Parameters:

  • Section 2D: The 2D section you want to deconstruct.

Output:

  • Curves: The original curves of the 2D section.
  • Name: Name of the 2D section.
  • Plane: The plane in which the 2D section was created.





Edit Profile Miter


This component allows users to edit the start and end miters of a 3D profile.


Parameters:

  • Profile 3D: The existing 3D profile.
  • MiterStart: a plane that defines the starting level of the 3D Profile. 
  • MiterEnd: a plane that defines the top level of the 3D Profile. 

Output:

  • Profile3D: The updated 3D profile.



Profile Closest Plane


This component finds the closest plane on a 3D profile from a point.


Parameters:

  • Profile 3D: The existing 3D profile.
  • Point: The point to evaluate the 3D profile and get the closest plane. 

Output:

  • Plane: The closest plane on the 3D profile.




Remove Feature


This component allows users to remove features from a 3D profile.


Parameters:

  • Profile 3D: The existing 3D profile.
  • Index: The index of the feature to be removed.

Output:

  • Profile 3D: The updated 3D profile.



Replace Feature


This component allows users to replace a feature in a 3D profile. 


Parameters:

  • Profile 3D: The existing 3D profile.
  • Index: The index of the feature to be replaced.
  • Feature: The new feature to be added.

Output:

  • Profile 3D: The updated 3D profile.



Ape Countersunk Hole


This component creates a countersunk hole in a 3D profile. 


Parameters:

  • Plane: The plane which contains the hole.
  • Start Radius: The desired starting radius of the hole.
  • End Radius: The desired final radius of the hole.
  • Sink Angle: The angle of the sink.
  • Depth: The desired depth of the hole.
  • throughAll [boolean]: a boolean value to determine if you want the hole to go all the way through the 3D profile or not.

Output:

  • Countersunk Hole: The countersunk hole feature, ready to attach to a 3D profile.

Ape Stepped Hole


This component creates a stepped hole in a 3D profile. 


Parameters:

  • Plane: The plane which contains the hole.
  • Start Radius: The desired starting radius of the hole.
  • End Radius: The desired final radius of the hole.
  • Step Depth: The depth of the step.
  • Depth: The desired depth of the hole.
  • throughAll [boolean]: a boolean value to determine if you want the hole to go all the way through the 3D profile or not.

Output:

  • Stepped Hole: The stepped hole feature, ready to attach to a 3D profile.

Ape Regular Hole


This component creates a regular hole in a 3D profile. 


Parameters:

  • Plane: The plane which contains the hole.
  • Radius: The desired radius of the hole.
  • Depth: The desired depth of the hole.
  • throughAll [boolean]: a boolean value to determine if you want the hole to go all the way through the 3D profile or not.

Output:

  • Regular Hole: The regular hole feature, ready to attach to a 3D profile.

Ape Void


This component creates a cutout in a 3D profile. 


Parameters:

  • Volume: The object needs to be subtracted from the 3D profile.

Output:

  • Feature: The resulting void feature, ready to attach to a 3D profile.












Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article