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 December 3, 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…

Lorenz Attractor with Grasshopper Python

November 26, 2026

In 1963, meteorologist and mathematician Edward Lorenz modelled the thermally driven motion of atmospheric air currents. He used the set of chaotic solutions to a system of nonlinear differential equations, called the Lorenz attractor. Known for its butterfly-wing geometry when plotted in three-dimensional space, it is one of the most famous examples of deterministic chaos. I finally managed to spend 3 hours from my life for this model, which had been sitting on my to-do list for a long time….

Field Deformation

October 8, 2026

Ever since I restructured designcoding, I’m still sorting through the trash folder. All 580 posts published on the blog have been reviewed, and their files have been uploaded as open source. The mysterious trash folder, where I couldn’t even tell where things belonged, is shrinking fast. While checking this folder yesterday, I found a video. This is probably a simple tutorial I prepared about 10 years ago for the parametric modeling elective course (probably related to this 2012 post). The…

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….

  • Chapters

    • Algorithms
    • Discourses
    • Escapes
    • Fabrications
    • Studios
  • Explore

    • Table of Contents
    • Monthly Archive

    • All Keywords
    • #grasshopper
    • #deformation
    • #pattern
    • #grid
    • #parametric-surface
    • #vector-field
    • #graph-mapper
    • #wave
    • #design-education
    • #animation
    • #tessellation
    • #chaos
    • #fractal
    • #rhino-python
    • #tutorial
    • #circle
    • #responsive
    • #voronoi
    • #facade
    • #sphere
  • 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