Variables in LDraw files


RE: Variables in LDraw files
#12
(2022-07-06, 16:43)Cam's Bricks Wrote:
Code:
0 !VAR "height" = 24
1 16 0 "height" 0 6 0 0 0 -20 0 0 0 6 box5.dat

4 16 10 "height" 10 6 "height" 6 -6 "height" 6 -10 "height" 10
4 16 -10 "height" 10 -6 "height" 6 -6 "height" -6 -10 "height" -10
4 16 -10 "height" -10 -6 "height" -6 6 "height" -6 10 "height" -10
4 16 10 "Height" -10 6 "height" -6 6 "height" 6 10 "height" 10

1 16 0 "height" 0 10 0 0 0 -"height" 0 0 0 10 box5.dat

1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat

You could (should?) do this using a new meta, especially since you would need to extend existing software in order to use it anyway.

Something like:
Code:
!VAR "height" = 24
!VAR 1 16 0 "height" 0 6 0 0 0 -20 0 0 0 6 box5.dat

You Could also loose the quotes (I always hate those) by defining grammar for the variable name, for example ([a-zA-z]+[a-zA-Z0-9]*) (case insensitive if needed)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Variables in LDraw files - by Cam's Bricks - 2022-07-06, 12:31
RE: Variables in LDraw files - by Roland Melkert - 2022-07-06, 21:10
Constants in LDraw files - by Nils Schmidt - 2022-07-07, 20:42

Forum Jump:


Users browsing this thread: 2 Guest(s)