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

Working on my post, need formatting help. Removing spaces and adding things

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
redcapjuice
512 Views, 2 Replies

Working on my post, need formatting help. Removing spaces and adding things

Hello, I am trying to work through my own post, however my machine is a bit special. lol. 

I need to add "(" at the beginning of each line, and ")" at the end. 

Like this:
(X1.)
(Y1.)

And also, I need to remove spaces between written blocks. 
Currently they output like this:
M6 T2
and I need it like this
M6T2

And REALLY I need it like this:
(M6T2)
(X2Y2Z1)

I'm getting close to where I need to be, but I just cannot figure out how to remove spaces between written blocks, and also how to add blocks. 

This is on the generic Fanuc milling post. 

Subsequently, on the fanuc turning post, how to I make the tool number "T1" and not "T10101"?  I've gotten it down to T0001, but can't figure out where the extra 000 is coming from. 

Coding was never my thing. 

Thanks! 

2 REPLIES 2
Message 2 of 3

Hi @redcapjuice 

All problem are simple edits

1. To add "(" and ")" after each line 

go to function writeBlock 

 

      writeWords2("N" + sequenceNumber, arguments);
    }
    sequenceNumber += properties.sequenceNumberIncrement;
  } else {
    if (optionalSection) {
      writeWords2("/", arguments);
    } else {
      writeWords("(",arguments,")");   //<< replace the old line with this one
    }
  }
}

 

Also you have to set the set sequence number to no

test.png

2.To remove spaces we already have user defined property named "Separate words with space" you can set to false by default in the post 

 

separateWordsWithSpace: false, // specifies that the words should be separated with a white space    
//<< set it to false here

 

3. change the toolformat to avoid the leading zeros.. like below

 

var toolFormat = createFormat({decimals:0,  zeropad:true});

 

remove the width:4 form the line 

It should work perfectly for you now

 


Boopathi Sivakumar
Senior Technology Consultant

Message 3 of 3

Thank you! I figured out the spaces right after posting this. The ( ) though, I was so close. I didn't add the quotes to make it "(" ")". 
But now everything is looking proper. 
Thanks again! Hopefully I'll get this thing running soon. 

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

Post to forums  

Autodesk Design & Make Report