Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
I need to get the cutter diameter in the g-post. I see the CUTTER command in CL-file but it is commented like $$-> CUTTER / 10.000000.
There is an Article CS212554, but I have no access to eSupport yet.
Title | How to output CUTTER command to the CL-file in Creo Parametric, without the comment marking ($$) in front of it |
Description |
|
Applies To |
|
Cause | Where is the rest of the document?This is a partial view of the Article. Click for full details on Article CS212554. |
Resolution |
Is anybody able tell me solution?
Thanks,
Solved! Go to Solution.
When G-Post processes the NCL file it converts all lines that start with $$ into REMARK commands. So the $$ -> CUTTER / 10.00000, etc. gets changed to REMARK-> CUTTER / 10.00000. You can capture the REMARK statements in the FIL file and identify the CUTTER data, then extract the cutter diameter. It will be text so if you need it as a real number (scalar) you can convert it. Here is some sample FIL code you can add to your existing FIL file that will do this:
CIMFIL/ON,REMARK
REMTXT=TEXT/CLW $$ GET THE REMARK TEXT STRING
REMTXT=TEXT/OMIT,REMTXT,1 $$ REMOVE THE TRAILING BLANK SPACES
CUTF=INDXF(REMTXT,(TEXT/'CUTTER / ')) $$ LOOK FOR THE "CUTTER / " STRING
IF(CUTF .GT. 0)THEN
NCH=CANF(REMTXT,1) $$ GET THE NUMBER OF CHARACTERS LEFT IN THE STRING
CDTXT=TEXT/RANGE,REMTXT,14,NCH $$ PARSE OUT THE CUTTER DIAMETER VALUE
CD=SCALF(CDTXT) $$ CONVERT THE TEXT INTO A SCALAR
ENDIF
CIMFIL/OFF
Fred Nemecek
When G-Post processes the NCL file it converts all lines that start with $$ into REMARK commands. So the $$ -> CUTTER / 10.00000, etc. gets changed to REMARK-> CUTTER / 10.00000. You can capture the REMARK statements in the FIL file and identify the CUTTER data, then extract the cutter diameter. It will be text so if you need it as a real number (scalar) you can convert it. Here is some sample FIL code you can add to your existing FIL file that will do this:
CIMFIL/ON,REMARK
REMTXT=TEXT/CLW $$ GET THE REMARK TEXT STRING
REMTXT=TEXT/OMIT,REMTXT,1 $$ REMOVE THE TRAILING BLANK SPACES
CUTF=INDXF(REMTXT,(TEXT/'CUTTER / ')) $$ LOOK FOR THE "CUTTER / " STRING
IF(CUTF .GT. 0)THEN
NCH=CANF(REMTXT,1) $$ GET THE NUMBER OF CHARACTERS LEFT IN THE STRING
CDTXT=TEXT/RANGE,REMTXT,14,NCH $$ PARSE OUT THE CUTTER DIAMETER VALUE
CD=SCALF(CDTXT) $$ CONVERT THE TEXT INTO A SCALAR
ENDIF
CIMFIL/OFF
Fred Nemecek
Thank you. It works for me.
I had an inquiry back in 2013 that may be related. Here's a link:
Tool comments - can I extract them from the .ncl File
I kinda ended up answering my own question, but it wasn't a quick answer. I also included my code snippets if you're looking for them.