Introduction
Design Scripting is a "Visual Basic Scripting" library suited for design purposes, namely CAD systems and 3D geometry. It contains a variety of vertex/vector functions but extends to more generic functionality such as file reading/writing etc. DSLib is a prototyping package for rapidly hacking and testing ideas before potentially hard coding design processes in more advanced languages. You can hack up from simple straight forward automation scripts to abstract generative processes without getting into the compile/debug world of computing or the painful world of pure macro command sequencing.
History
I begun writing DSLib while I was studying in MIT back in 2003. It was developed for general purpose scripting with a special focus on geometry. I have been using dslib mainly from within the Rhinoceros CAD environment, yet I tried to keep it free from a specific hosting application. Notice: as of version 2.0 some functionality that is Rhino specific has been added yet without creating dependencies.
Philosophy
Scripting is an easy access point to computation that avoids the over-generalization syndrome of its underlying science but yet provides the facilities for expressive design experimentations. The Design Scripting Library was build in this gradual ad-hoc-ish mode in a necessity basis a.k.a. patchwork. It follows a multi paradigm approach borrowing concepts and functionality from both low level computer languages (see the c-flavored polymorphic sort for instance) and high level languages (see php-like echo function for another).
Participation
I can no longer maintain DSLib by myself. If you are interested in writing new methods, correcting bugs, bettering the documentation send me a note. Contributions will be properly acknowledged.
Structure
The library comes in two components: a pure set of scripting functions and an extension dynamic link library that overcomes the limitations of the programming language. The library is structured in contextual blocks (pseudo-namespaces) and I tried to enforce an object-oriented feel into the procedural nature of Basic. Most of the code is self-explanatory.
Scripting is by nature slower than proper programming, therefore I decided to keep the code thin without any error checks etc. Performance sacrifices were made but only in terms of modularization and encapsulation.
Loading and Using
DSLib is doing nothing by itself (this is a common question). You need to write some code that uses it. In version 1.0 all you need to do in order to start working with the library is to load it before your code. This can be done in a number of ways:
- Load it through your CAD GUI into the scripting engine
- Load it in your application via a Scripting Control Control
- Load it internally from your script by reading the file in a string and globalexecute it
As of version 2.0 the single file monolith was broken down into multiple files. This makes maintenance much easier. The process of loading the library is a bit different! You need to either:
- Load all files using one of the previous methods
- Load only the dslib.vb file and call the load function that takes care of all other files.