Codeblock (display only specific geometry)

While working in codeblock, is there any way how to show only specific geometry like only polygons and not the circles.what ll be the code??how its been done.
Thank you
have a nice day.

As far as I know, you have to split your code using input and output variables into multiple blocks, of which you can then turn off the preview in the traditional way.

Maybe someone else here knows a programmatic way to do it.

Hi Sed07,
Thanks alot, yes by putting into nodes then we can do as conventionally its done.
but i am looking as is there any programming way to turn off the display in code.
i hope somebody ll give us some solutions.

I believe the only real way for you to “suppress” the preview would be either input your steps in a function in design script or write the code in python, what do you need this “functionality” for?

can’t you do something like (unknown to DesignScript):

#change flavour value 1, 2, 3
flavour = 1
flavour == 1 ?  point : flavour == 2 : circle : flavour ==3 : polygon

That will not work as your polygon depends on your circle, and that depends on the points.

However, this will do the job: (Combining it all onto one line).

Dear Jonathan!

I am very thankful to you for this generous help exactly thats what i was looking for but you defined it as a function and then call it. i am grateful to you.
have a nice day.
Cheers. :slight_smile:

If a comment solved your problem please mark it as the solution for future reference :slight_smile: And have a nice day yourself, Cheers :slight_smile:

My preferred solution is to simply turn off the preview of the Code Block itself and output another code block that simply passes through the element using a variable as such.


Also, turn Isolate Selected Geometry on: