-
I have a shape class called "question". I want to add a glob to make every shape with a name starting with "Question" use that class.
Is there a way to do this in one line? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I came across a similar problem; sometimes you have to keep moving objects between containers and doing so you also have to redo all the relations... for giving you an example. Using globs feels like hacking and it seems to be not efficient, I mean, compiling a file with globals takes more time. Another approach is using "vars" like in this example:
You can use your vars inside any container, it feels faster and looks better than using globals, but I think it can be improved by having a "resources" section were you can define your objects for later use. I describe my idea about "resources" here #1891 I really wish it can be implemented. Hope it helps you. |
Beta Was this translation helpful? Give feedback.
-
Oh interesting. |
Beta Was this translation helpful? Give feedback.
I realized that there actually is a way to do this (it's possible the additional functionality only came out after the original question you posted). You use
**
to glob every object, and filter by its label.https://play.d2lang.com/?script=Ss5JLC5OLbZSqOZSUCgsTS0uyczPg_AUFHISk1JzrBTsuRQUarlqubi0tCAyalAJmHotLgUFsEEIIZByGNuQiysR1QIjrlouQAAAAP__&