Results 1 to 5 of 5

Thread: Marco or Script for toollist

  1. #1
    Registered
    Join Date
    Nov 2005
    Location
    usa
    Posts
    233
    Downloads
    0
    Uploads
    0

    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
    Registered
    Join Date
    Dec 2004
    Location
    U.K.
    Posts
    148
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Dec 2004
    Location
    U.K.
    Posts
    148
    Downloads
    0
    Uploads
    0

    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
    Registered
    Join Date
    Nov 2005
    Location
    usa
    Posts
    233
    Downloads
    0
    Uploads
    0

    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
    Registered
    Join Date
    Dec 2004
    Location
    U.K.
    Posts
    148
    Downloads
    0
    Uploads
    0
    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, 12:45 PM
    2. Problem- Busch Script.
      By Claude Boudreau in forum BobCad-Cam
      Replies: 0
      Last Post: 09-24-2008, 07:37 PM
    3. Need help with VB script Syntax Please.
      By Adamj12b in forum Mach Software (ArtSoft software)
      Replies: 6
      Last Post: 09-18-2008, 08:18 AM
    4. Newbie- VB6,VB.net,VB script,What one???
      By hydrospin01 in forum Visual Basic
      Replies: 11
      Last Post: 05-24-2008, 09:09 PM
    5. Backup Script..
      By Rekd in forum Mastercam
      Replies: 3
      Last Post: 09-11-2003, 10:34 AM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.