Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
April 24, 2018, 07:57:38 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
G-Code, CAD, and CAM
G-Code, CAD, and CAM discussions
Total lines in the G Code for each file ??
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Total lines in the G Code for each file ?? (Read 3177 times)
0 Members and 1 Guest are viewing this topic.
Usamahan
Active Member
Offline
Posts: 11
Total lines in the G Code for each file ??
«
on:
February 29, 2012, 11:43:56 AM »
Hello
I would like to know if there is a Gcode or macro to give me the total numbers of the lines for each file I open in mach3 ??
In other words, I want a dro or input to show me the total lines for the file in the mach3 page.
Regards,
U.H
Logged
Tweakie.CNC
CNC is only limited by our imagination.
Global Moderator
Offline
Posts: 7,185
Super Kitty
Re: Total lines in the G Code for each file ??
«
Reply #1 on:
February 29, 2012, 12:03:14 PM »
Hi UH,
If you double click on the program window it will append line numbers to the GCode lines and you can just scroll to the bottom line to read the total.
Tweakie.
Logged
Success consists of going from failure to failure without loss of enthusiasm. Winston Churchill.
Usamahan
Active Member
Offline
Posts: 11
Re: Total lines in the G Code for each file ??
«
Reply #2 on:
February 29, 2012, 12:42:26 PM »
Thank you Tweakie ,
I want to put this macro in the open file button to give me the total lines in the file ( automatic) as a OemDro .
I will use it for percent program process.(which give me % of the job finished).
UH
Logged
BR549
Mach4 Alpha
Offline
Posts: 6,852
Re: Total lines in the G Code for each file ??
«
Reply #3 on:
February 29, 2012, 01:19:58 PM »
I normally don't give out the secret handshake but try this is does what you need. You will need to change the output from a message to the UserDRo you need.
'Macro to assign Gcode Total Line count
Sub ReadStraightTextFile()
Dim LineofText As String
Dim rw As Long
rw = 0
Open "" & Filename() For Input As #1
Do While Not EOF(1)
Line Input #1, LineofText
rw = rw + 1
Loop
'Close the file
Close #1
Message ""& (RW+1)
End Sub
(;-) TP
Logged
Tweakie.CNC
CNC is only limited by our imagination.
Global Moderator
Offline
Posts: 7,185
Super Kitty
Re: Total lines in the G Code for each file ??
«
Reply #4 on:
March 01, 2012, 02:20:34 AM »
My apologies UH - I did not read your question properly
Tweakie.
Logged
Success consists of going from failure to failure without loss of enthusiasm. Winston Churchill.
Usamahan
Active Member
Offline
Posts: 11
Re: Total lines in the G Code for each file ??
«
Reply #5 on:
March 01, 2012, 02:44:14 AM »
Thank you BR549 , it works, (even it takes a long time to load the file), this is what I need. Fast solving problems.Thank you again.
UH
Logged
Usamahan
Active Member
Offline
Posts: 11
Re: Total lines in the G Code for each file ??
«
Reply #6 on:
March 01, 2012, 04:39:03 AM »
BR549, I only have one more question.
All my files are more than 300.000 lines, so when I put your code, it took about 2 minutes and 30 seconds to load the file, while when I open it without the code it takes only 11 seconds.
So what I mean is, is there any way that we can know the total lines for the file without counting them one by one as the code did, so it can take less time ??
And of course thank you for your help, and I appreciate it.
Regards,
UH
Logged
Ya-Nvr-No
Active Member
Offline
Posts: 962
Re: Total lines in the G Code for each file ??
«
Reply #7 on:
March 01, 2012, 07:38:09 AM »
DRO 233 reports the total lines in a file.
DRO 240 reports the line number that I are currently running.
DRO 816 reports the line number your scrolling thru in the file if I am looking for something.
I have the DRO's on my main page I added them with machscreen but you can use screen4 I am sure.
line.JPG
(10.97 KB, 175x53 - viewed 174 times.)
Logged
http://www.yanvrno.com
Overloaded
Global Moderator
Offline
Posts: 4,757
Re: Total lines in the G Code for each file ??
«
Reply #8 on:
March 01, 2012, 08:29:20 AM »
YNN, where did you find 233 ?
It's not in any of the lists that I have.
Thanks,
Russ
Logged
Usamahan
Active Member
Offline
Posts: 11
Re: Total lines in the G Code for each file ??
«
Reply #9 on:
March 01, 2012, 08:50:43 AM »
Thank you Ya-Nvr-No ,
This is exactly what I need. Now I can open long files in the same time with a total line number which I will use it to give me a percentage of the finished work.
Thank you again, and I want to thank all the members for their help.
UH
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach4 General Discussion
===> Mach4 Toolbox
===> Mach4 Videos
===> Mach4 Plugins
=> Mach3 under Vista
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> CS-Lab
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Mach3 Wizards
=> Newfangled Mill Wizard
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Vistacnc Control Pendants
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Members Docs
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
Loading...