- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a simple transform that would add a leading zero in front of integers from 1-9. (as in, 01, 02, etc.). This is for a very simple application: a paperspace match line block that is automatically generated but could be manually updated or manually overwritten.
I can generate the desired number in a few ways, but I CANNOT GET A LEADING ZERO in front of single digit integers.
I have tried many workarounds. The most frustrating part is that autocad has options for formatting formula output. There are hundreds of possibilities simply with the formatting. But the closest I have found is to divide by 10 and make the decimal delimeter a space. That leaves a space in the numbers (0 1, 0 2, etc.).
I have had success with property sets. However, they can only be referenced in labels that appear in model space. I have solved this problem where plan production matchlines can be used. But for our biggest client, I need a dumber matchline in paper space. There will be a page template that has a plus 1 and minus 1 match line. Additional matchlines could be added or copied. However, if the entire layout is copied and re-named, the default references would be the previous and subsequent sheets.
I am posting a drawing with two blocks. One computes the previous page in a diesel expression. This one is hard coded to the previous sheet only. The other uses a custom block variable to add sheets to the existing. Thus, one block could make all the matchlines. But neither can handle the leading zero.
I have tried using a lookup table to connect 1 to 01, 2 to 02, etc. But apparently attributes can't be referenced; only parameters can. And it seems parameters can't have computations.
Any help would be much appreciated. Thanks,
Solved! Go to Solution.