Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Count and format characters

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
fraxyJQKHU
191 Views, 4 Replies

Count and format characters

Hello there,

 

Sorry for my bad english, i'm french.. But i guess i'll have so much response if i'm publishing in english.

 

So, for my center, i need to postprocess with lenght of code before each section. 

I'm trying to code it with javascript and it partially work(less than expected but.. eventually i'll get it some day). but i need to format the length with 9 numbers. When i use this code "parametriCount = parametriCount.toString().padStart(9, '0');" it said that "parametriCount.toString().padStart is not a function"

So i guess i'll have to incorporate some modern javascript library, but how i can do that ??

 

If you have some advice about that, i'll take it ! thank you !

4 REPLIES 4
Message 2 of 5

Hello fraxyJQKHU

 

You can use the Post engine to help out here. Check the Post Training guide 4.1.7 Format Definitions

 

  var nineDigits = createFormat({minDigitsLeft:9, type:FORMAT_TZS});
  writeBlock(nineDigits.format(10));
 
Let us know if that helps.


Bill Cain
Sr. Technical Consultant
Message 3 of 5
fraxyJQKHU
in reply to: fraxyJQKHU

Thank you for helping me on that. 

 

And maybe can you tell me how I can make a count of character into the nc file ?

 

Thanks again !

Message 4 of 5

Hello  fraxyJQKHU

 

I am not understanding what your looking for. Can you give me an example?



Bill Cain
Sr. Technical Consultant
Message 5 of 5
fraxyJQKHU
in reply to: fraxyJQKHU

Hello, 

 

Thank you for responding that quickly. 

 

In the nc file product by the postprocessor, I have an header. Into this header I have like a summary, which give exact number of character before each section. 

 

Like this : "parameter = 000000345 ;

 

                   Milling = 000000456 ;

 

                   Sawing = 000000789 ;"

 

                   Etc..

 

I have to put some stuff into the parameter section, like stock's dimensions, and the gcode into milling section.. but I'm not good enough to count that with the postprocessor.. so I have to do it after .. and that pretty ennoying.. like you can guess..

 

Best regards 

 

 

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report