MAKE_NAME(nged)
make a unique name
π MAKE_NAME(nged) β bestie's guide to making unique names β¨
okay so welcome to make_name, a little command from the BRL-CAD User Commands fam that literally just makes you a unique object name, and honestly? it eats. π
πΈ SYNOPSIS πΈ
make_name template | -s [num]
π¦ DESCRIPTION π¦
so here's the vibe: make_name generates a unique object name by substituting an auto-incrementing integer counter into the template string you hand it. the counter starts at 0 and increments every single time a name is generated. β¨
and before it ever returns a name to you, make_name verifies the name does not already exist in the database β and if it does, it just keeps incrementing the counter further until it finds an unused name. no cap, it checks. π
the template string uses the @ character as a placeholder, and that @ gets replaced by the current counter value:
prefix@suffixβ the@is replaced by the current counter value. for example,part@.smight producepart0.s,part1.s, etc. π- name with no
@β if there's no@present, the counter value is appended directly to the end of the template. simple as that π @@β a literal@@in the template is treated as an escaped@and is passed through unchanged (it does not get replaced by the counter). iykyk π§
the counter is shared across all calls within the same session and persists until it's reset with -s. so likeβ¦ it remembers. main character energy fr fr π
β¨ OPTIONS β¨
-s [num]β set the internal counter to num. if num is omitted, the counter is reset to0. π
π₯ EXAMPLES π₯
Example 1. Generate unique names with a prefix template
mged> make_name part@.s mged> make_name part@.s mged> make_name part@.s
part0.s
part1.s
part2.s
each call increments the internal counter, producing a new unique name. and if part0.s already existed in the database, the first call would return part1.s instead. see how that works? πβ¨
Example 2. Generate a name with no @ placeholder
mged> make_name widget
widget0
with no @ in the template, the counter is appended to the end of the string. periodt. π
Example 3. Reset the counter and restart numbering
mged> make_name part@.s mged> make_name -s 100 mged> make_name part@.s
part3.s
part100.s
after generating part3.s, the counter is set to 100 with -s 100. the next call then produces part100.s. iconic behaviour tbh π
π AUTHOR π
BRL-CAD Team β legends, honestly π«Ά
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. pls be nice to them π
ngl if something's acting cursed, that's the address β don't just suffer in silence bestie π
so yeah, that's make_name π this page comes to you from BRL-CAD in the BRL-CAD User Commands collection β MAKE_NAME(nged), mwah, go make some names that don't collide πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms