Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto-Increment Number Hexadecimal

7 REPLIES 7
Reply
Message 1 of 8
sutcliw
1580 Views, 7 Replies

Auto-Increment Number Hexadecimal

I got the following auto-increment numbering macro from a previous post to this forum:

 

*^c^c_text;J;MC;\;;$M=$(+,$(getvar,USERI1),1);setvar;USERI1;$M=$(+,$(getvar,USERI1),1);

 

Anyone know if it is possible to have a similar auto-increment macro for hexadecimal numbers.

 

Much appreciated in advance for any suggestions.

7 REPLIES 7
Message 2 of 8
braudpat
in reply to: sutcliw

 

Hello

 

Welcome to the Autodesk/AutoCAD Forums !

 

I am not a specialist of the LT Macros & Diesel, so my answer (as far as I know) will be : it'impossible !?

But I am ready to learn ...

 

My idea : I will prepare with Notepad or Excel all the hexa numbers, I need ...

Then inside a MText with copy/paste, I will get a lot of hexa numbers

then Explode the MText, then move/use that you need ...

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 3 of 8
pendean
in reply to: sutcliw

Is there a repeatable pattern to the numbers you want, one that works with the 'addition' function? Show me here.
Message 4 of 8
sutcliw
in reply to: pendean

Hi Pendean, sorry for the delay in replying. I carry out no addition or any other calculation with the hexadecimal numbers. We mark up our products on a dwg using the hexadecimal number system rather than the decimal number system. The products are marked up sequentially but the starting number could be any number and also we use three digits. For example, we might have 000, 001, 002,..., 009, 00A, 00B,...

Message 5 of 8
pendean
in reply to: sutcliw

Like I wrote, repeatable pattern of "numbers' only: you can't write a macro in LT for true hexadecimal numbers/letters sequences like the macro, but you can write a static macro that always writes 000, 001, 002,..., 009, 00A, 00B,... etc all the time whenever you start it (or write several macros each starting at a different point).
Message 6 of 8
sutcliw
in reply to: sutcliw

Thanks Pendean, that sounds like it will be sufficient. How would I approach creating the macros. 

Message 7 of 8
pendean
in reply to: sutcliw

Rough draft:
^c^c_text;J;MC;\;;000;_text;J;MC;\;;001;_text;J;MC;\;;002;_text;J;MC;\;;003;_text;J;MC;\;;004;_text;J;MC;\;;005;_text;J;MC;\;;006;_text;J;MC;\;;007;_text;J;MC;\;;008;_text;J;MC;\;;009;_text;J;MC;\;;00A;_text;J;MC;\;;00B;_text;J;MC;\;;00C;_text;J;MC;\;;00D;_text;J;MC;\;;00E;_text;J;MC;\;;00F;_text;J;MC;\;;010;_text;J;MC;\;;011;

and so on. The macro abo ve assumes you have the correct text style and text size selected, it is set to Middle Center justification (the MC in the code) and zero rotation.
Message 8 of 8
pendean
in reply to: pendean

^c^c_text;J;MC;\;;000;_text;J;MC;\;;001;_text;J;MC;\;;002;_text;J;MC;\;;003;_text;J;MC;\;;004;_text;J;MC;\;;005;_text;J;MC;\;;006;_text;J;MC;\;;007;_text;J;MC;\;;008;_text;J;MC;\;;009;_text;J;MC;\;;00A;_text;J;MC;\;;00B;_text;J;MC;\;;00C;_text;J;MC;\;;00D;_text;J;MC;\;;00E;_text;J;MC;\;;00F;_text;J;MC;\;;010;_text;J;MC;\;;011;

 This might be easier to read/capture... .

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost