![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| NCPlot G-Code editor / backplotter Discuss NCPlot software here. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Would anybody know when or have a macro of script file for Ncplot to extract the tool numbers with offsets and the tool comments from a .Nc file? I was also looking to extract how many bytes are in the file. Thank You |
|
#2
| |||
| |||
| Keith. |
|
#3
| |||
| |||
Hi Cam, a little example for you.... Code: Set re = New RegExp 'set up a regular expression re.Pattern = "T\d+\s?(M6|M06)" ' the reg exp pattern numlines=NCPlot.NCPGetNumLines ' sets a variable with the number of lines in the file for i = 0 to numlines 'set a loop to read a line at a time currentline=NCPlot.NCPGetLine(i) 'get the current line as a text string value If re.Test(currentline) Then 'test if the regex is in the current line Set matches = re.Execute(currentline) ' if it is then get the matches If matches.Count > 0 Then for each match in matches ' for each match... do something msgbox (match) next end if End If next Regards, Keith |
|
#4
| |||
| |||
Thank You. I am looking to extract a list like this that I can then put at the top of my nc program --------------------------------------------------------------------- Tool List: ---------------------------------------------------------------------- File : Program : Full name : Created : 2/10/2011 5:19:51 PM ---------------------------------------------------------------------- Tool number Tool information ---------------------------------------------------------------------- T1 3-CENTERDRILL T2 STUB-DRILL-.250-DIA-1.00-F.L. T4 ENDMILL-.250-DIA-.50-F.L.-1.00-O.L. T5 BULL-ENDMILL-.250-DIA-.75-F.L.-1.375-O.L. T7 BULL-ENDMILL-.250-DIA-.062-R-.50-F.L.-1.00-O.L. T8 ENDMILL-.375-DIA-.50-F.L.-1.00-O.L. T9 ENDMILL-.250-DIA-.50-F.L.-1.00-O.L T14 1 CENTERDRILL X 1.0 O.L. T15 DRILL 3/64 -.0469 X 1.0 O.L. T16 ENDMILL .125 DIA -.50 F.L. - 1.0- O.L. T19 BULL ENDMILL .250 DIA.- R.032-.75 F.L.-1.25 O.L. ---------------------------------------------------------------------- |
|
#5
| |||
| |||
To create the regular expression to find the data you need, i would need to know the exact fromat of your program file, and they would also have to strictly follow this format. Do you hava a sample of one/ or part of your program? For example are the lines as follows : T1 M6 (3-CENTERDRILL) T1M06(3-CENTERDRILL) You see how above there is slight difference in format... this needs to be known. Once the data is extracted it can be writtrn out to a text file automatic. Thats what i do with our stuff. Regards, Keith. |
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Missing docs: Marco Wong's 3-Axis Motor Controller | tomking505 | DIY-CNC Router Table Machines | 0 | 05-25-2010 11:45 AM |
| Problem- Busch Script. | Claude Boudreau | BobCad-Cam | 0 | 09-24-2008 06:37 PM |
| Need help with VB script Syntax Please. | Adamj12b | Mach Software (ArtSoft software) | 6 | 09-18-2008 07:18 AM |
| Newbie- VB6,VB.net,VB script,What one??? | hydrospin01 | Visual Basic | 11 | 05-24-2008 08:09 PM |
| Backup Script.. | Rekd | Mastercam | 3 | 09-11-2003 09:34 AM |