DesignScript and Colour

Hey guys,

Just curious, but I was re-creating one of Dimitar Venkov’s (epic) replies to someone in Design Script and found that a lot of what he did isn’t intuitive to a new user as you have to fully complete the appended interaction before it highlights in colour.

ie. ‘Rectangle’ comes up in Green. Awesome

‘Rectangle.’ brings up a few options. Awesome

‘Rectangle.ByWidthHeight(X,Y);’ is a ‘finished’ thing in and of itself. Cool.

‘Rectangle.ByWidthHeight(X,Y).’ does not bring up anything. Don’t really have a problem with this as the base action is complete but it would be nice to append other ‘options’ to the ‘.’ functionality.

The issue lies where you can append actions to things, but they only highlight in colour once fully completed. Is there any way that they could be added in either as colour or a drop-down such as the ‘.ByWidthHeight’ earlier?

As it stands, ‘Rectangle.ByWidthHeight(X,Y).Translate’ will only turn blue when the e of Translate is entered.

Would just be easier for people to pick up I think if it helped self-create.

Unless I’m missing something?

Eep, couldn’t edit my post. Image attached:

DesignScript Dynamo Query

Any thoughts Dynamo Team :smiley: ?

Should I add this as a wish list request to Github?

Hi Sol,

Yes we have thought about this and we plan on supporting this by enhancing the auto-completion feature, i.e. being able to complete on complex (chained) expressions such as in your example. However this analysis has to be done using static type inferencing, which is not accurate. For example, the return type of the Rectangle.ByWidthHeight function needs to be inferred from the function declaration statically. However DesignScript is a dynamic language, which means that although the return type of this function is Rectangle the call to Rectangle.ByWidthHeight can return a collection of Rectangle objects via replication. Also if there are derived types of Rectangle class, those could be returned as well at run time. Therefore the run time (dynamic) type returned is the most accurate thing to use for autocompletion. Since we don’t execute the expression as soon as it is typed we will have to rely on static type inferencing.

You can expect this feature in Dynamo soon.


Ah brilliant, many thanks for your reply Aparajit. It will help me, and many others, no end. Huzzah.