GDL
About building parametric objects with GDL.
SOLVED!

How to reset DrawIndex?

Nader Belal
Mentor
Hi everyone,

As we all know, we use Drawindex function to set the order of visibility of any element we script.

My question is, after we use Drawindex function in any part of the script, how do we reset it back to its original state ?
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator
As far as I know there is no default value as such.
Once you use it, you just have to keep resetting the value to what you need.

It would be nice if DRAWINDEX 0 could be used to reset back to the default order (figures, fills, lines, text).

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

7 REPLIES 7
Solution
Barry Kelly
Moderator
As far as I know there is no default value as such.
Once you use it, you just have to keep resetting the value to what you need.

It would be nice if DRAWINDEX 0 could be used to reset back to the default order (figures, fills, lines, text).

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Nader Belal
Mentor
@BARRY KELLY

Exactly
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Nader Belal
Mentor
@Barry Kelly

I just added this as to the wish list CREATE AN OPTION TO RESET DRAWINDEX TO ITS ORIGINAL ORDER
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Barry Kelly
Moderator
Excellent.
I have voted.
Thanks.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Peter Baksa
Graphisoft
Graphisoft
The relative order (figures, fills, lines, text) still applies to the same drawindex.
You could use drawindex 30 as the default level, and get two layers to draw above/beneath that.

Would it work for your needs?
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Lingwisyer
Guru
Peter wrote:
The relative order (figures, fills, lines, text) still applies to the same drawindex.
You could use drawindex 30 as the default level, and get two layers to draw above/beneath that.

So Drawindex is more like creating folders of predefined layers rather than reorganising layers?

1 - figures, fills, lines, text
2 - figures, fills, lines, text
etc.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Peter Baksa
Graphisoft
Graphisoft
Exactly. With some experimentation it looks like an unset drawindex is the same as drawindex 50, but this is undocumented, so it is better not to use drawindex in only half of the script.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest