designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Attractor point in DesignScript

November 19, 2012 | Discourses
#attractor #designscript

This is my first try at DesignScript syntax. It is quite easy to understand and on-screen reference help seems to work well. It creates regular AutoCAD entities when you run. One of the most important concepts of this language is said to be a kind of associativity that updates objects when any parameter is changed while the script is running. However such associativity is not possible after the script has finished running. If you want to use the regular imperative style, you should use directive [imperative] in the script to tell it that variables are not actively associative. Unfortunately, I couldn’t find a suitable use of this associativity as DesignScript seems to want itself to be run endlessly. I’m a little disappointed about it because as far as I remember, even Generative Components had the ability to interact with the user via object translations. Maybe I’m doing something wrong here.

import("ProtoGeometry.dll");
import("Math.dll");

// Create a square grid of points 
point_x = 0..100..#10; 
point_y = 0..100..#10;
points = Point.ByCoordinates(point_x<1>, point_y<2>, 0);

// Define a random attractor curve
attract = Point.ByCoordinates(Math.Rand(0,100),50, 0);

// Create circles on the grid that reacts the attractor
circles = Circle.ByCenterPointRadius(points, points.DistanceTo(attract) / 15);
Attractor point in DesignScript attractor, designscript
DesignScript file (DS)Download

Cite this post

Yazar, T. (2012, November 19). Attractor point in DesignScript. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/attractor-point-in-designscript/

Related Posts

Custom Graphics on VPL

January 10, 2012

This was an interesting challenge for me to find out if an architect can use Visual Programming Languages (VPL’s) also for graphical purposes? Now, I would say “not exactly” because this definition took much time than I expected. The aim was to create an algorithm for a business card design that has variable outputs. Each card should be different, but without using any randomization. This project is suitable for more development because now it is only producing one sequence of…

Basic Grid Deformation

July 5, 2023

I am still trying to find the simplest solution to some geometric definitions. This is why I called this Grasshopper definition “Basic Grid Deformation”. Here you see the Curve Proximity (CrvProx) component in use. This component calculated the shortest distance between two curves. I think the underpinnings of this component are very interesting. I hope I can code it in Python one day. In order to see the result more clearly, the Previews of the Interpolate Curve (IntCrv) and Square…

Attractor Basics

June 29, 2023

In this short tutorial, I want to give Grasshopper beginners the basics of how we create attractor systems. The Grasshopper definition you see in the below figure is the equivalent of array-type copying operations in CAD. However, unlike in CAD programs, here we are dealing with multiple generations of objects rather than transformations. Attractor Basics: Data Matching In the application you see in the figure below, each row of the hexagonal grid created with HexGrid has a different radius value….

Point Waves

May 29, 2023

Here is another basic exercise in Grasshopper. This exercise “Point Waves” creates wave-like deformations on the grids of points. The major function of the definition is to calculate the distances from every point of a grid to an attractor point, with the help of Distance (Dist). Then it sorts them from the smallest to the largest (= closest to farthest) with the Sort List (Sort) component. This component takes and matches two lists of the same size, called key (K)…

ARCH362 Basics

March 17, 2015

Another tutorial we’ve analysed together with ARCH362 students last week was the one that mimics Zaha Hadid’s Kartal Masterplan. Although the project of Zaha Hadid was pretty much controversial among Turkey’s architectural critics (and most people also), we’re not dealing with how successful or “ugly” it is, but the most simple version of the technique that generated such forms. We have a term “çakma” in Turkish that means “conscious imitation, possibly full of errors”. But however, this “çakma Kartal Project” example has…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #grasshopper
    • #deformation
    • #grid
    • #pattern
    • #parametric-surface
    • #graph-mapper
    • #wave
    • #design-education
    • #animation
    • #tessellation
    • #circle
    • #responsive
    • #voronoi
    • #facade
    • #vector-field
    • #sphere
    • #data-flow
    • #hexagon
    • #islamic-pattern
    • #structure
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement