586,287 active members*
4,055 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    244

    Marco or Script for toollist

    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. #2
    Join Date
    Dec 2004
    Posts
    150
    Quote Originally Posted by camtd View Post
    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
    Hi camtd, i have a script that i may be able to modify for getting your toolnumbers. What sort of format is the program.? Do you have a snippet?
    Keith.

  3. #3
    Join Date
    Dec 2004
    Posts
    150

    Simple Example

    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
    If you copy this code and save it as a file in the script folder, open a file in ncplot click the VBS button, click the script file name, It will message box each tool in the format e.g......T5M6 or T8M06.
    Regards,
    Keith

  4. #4
    Join Date
    Nov 2005
    Posts
    244

    Sample of toolist

    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. #5
    Join Date
    Dec 2004
    Posts
    150
    Quote Originally Posted by camtd View Post
    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.
    ----------------------------------------------------------------------
    Hi Camtd,
    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.

Similar Threads

  1. Missing docs: Marco Wong's 3-Axis Motor Controller
    By tomking505 in forum DIY CNC Router Table Machines
    Replies: 0
    Last Post: 05-25-2010, 05:45 PM
  2. Busch Script.
    By Claude Boudreau in forum BobCad-Cam
    Replies: 0
    Last Post: 09-25-2008, 12:37 AM
  3. Need help with VB script Syntax Please.
    By Adamj12b in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 09-18-2008, 01:18 PM
  4. VB6,VB.net,VB script,What one???
    By hydrospin01 in forum Visual Basic
    Replies: 11
    Last Post: 05-25-2008, 02:09 AM
  5. Backup Script..
    By Rekd in forum Mastercam
    Replies: 3
    Last Post: 09-11-2003, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •