You are on page 1of 43

Is there a way to convert drafting notes into machinable geometry?

Customer sent a
file with lots of engraving done to it. It would be much quicker to work off his notes
than to create my own letters...
Modify-break-Draft\line
ou change !atch "ines to standard lines to.
#sing $reak
!atch\"ine
this way you can machine them both.
%ndrew& 'ince () you can convert a library to a te*t file and work with it in e*cel or
an editor and then convert back from te*t.
+ight-click in the tool library to select those functions.
!i&
this is ,wannabe, C-hook -rogrammer again. .hat follows is a -art of testassc.c
e*am-le. $efore running c-hook& I created a drill o-eration /it is e*-ected to e*ist0.
1he question is2 why don3t I see any ,little tea-ot, te*t in the generated .nci file?
1hanks&
Marko
444444444444444
5include ,m6vars.h,
5include ,m6init.h,
5include ,m6assoc.h,
static void error/const char 7s0 8
Message$o*/9& s& ,1est,& M$6IC:;%'1<+I'=0>
?
static void test6nci6mgr /boolean 7succf0 8
o-eration o->
nci6bin n>
db6-tr6ty-e e6-tr>
long f-os>
tl6list 7tl>
@@ regenerate %"" o-erations that require regeneration /o-.db.nci6flag 44 1+#<0
nci6manager /9& ;CIMA+6+<A<;6%""& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6+<A<;6%"",0> return> ?
@@ -ost %"" the o-erations
nci6manager /9& ;CIMA+6D:'16%""& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6D:'16%"",0> return> ?
@@ set binary nci file -tr to the end of the binary nci file
nci6manager /9& ;CIMA+6E<;D& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6E<;D,0> return> ?
@@ make a manual entry o-eration using the Fst tool found in the database
memset /Bo-& 9& siGeof /o-eration00>
o-.o-code 4 1D6M%;#%"6<;1+>
@@ get a list of tools from the database
list6manager /1"6ID& ,,& "'1MA+6A<1& Btl0>
if /tl C4 ;#""0
8
o-.tl.slot 4 tl-Htl.o-.slot> @@ set the tool 5 if you want the o-eration to init the tool
list6manager /1"6ID& ,,& "'1MA+6E+<<& Btl0> @@ free the tool list
?
@@ add a comment
strnc-y /o-.comment& ,I3m a manual entry o-eration,& C:MM<;16'II<-F0>
@@ :DMA+6I;I16%DD writes the 3start of section3 -
@@ no need to call nci6manager /;CIMA+6.+6':'0 - :DMA+6I;I1 does not write
the sos
o-eration6manager /Bo-& :DMA+6I;I16%DD& Be6-tr& succf0>
if /C7succf0 8 error/,:DMA+6I;I16%DD,0> return> ?
@@ go to the end of the binary nci
nci6manager /9& ;CIMA+6E<;D& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6E<;D,0> return> ?
@@ write the start of file - sof& tool info and /if turned on0 -arameters
@@ set the ra-id -osition to JF K I9 for the F99K line
memset /Bn& 9& siGeof /nci6bin00>
n.gcode 4 ;CI6+%DID> @@ gcode for sof must be ;CI6+%DID or ;CI6"I;<%+
n.o-6idn 4 o-.o-6idn> @@ %".%' assign the -arent o-eration3s id number to all nci
lines
n.t-6ent6idn 4 9> @@ set this to 9
n.u.m9.e-FLJM 4 F.9> @@ home -osition J
n.u.m9.e-FLM 4 K.9> @@ home -osition
n.u.m9.e-FLIM 4 9.9> @@ home -osition I
nci6manager /o-.o-6idn& ;CIMA+6.+6':E& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6.+6':E,0> return> ?
@@ write some comments to the binary nci
memset /Bn& 9& siGeof /nci6bin00>
n.gcode 4 ;CI6C:MM<;1;:>
n.o-6idn 4 o-.o-6idn>
n.t-6ent6idn 4 9>
strnc-y /n.u.mF99N.comment& ,I3m a little tea-ot short and stout,& C:MM<;16'II<-
F0>
nci6manager /9& ;CIMA+6.+& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6.+ F,0> return> ?
strnc-y /n.u.mF99N.comment& ,1his is my handle,& C:MM<;16'II<-F0>
nci6manager /9& ;CIMA+6.+& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6.+ K,0> return> ?
strnc-y /n.u.mF99N.comment& ,1his is my s-out,& C:MM<;16'II<-F0>
nci6manager /9& ;CIMA+6.+& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6.+ O,0> return> ?
@@ now write the 3end of section3 marker for the new o-eration
memset /Bn& 9& siGeof /nci6bin00>
nci6manager /o-.o-6idn& ;CIMA+6.+6<:'& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6.+6<:',0> return> ?
@@ or you could write the end of section with the o-eration6manager as shown
@@ o-eration6manager /Bo-& :DMA+6;CI6%CC<D1& Be6-tr& succf0>
@@ let3s -ost the new o-eration
nci6manager /o-.o-6idn& ;CIMA+6D:'16:;<& Bn& Bf-os& succf0>
if /C7succf0 8 error/,;CIMA+6D:'16:;<,0> return> ?
?
void C!6<;1+ m6main/long 7-trs0 8
boolean succf>
if /Co-en6a--/-trs00
return>
test6nci6mgr /Bsuccf0>
close6a--/-trs0>
?
'ome suggestions2
F - Make sure the succf flag3s are returning a value of 1+#< after writing the
comment lines.
K - Make sure you3re writing the ;CI6<:' line after those comment lines.
O - 1he ;CI result you3re looking is after the binary nci has been converted to ascii.
1o see what3s really in your nci file call u- the o-eration manager& hold down the Ctrl
and 'hift keys and double-right mouse click on the title bar /or anywhere off a
control0 of the :-eration Manager. 1his will give you access to a su-er-du-er secret
debugging utility known only to a chosen few where you can select and dis-lay the
contents of the binary nci file. Make sure those comment lines are in there. If not&
it3s gotta be something sim-le you3re overlooking.
Millman&
!ere is the file generated by the .set tem-late. 1he ($ code I use in %ccess -arses
the -art data and tool data& then e*-orts the tool data to a csv format which is
im-orted to the current record on a sub form& along with the -art data.
code2
-------------------------------
| This file is automatically |
| generated. Do Not Change It. |
| Design by Matthew Finley |
-------------------------------

Startart!
rogramName " ######-$$% &'( ).NCF
MastercamName " ######-$$% &'( ).MC*
rogramNumber " +$$$%
rogramDate " $,-.,-$/
MaterialTy0e " )12MIN2M inch - 3$34
5or6+ffset " 783
Stoc6Si9e " # %..$$$$ : ;.$$$$ < $.$/$$
Stoc6+rigin " #-.$8 :-.$8 <$. From art <ero
art+rigin " <$ To0= #$ :$ on Front 1eft Corner
StartTools!
ToolID>ToolNumber>Dia>Flutes>T1+>C&C>1en>F1en>De0th>ToolDescri0tion>MfgC
ode
$%>$.$*/,>3>$%>$%>$.8$$$>$./$$$>-$.$.$$>/-/. C? 'M 3F1 TI)1IN>4%.3$-
$*3/$S$$$
$.>$..8$$>%>$.>$.>%.$$$$>$.8$$$>-$.$$4$>%-3 C@)MF'& MI11>4.%%$-.8$$SS$*$
$/>$.$*/,>3>$/>$/>$.8$$$>$./$$$>-$.$.,$>/-/. C? 'M 3F1 TI)1IN>4%.3$-
$*3/$S$$$
'ndTools
CycleTime " $ @rs= %4 Min= %;.8* Sec
1he tools& material& customer and machines are stored in different tables than the
-art data. 1he database assigns a 1oolID to the current record& and links to that tool
table. /1here3s lots of redundancy here& but I3m working on a method for the tool
table to remove du-licates& and assign similar tools to multi-le records.0
It3s a very nice setu- sheet if I do say so myself& and yes& I -lan on marketing it
when it3s done.
Millman&
!ere is the file generated by the .set tem-late. 1he ($ code I use in %ccess -arses
the -art data and tool data& then e*-orts the tool data to a csv format which is
im-orted to the current record on a sub form& along with the -art data.
code2
-------------------------------
| This file is automatically |
| generated. Do Not Change It. |
| Design by Matthew Finley |
-------------------------------

Startart!
rogramName " ######-$$% &'( ).NCF
MastercamName " ######-$$% &'( ).MC*
rogramNumber " +$$$%
rogramDate " $,-.,-$/
MaterialTy0e " )12MIN2M inch - 3$34
5or6+ffset " 783
Stoc6Si9e " # %..$$$$ : ;.$$$$ < $.$/$$
Stoc6+rigin " #-.$8 :-.$8 <$. From art <ero
art+rigin " <$ To0= #$ :$ on Front 1eft Corner
StartTools!
ToolID>ToolNumber>Dia>Flutes>T1+>C&C>1en>F1en>De0th>ToolDescri0tion>MfgC
ode
$%>$.$*/,>3>$%>$%>$.8$$$>$./$$$>-$.$.$$>/-/. C? 'M 3F1 TI)1IN>4%.3$-
$*3/$S$$$
$.>$..8$$>%>$.>$.>%.$$$$>$.8$$$>-$.$$4$>%-3 C@)MF'& MI11>4.%%$-.8$$SS$*$
$/>$.$*/,>3>$/>$/>$.8$$$>$./$$$>-$.$.,$>/-/. C? 'M 3F1 TI)1IN>4%.3$-
$*3/$S$$$
'ndTools
CycleTime " $ @rs= %4 Min= %;.8* Sec
1he tools& material& customer and machines are stored in different tables than the
-art data. 1he database assigns a 1oolID to the current record& and links to that tool
table. /1here3s lots of redundancy here& but I3m working on a method for the tool
table to remove du-licates& and assign similar tools to multi-le records.0
It3s a very nice setu- sheet if I do say so myself& and yes& I -lan on marketing it
when it3s done.
.hat Drosoft is wanting to know& is wether Mastercam can -rovide a roughing -ath
which can do a standard :D rough -attern& but at the end of the -ass ,sto- short, of
the end of the contour& retract& and then face rough the end of the contour. 1he
reason for this& is that a -otential customer of his& is looking at -urchasing
Mastercam. 1hey machine a lot of stainless steel com-onents& and when machining
the second o-& if they use the above method& it removes the ,waste ring, of material
that is left& which can Pam against the Paws& and@or hammer the insert.
et it can be done quickly and I do it in such a way.
ou are talking about roughing & right .
I write a rough -ass I de-th only com-ensation to com-uter .
$ack-lot my geometry and save it .
;ow i build an add-on for a center of the mill.
I re-lace my original geometry with a back-lotted and add my add on geometry &
change com-ensation ty-e to off & add de-th cuts-Hde-th cuts order by de-th and
here we are C
:= friends& here3s my suggestion& use the ,Direction, switch on the second -age of
the tool-ath -arameters -age. ou can control -lunge angle as well as a--roach
angle at the same time for entry and e*it.... and a -ond further reading& if the
customer@-otential customer wants the ability to add cutter com- to the -ath& Pust
go into the ,1ool-ath <ditor,& find the -oint before the a--roach and turn com- on&
find the last -ass& and where the e*it is /using ,Direction, in conPunction with this
gives clean results0 turn com- off.
Is there a variable available that records the last a*is -osition?
I beg it differ - it always works and you do know what the value in the 3-rv3 variable
is.
% 3-rv6LvarnameM3 is automatically created by MD for every numeric variable.
1he -rv6LvarnameM variable is always loaded with the value of the LvarnameM
variable every time the value in LvarnameM is out-ut to the ;C file& or you can
e*-licitly force this u-date from the value in LvarnameM to -rv6LvarnameM by using
the 3C3 -refi*.
<*am-le2
C*abs& 7yabs
.ould co-y the current value in 3*abs3 into 3-rv6*abs3. ;ote that using the 3C3 this
u-date occurs .I1!:#1 any out-ut being written to the ;C file.
3-rv6yabs3 would also get loaded from 3yabs3 in this e*am-le because it3s value was
E:+C<D to out-ut to the ;C using the 373 -refi*.
1here3s a few tricks to do what you want. 1he one I -refer requires you to have your
center drill& drill B reamer o-erations already saved in a library and goes like this2
METHOD #1
F - 'tart a drill o-eration and -ick your -oints.
K - :n the first -age of the drill -arameters& right click in the tool list -ane. 'elect
Get operations from library...
O - 'elect your center drilling& drilling& reaming& etc o-erations from the library and
hit :=.
Q - 'ay NO to the Import/add the operation groups also? question.
N - 'ay NO to the Retain depth values of merged points? question.
#nknown the the user /that3s you0& the system has now created a new o-eration for
each o-eration you selected to im-ort and they all share the same points.
R - 'elect the OK button /without having to fill in any other -arameters0.
) - 'ay NO to the reate the !urrent operation in addition to the ones you have
imported? question.
777 ou now have o-erations that all share the same -oints. 1his is very -owerful as
you can e*ecute this method and share geometry on %; ty-e /drill& msurf& etc0 of
e*isting o-eration at any time and im-ort any o-eration from any library or other
Mastercam MCS file. 777
METHOD #2
F - Create your first drilling o-eration /let3s say it3s the center drilling one0 like you
usually would.
K - Create your ne*t drilling o-eration& but instead of select -oint geometry& select
the "ubpgm ops o-tion.
O - 'elect the center drilling o-eration that you created in ste- 5F from the list and
hit OK .
Q - Eill in your -arameters like normal and hit OK .
777 our second o-eration is now asso!iated and shares the same -oints as the first
o-eration. Change@delete a -oint in the first o-eration and regenerate and the
second o-eration will regenerate also. 777
METHOD #3
F - In the o-eration manager& create a new o-eration grou- /or use an em-ty one
that contains no o-erations0.
K - Im-ort your center drill& drill B reamer o-erations from your library into this new
grou-.
O - <dit the geometry for the first o-eration and add your -oints. 'elect OK .
Q - In the o-eration manager drag the points from the geometry bran!h of the first
operation to the group name. 'elect the Repla!e o-tion.
777 1his deletes all the geometry from all the o-erations in the grou- /which there
was none in all but the first o-eration anyway0 and stuffs in the -oints from the first
o-eration. 777
Draw a tic-tac-toe board and -ut a border around it. <ach of the squares formed this
way is one -atch& so this coons surface will be three along by three across. In the
along direction there will be Q contours& each consisting of three segments. In the
across direction there will also be four contours& each consisting of three segments.
1o chain the surface correctly& you will need to break each contour at it3s intersection
-oints. 1he wireframe will look something like this2
code2
Coloumns!
% . / 3
|---A---A---| B- &ow %
| | | |
A---A---A---A B- &ow .
| | | |
A---A---A---A B- &ow /
| | | |
|---A---A---| B- &ow 3
ou3ll need a break at each 3T3. 1he segments /or contours0 needed for each row or
coloumn will be the entities that form a chain between the break -oints.
;otes2
- %long and %cross are subPetive. 1hat is& choose whatever is convenent for the along
direction. %cross will be the direction that is S9 degrees to what you have chosen for
along.
- %ll chain directions across and along must be uniform. .hat direction you choose
doesn3t matter& as long as you continue to chain in that direction.
- 1he first along chain must start at the same -oint as the first across chain& and
-oint away from the first across chain. i.e.
code2
C
|
----D
not
---D
C
|
- Day close attention to the grey bar Pust above the menu when chaining
manually. It will tell you what contour the command is looking for ne*t.
- Eor large and com-le* chains& it is often hel-ful to sketch the wireframe out
and number the edges you will be selecting.
- #se ChainUDartal to do the chaining. +emember that& with (S& you can start
a 3standard3 chain and select the 3end here3 for a -artial chain when the chain
finds a branch -oint. % -ro-erly constructed wireframe will have branch -oints
at each -oint the chain needs to sto- at.
!ere3s my K cents for this -roPect.
It adds comr-ession to the backu- routine
using .inGi-3s Command "ine Interface.

'////////////////////////////////////////////////////////////////////////////////
'//
'// Author: Matt Finley mfinley<at>rolingem<dot>com aka Rekd
'// Original script by Mick eorge and !ryan"#$%
'// &ate: #'/()/*((" (+:() AM
'// File ,ame: -Archi.er%.bs
'//
'// &escription: Makes a backup of the current M/ file to the folder specified%
'// 0se 1in2ip 3ith command line interface to compress then delete backup
file%
'// 4ou can get the command line interface here:
http://333%3in2ip%com/32cline%cgi
'//
'// /omments: 5his script uses 322ip%e6e7 81in9ip's command line interface: to
compress
'// the backed up files% ;nsure the correct path and arguments for the
compression
'// you 3ish to use are entered belo3% 4ou need to use the truncated name for
'// long path names that contain spaces 3hen calling 322ip%e6e%
'// 5his script uses <m and <e6 to delete the original backup file and
'// to use ma6imum compression%
'//
'//
'////////////////////////////////////////////////////////////////////////////////
'
'///////////////// My /onstants /////////////////

=ublic /onst fso&R>?;-0,@,O1, A (
=ublic /onst fso&R>?;-R;MO?A!B; A #
=ublic /onst fso&R>?;-F>C;& A *
=ublic /onst fso&R>?;-,;51OR@ A "
=ublic /onst fso&R>?;-/&ROM A $
=ublic /onst fso&R>?;-RAM-&>D@ A E
=ublic /onst &;F-/;,5;R;& A F F
=ublic /onst &;F-;RRBO A F/:GRoling /ustomersG!ackupsGMcDcript;rr%logF ' =ath
and file for error log
=ublic /onst str9ip=ath A F/:G=rograH#G1in9ipG322ip%e6e <m <e6F '=ath and options For
compression
=ublic /onst &;F-!A/@0=-&>R A F/:GRoling /ustomersG!ackupsF ' !ackup folder
&im str,ame
' << Dtart Dcript
/all Main8:

' ////////////////////
' Dub &eclaration
' ////////////////////
Dub Main8:
On ;rror Resume ,e6t
&im str!ackup=ath
&im strOriginal=ath
&im FDO
&im str4ear
&im strMonth
&im str&ay
&im strIour
&im strMin
&im /
/ A /hr8"$: ' .ariable for F 8double Juote:
Det FDO A /reateObKect8FDcripting%FileDystemObKectF:
' << Make sure theres a disk in the floppy dri.e
' << /heck to make sure backup folder is .alid
>f FDO%Folder;6ists8&;F-!A/@0=-&>R: 5hen
' << Make sure 3e ha.e a dra3ing to sa.e
>f ,ot >s&ra3ing 5hen
Dho3Dtring F,o current dra3ingF L &;F-/;,5;R;&
' << !ail
;6it Dub
;nd >f
' << Dtore current dra3ings name
strOriginal=ath A et/urrentFile,ame
' << Format a time and date stamp and strip illegal chars
str4ear A Replace8Format&ate5ime8&ate7 .bDhort&ate:7 F/F7 FF:
strIour A Replace8Format&ate5ime85ime7 .bDhort5ime:7 F:F7 FF:

' << !uild fullpath
str!ackup=ath A Add!ackDlash8&;F-!A/@0=-&>R: L
FDO%et!ase,ame8strOriginal=ath: L F-F L str4ear L F-F L strIour L F%F L
FDO%et;6tension,ame8strOriginal=ath:

/all /learMenuAnd=rompts

' << &isplay current file in prompt area
/all 1riteDtring8F!acking up file7 please 3ait%%%F:


>f Da.eM/As8str!ackup=ath7 5rue: 5hen
str,ame A str9ip=ath L F F L / L str!ackup=ath L F%2ipF L / L F F L / L
str!ackup=ath L /
/all DhellAnd1ait8str,ame7 5rue:
' Dho3Dtring F!ackup to F L &;F-!A/@0=-&>R L F completeF L
&;F-/;,5;R;&
;lse
Dho3Dtring F/ould not backup file to F L &;F-!A/@0=-&>R L
&;F-/;,5;R;&
;nd >f

' << D3itch back to original file
/all Da.eM/As8strOriginal=ath7 5rue:
/all /learMenuAnd=rompts
/all RepaintDcreen 85rue:
;lse
Dho3Dtring FFolder F L &;F-!A/@0=-&>R L F does not e6istMF L
&;F-/;,5;R;&
;6it Dub
;nd >f
>f ;rr 5hen /all 5rap;rror8FDub::MainF7 ;rr7 5rue:
Det FDO A ,othing
;nd Dub
' ////////////////////
' Dub &eclaration
' ////////////////////
Dub 5rap;rror8sDource7 obK;rr7 bBog>t:
&im sMD
&im sBog;rror
&im FDO

sMD A FFollo3ing error occurred in this script:F L &;F-/;,5;R;& L .b/rBf L
.b/rBf
sMD A sMD L obK;rr%&escription L &;F-/;,5;R;& L .b/rBf
sMD A sMD L F,umber: F L obK;rr%,umber L &;F-/;,5;R;& L .b/rBf
sMD A sMD L FDource: F L &;F-/;,5;R;& L sDource

Dho3Dtring sMD

>f bBog>t 5hen

sBog;rror A F;rror F L obK;rr%,umber L F in F L sDource L F:F L .b/rBf L
obK;rr%&escription
/all 1riteBog8sBog;rror:
;nd >f

obK;rr%/lear
Det obK;rr A ,othing
;nd Dub

' ////////////////////
' Dub &eclaration
' ////////////////////
' ////////////////////
' Function &eclaration
' ////////////////////
Function etDcript;ngine>nfo8:
On ;rror Resume ,e6t
&im s
s A FF ' !uild string 3ith necessary info%
s A Dcript;ngine L F ?ersion F
s A s L Dcript;ngineMaKor?ersion L F%F
s A s L Dcript;ngineMinor?ersion L F%F
s A s L Dcript;ngine!uild?ersion

etDcript;ngine>nfo A s ' Return the results%
>f ;rr 5hen /all 5rap;rror8FetDcript;ngine>nfoF7 ;rr7 5rue:
;nd Function
' ////////////////////
' Function &eclaration
' ////////////////////
Function /heck&ri.e8s=ath:
On ;rror Resume ,e6t
&im FDO
&im fso&ri.e
Det FDO A /reateObKect8FDcripting%FileDystemObKectF:

' << et the FAF dri.e
Det fso&ri.e A FDO%et&ri.e8s=ath:
Delect /ase fso&ri.e%&ri.e5ype
' << Only interested in a Floppy dri.e%%%
/ase fso&R>?;-R;MO?A!B;: /heck&ri.e A fso&ri.e%>sReady
/ase ;lse
' << Force failure
/heck&ri.e A False
;nd Delect
' << /lean up
Det FDO A ,othing
Det fso&ri.e A ,othing
>f ;rr 5hen /all 5rap;rror8FFunction::/heck&ri.eF7 ;rr7 5rue:
;nd Function
' ////////////////////
' Function &eclaration
' ////////////////////
Function Add!ackDlash8s=ath:
>f Right8s=ath7 #: <> FGF 5hen s=ath A s=ath L FGF
Add!ackDlash A s=ath
;nd Function
' ////////////////////
' Function &eclaration
' ////////////////////
Function >s&ra3ing8:
&im Ret
Ret A Dtart&!Dearch8mc-ali.e7 <#:
>s&ra3ing A Ret
;nd Function
%n '.6!ID< flag. My kingdom for an '.6!ID< flag for the 'hell<*ecute/0& er& I
mean 'hell%nd.ait/0 function
Dlace it anywhere you wish. "aunch the scri-t editor /it3s a C-!ook called
mcamvb.dll[0& browse to the file you want and click the ,+un, button. 1hat3s it.
In the o-eration manager o-en u- the tool-ath. 1hen on the first tab select Change
NCI there should be a check bo* with force tool change select that for each
tool-ath you need the toolchange.
1he bit that says
code2
n=EF$GE=sg0lane= EHE= e
should be changed to
code2
n=IF$GI=sg0lane= IHI= e
1he single quotes means those strings will only be out-ut if there is other out-ut on
that line& in this case if sg-lane is out-ut.
the vaiable in a costom macro body for . is 5KO
If your looking to read in a*is -osition to load
in your 1" offset -age
5N9QF Fst a*is
5N9QK Knd a*is
5N9QO Ord a*is
5N9QQ Qth a*is
5N9QN Nth a*is
5N9QR Rth a*is
here is a sam-le for reading I -osition
:999F/1::"-'<11I;A D+:A+%M0>
;F5F994F/set 5F99 equal to first tool0>
;KD:F>/beginning of loo-0>
;O1L5F99M/select tool0>
;QMR/tool change0
;N5O99R4F/'<1 1::" :EE F.9 $":C= - comment line for o-erator0>
;R5LK999T5F99M45LN9KOM-F.9/D#1 M%C!I;< I - F, I;1: :EE'<10>
;)A9ASFAKVI9.9/ra-id to I a*is Gero return0>
;V5F9945F99TF/increment to ne*t tool0>
;S<;DF/end indefinite loo-0>
;F9AS9/switch back to absolute coordinates0
MO9
W
sam-le to indicate a bore and load J& -oition into
offset -age&sim-le by -ushing cycle start
:999F/I;DIC%1I;A D+:A+%M0>
1KN MR
AS9AV9AQ9AQSAF)AK9>
A9AN)J99$9
AQO!KNIF9.>
J-N.KN O.)N
5O99R4F/I;DIC%1<0>
5F9F45N9QF>/'<1' ;<. J C::+DI;%1<0
5F9K45N9QK>/'<1' ;<. C::+DI;%1<0
A9IF9./+<1#+; 1: I;I1I%" D:I;10
Main Menu
Create
;e*t Menu
%dd-ins
Mcam($
% Dialog will come u-& click ;<.
:n the second line from the bottom& re-lace that entire line with
code2
Call SaJeMCFTrueG
;ow click '%(< and ty-e X'%(< and -ress <;1<+
Close the ($ <diter
Ao to
'creen
Configure
1oolbars@=eys
;ow click anywhere I;'ID< the ,"ist of assignments, window& on any of the items
listed there. ;ow -ress your 3X3 key. ou should see X'ave.($'.
;ow click %DD and select the button.
:-en the ($' <ditor and create a ;<. scri-t.
ou3ll see a bunch of 3@@@@@@@@ - header stuff - @@@@@@@@& and towards the bottom you3ll
see this>
code2
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG
I -- )dd code here...
'nd Sub
.here it says2
code2
I -- )dd code here...
+e-lace it with2
code2
Call SaJeMCFTrueG
ou should have this2
code2
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG
Call SaJeMCFTrueG
'nd Sub
;ow save the scri-t as qsave.vbs or what ever& then go to
'creen
Configure
1oolbar@=eys
%ssign your button to the scri-t you Pust created. ou can filter the "ist of %rguments
to only show ($ 'cri-ts by using the dro- down list below the functions.
1ry alt-*. 1his is set main. It will change all attributes& including the level& to match
the entity you -ick.
:-en a drawing. 1his scri-t -rom-ts the user for a colour and an arc diameter. 1he
scri-t then searches for all arcs and when an arc diameter matches the user s-ecified
diameter it changes that arcs colour to the user s-ecified colour.
code2
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG
Dim lngColour
Dim dblDiameter
Dim dbl)rcDia
Dim b+K= b&et
Dim C)rc
Dim lng)rcs
I -- rom0t for a colour and a diameter
If as6ColorFlngColourG Then
I -- )s6 for a dia
If as6(alueFES0ecify a diameterE=$= %$$= dblDiameterG Then
I -- Select all arcs
b&et " StartD?SearchFmcLaliJe= mcLarcty0eG

I -- +6 to goM
If b&et Then

I -- Initiali9e loo0ing flag to false
b+6 " False

Do
I -- Instantiate a new )rc class obNect
Set C)rc " New Mc)r

I -- See if we returned a Jalid obNect
b+6 " 7et)rcDataF-%= C)rcG

I -- Success M
If b+6 Then
I -- 7et this arcs diameter
dbl)rcDia " FC)rc.& O .G
I -- If you need to add a tolerance you can add it to this
I -- eJaluation.
If dbl)rcDia BD dblDiameter Then
I -- Ignore it...
'lse
I -- Set the colour
Call Set'ntityColorFlngColourG
lng)rcs " lng)rcs A %
'nd If

'nd If

I -- Pust to be sure
Set C)rc " Nothing

I -- 7et the neQt entity
b&et " NeQtD?SearchFG


1oo0 5hile b&et

I -- <oom all
Call &e0aintScreenFTrueG

I -- SaJe it
Call SaJeMCFTrueG
ShowString EScri0t com0leted= E R lng)rcs R E arcs were foundE

'nd If
'nd If
'nd If
'nd Sub
--------------------
=ind +egards&
Mick
code2
I-----------------------------------------------------------------------
---------
I--
I-- )uthor! Mic6 7eorge Mic6.7eorgeSMastercam.com
I-- Date! $*-$*-.$$/
I-- File Name! 1aunchI'
I--
I-- Descri0tion! 1aunches I' !D
I--
I-- Comments! +bNect 0ro0erties located at
I--
htt0!--msdn.microsoft.com-wor6sho0-browser-webbrowser-reference-obNects-
Internet'Q0lorer.as0
I--
I-----------------------------------------------------------------------
---------
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG
+n 'rror &esume NeQt

Dim obNI'
I Create the I' obNect and sets some 0arameters
Set obNI' " Create+bNectFEInternet'Q0lorer.)00licationEG
If obNI' Is Nothing Then 'Qit Sub
If 'rr Then
ShowString E'rror loading Internet 'Q0lorer E R 'rr.Descri0tion
'Qit Sub
'nd If
5ith obNI'
.NaJigate Ewww.eMastercam.comE
.Tool?ar " False
.Status?ar " False
.&esi9able " True
Do
I <99999....
1oo0 5hile .?usy

.5idth " ;$$
.@eight " 3$$
.1eft " 8$
.To0 " 8$
.(isible " True
'nd 5ith

Set obNI' " Nothing
'nd Sub
;ot shure what out-ut you want?
sca*adrs % 5%ddress for the rotary a*issca*minus %- 5%ddress for the rotary a*is
/signed motion0
Erom master
5 1able rotation direction
5 1able rotation direction& inde*
sind*6cw MKK 5+otate C. code
sind*6ccw MKF 5+otate CC. code
sind*6mc 51arget for string
fstrsel sind*6cw ind*6mc sind*6mc
Change
5 1able rotation direction
5 1able rotation direction& inde*
sind*6cw % 5+otate C. code
sind*6ccw -% 5+otate CC. code
sind*6mc 51arget for string
fstrsel sind*6cw ind*6mc sind*6mc
I did the same thing on my okumaQth
I made MFR Modal MFN Modal for out-ut
only when dir. change
.as
-inde* 5Inde* out-ut
if inde* B rot6on6*&
L
-bld& n& Ysind*6mc& ind*6out& e
Ccabs& Ccinc
M
1o
-inde* 5Inde* out-ut
if inde* B rot6on6*&
L
sav6mcode 4 ind*6mc
sav6mcode 4 Gero
-bld& n& Ysind*6mc& ind*6out& e
Ccabs& Ccinc
M
I-----------------------------------------------------------------------
---------
I--
I-- )uthor! Mic6 7eorge Mic6.7eorgeSMastercam.com
I-- Date! *-*-.$$/ *!8*!8; )M
I-- File Name! moJeLallLlinestyleLcenterLtoLnewLleJel.Jbs
I--
I-- Descri0tion! This scri0t shows how to moJe all linestyleLcenter
from one leJel to another
I--
I--
I-----------------------------------------------------------------------
---------
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG

Dim int1ineStyle
Dim dbl1eJelNumber
Dim b+K= b&et
Dim lngCount

I -- Set state
Call ClearMenu)ndrom0ts
Call 2nselect)ll
Call FreeChains
I -- <oom all
Call &e0aintScreenFTrueG
I -- )s6 for a leJel number that we will use to moJe all entities too
If Not as6(alue FETy0e a leJel number to moJe linestyle centre entities
tooE= %= .88= dbl1eJelNumberG Then 'Qit Sub
I -- Select all arcs
b&et " Chain)llFFalse=False=mcC+NST&2CTI+NLC+1+&LC2&&'NT=
mcC+NST&2CTI+NL1'('1LC2&&'NTG

I -- +6 to goM
If b&et Then
I -- Initiali9e loo0ing flag to false
b+6 " False
lngCount " $

Do
I -- Chec6 the linestyle ty0e
If 7et'ntityStyle " mc1IN'ST:1'LC'NT'& Then
I -- MoJe it
Call Set'ntity1eJelFdbl1eJelNumberG

I -- Kee0 a running total
lngCount " lngCount A %
'lse
I -- Do nothing...
'nd If
I -- 7et the neQt entity
b&et " MoJeToNeQtChain

1oo0 5hile b&et

I -- Inform user
If lngCount " $ Then
ShowString ENo linestyle centre entities foundE
'lse
ShowString lngCount R E linestyleLcenter entities moJed to leJel E R
dbl1eJelNumber
'nd If

'nd If
I -- <oom all
Call &e0aintScreenFTrueG
'nd Sub
ou can e*-ort an emf image of the current drawing /see scri-t below0& however this
is a full screen image& we will be adding a scale factor to the emf function shortly.
code2
Call Main
I-----------------------
I-- S2?&+2TIN'
I-----------------------
Sub Main
Dim strFileName
Dim strathToImage
Dim strDrawingName
I -- ?uild 0ath to where the image will be saJed
strathToImage " 7etath+fThisScri0t
I -- 7et the current file name
strFileName " 7etCurrentFileName
I -- Stri0 the 0ath
strDrawingName " arseNameF7etCurrentFileNameG
I -- &e0lace it
strDrawingName " &e0laceFstrDrawingName= EMC*E= E'MFEG
I -- ?uild the full0ath
strathToImage " )dd?ac6SlashFstrathToImageG R strDrawingName

I -- Fit screen
Call &e0aintScreenFTrueG
I -- Create the file
If DoMetafileFstrathToImageG Then
ShowString EIE R strathToImage R EI has been createdE
'lse
ShowString E2nable to create 'MF fileE
'nd If
'nd Sub
I-----------------------
I-- F2NCTI+N
I-----------------------
ublic Function )dd?ac6SlashFsathG
If 1enFTrimFsathGG D $ Then
If &ightFsath= %G BD ETE Then
sath " sath R ETE
'nd If
'nd If
)dd?ac6Slash " sath
'nd Function
I-----------------------
I-- F2NCTI+N
I-----------------------
ublic Function arseNameF sathG

Dim str#
Dim int#

int# " InStr&eJFsath= ETEG

str# " TrimF&ightFsath= 1enFsathG - int#GG

If &ightFstr#= %G " ChrF$G Then
arseName " 1eftFstr#= 1enFstr#G - %G
'lse
arseName " str#
'nd If

'nd Function
ou need to add out-ut this might fi* it.
5 --------------------------------------------------------------------------
5 +otary %*is 'ettings
5 --------------------------------------------------------------------------
sca*adrs % 5%ddress for the rotary a*is
sca*minus -% 5%ddress for the rotary a*is /signed motion0
ou still might need to track more down
$ut I think 1hat should fi* it.
add
1able rotation direction
5 1able rotation direction& inde*
sind*6cw % 5+otate C. code
sind*6ccw -% 5+otate CC. code
sind*6mc 51arget for string
fstrsel sind*6cw ind*6mc sind*6mc
and force out-ut
1he home -osition is a location on the machine tool where the tool returns for tool
changes and at the end of the ;C -rogram.
F. %ccess the tool -arameters dialog bo* by doing one of the following2
Z Create a tool-ath
Z Erom the :-erations Manager& click on the Darameters icon of the o-eration.
K. 'elect the !ome Dos check bo* and click the button.
O. <nter the JI coordinates or choose 'elect to return to the gra-hics window and
select a -oint.
Q. Choose :=.
% reference -oint is a location that the tool moves to between the home -osition and
the start or end of the tool-ath. 1he +eference Doints dialog bo* lets you set both
a--roach and retract reference -oints for the current o-eration.
F. %ccess the 1ool -arameters dialog bo* by doing one of the following2
Z Create a tool-ath.
Z Erom the :-erations Manager& click on the Darameters icon of the o-eration.
K. 'elect the +ef Doint check bo* and click the button.
O. 'elect %--roach to set a move between the home -osition and the start of the
tool-ath.
Q. <nter the JI coordinates or choose 'elect to return to the gra-hics window and
select a -oint.
N. Choose %bsolute to set the reference -oint relative to the origin /9&90 or choose
Incremental to set the reference -oint relative to the first move in the tool-ath.
R. 'elect +etract to set a move between the home -osition and the end of the
tool-ath.
). <nter the JI coordinates or choose 'elect to return to the gra-hics window and
select a -oint.
V. Choose %bsolute to set the reference -oint relative to the origin /9&90 or choose
Incremental to set the reference -oint relative to the last move in the tool-ath.
S. Choose :=.
;ote2 1o set the same coordinate for both a--roach and retract& use the arrows to
co-y the values from one side to the other.
1here are many things you can do to get the -ost to out-ut what you want& the tool
table -ost block actually contains several different versions of out-ut which can be
activated or deactivated by adding or removing the 5 symbol at the begining of the
line/s0 /1he 5 symbol tells MD to ignore everything to the right of it0. In your case& I
would most likely sim-ly modify the lines that are actually being out-ut. Eirst& find
the variable formatting section /the area with the lines that start with fmt0 and add
the following to the bottom of that area 2
code2
fmt T++1 3 tool UTool number out0ut for tool table
then go to the -tooltable -ost block and add a line which says tool 4 t at the to- of
the -ostblock area /right above the tnote 4 t line0. ;ow modify the line being out-ut
/the one without the 50 by changing the 7t to 7tool.
I Pust want to note that the lines commented out already allow for a cou-le of
different styles of out-ut for the tooltable. In the case of the tnote 4 t& this variable
is also used in the -toolcomment -ostblock. ou could sim-ly comment out the lines
currently being used and uncomment the lines out-utting this value /which would
give you the 1::" - 5 as o--osed to the 1::"5 which is what you asked for. ou
could also use this and change the format statement for tnote 2
code2
fmt ET++1 - E 3 tnote U Note format
to
code2
fmt T++1 3 tnote U Note format
/the quotes are needed to include the s-aces in the original declaration - you
wouldn3t need them now0. 1he -roblem here is that the -toolcomment line would
also out-ut the same thing instead of the 1::" - 5 which is out-ut now. 1his is why
I went with the declaration of another variable instead. 1here are other methods to
achieve what you want including using the result 4 nwadrs/&0 function& but there
really isn3t any need to overcom-licate things here.
<dit the file !1M".'<1 in the Mcam editor. Make sure you make a back-u- co-y
before you start.
"ine S9 thru SQ in !1M".'<1
s-roPect ,DroPect,
so-eration ,:-eration,
scustomer ,Customer,
s-rogram ,Drogrammer,
shome ,!ometown,
I added the last line. ou can use whatever -hrase that is not being used already.
"ine QOV thru line QQN
5 -----------------------------------------------
5 Xuestion format statements
5 -----------------------------------------------
fq F s-roPect <nter DroPect ;ame
fq K so-eration <nter :-eration Descri-tion
fq O scustomer <nter Customer ;ame
fq Q s-rogram <nter Drogrammer
fq N shome <nter !ometown
I added the last line. 1he names have to match the -revious editions.
"ine SVS thru line SSQ
-collect 5 Collect info
qF
qK
qO
qQ
qN
%gain& I added the last line. 1he names have to match the -revious editions.
"ine F9QR thru line F9QV
,
, , ,& 7s-rogram& ,
,& e
,
, , ,& 7shome& ,
,& e
I co-ied and -asted the string for the Drogrammer question and changed the words
Drogrammer and 7s-rogram to match the -revious editions. I tested these edits and
they worked fine.
1+%;'E:+M 1::"D%1!'2
.e do multi-le setu-s all the time. I like to use the old ;CI edit the best you can
change your wcs in one click as well as transform or mirror& ect..... you can also use
tool-ath transferin the o-erations manager as well.
1ool -aths 1ransform
F. 1ranslate 4 1ool -lane origin only
K. Method 4 1ool -lane
O. Arou- ;CI out-ut by 4 o-eration ty-e
Q. Co-y source o-eration
N. Disable -osting in selected o-eration
R. .ork offset numbering 4 assign new set4 F B F
1ranslate
F. J 4 9
K. 49
O. ;umber of ste-s in J..'et to 5 of vises /translates0
works good for me
;o -roblem&
Pust dro- this code at the end of -toolend and
-tlchgF99K. you may need to move some code from
-sof to header. all it needs to work is for the -rogram 5s to be larger then the
-revious one.
same 5s will be the same -rogram.
;o messing with ncis at all.
1est it. test it. test it.
I have not tested it on a five a*is so I have no idea what will ha--en.
but it works great on O and Q a*is.
-----------------------------------
if -rogno H -rv6-rogno&
L
-eof& -header&
M
-----------------------------------
Millman& here3s a sam-le of a routine I made for !%%' to use the AFV) .999O corner
rounding function via Misc (alues...
code2
0cornerLround Ucorner rounding FG
if mi8 " % R mr8 D $ R flgLmi8 " $=
V
saJLmr8 " mr8=
0bld= n= E7%,4E= OsaJLmr8= e
flgLmi8 " %
W
if mi8 " % R mr8 " $=
V
EF 5)&NIN7XX C+&N'& &+2NDIN7 C+NT&+1 @)S GE= e
EF ?''N 'N)?1'D 5IT@+2T ) ()12' S'TX 2S' GE= e
EF MISC ()12'S-MISC &')1S T+ S'T ) ()12' GE= e
EF C+&N'& &+2NDIN7 C+NT&+1 IS DIS)?1'D GE= e
W
if mi8 " $ R flgLmi8 " %=
V
n= E7%,4E= e
flgLmi8 " $
W
1hen when I want to test for it& like during a tool change... you Pust call it like so..
code2
0tlchg UTool change FG
0cornerLround
0cutty0e
toolchng " one
toolcount " toolcount A %
if toolcountn B" tooltotal= neQttool " rbufF3=toolcountnG
else= neQttool " firstLtool
Ysni0Y
ou have to declare and format all variables..
code2
Ysni0Y
flgLmi8 ! $ U mi8 flag
Ysni0Y
fmt ' %. saJLmr8 U SaJed mr8 Jalue
Ysni0
EC!ET "#NCTION $%E!T&
If you go into your millS.t*t file and enable 5QNRQ by changing the te*t from #$%#.
&& '(ake lib& to #$%#. &'(ake lib& you3ll have access to a utility that does this for
you in your ;C #tils@Def 1ools menu.
try holding the control button down when you select the -ost button from the o-s
manager. you3ll see a button that out-uts tool-lanes relative to the .C'
In the o-erations manager& if you -ress CtrlT'hift and double righ click you have
access to a bunch of hidden stuff relating to the binary ;CI in your file.
ctrl T alt T shift B double right click on grey area of o-eration window?
+*$.$
FF)N2C-$M-C+NT&+11'&G
FINT'&N)1-T@&')D-MI11IN7G
FC)11'D-)S-F+11+5SG
F7;;*$.$D..8F%$.@%%.&%.T.$8<-..8G
FD-M)P+&-DI)G
FF-F''D-&)T'G
F@-C&C-&'7IST'&G
F&-&'(+12TI+NSG
FT-ITC@G
F<-D'T@G
FG
F()1ID)T'-IN2TG
IFVU4'ZU$W7+T+4FM)P+&-DI)G
IFVU*'ZU$W7+T+*FF''D-&)T'G
IFVU%%'ZU$W7+T+%%FC&C-&'7IST'&G
IFVU%,'ZU$W7+T+%,F&'(+12TI+NSG
IFVU.$'ZU$W7+T+.$FITC@G
IFVU.;'ZU$W7+T+.;F<-D'T@G
FG
FC)1C21)T'-)ND-()1ID)T'-1')D-&)DI2SG
U./"VVVVU4-.W-UV.$$$AU%%WW-.WAUV.$$$AU%%WW
IFVU./1TUV.$$$AU%%WW7+T+./
FG
FS)('-S:ST'M-()&SG
U%"U8$$/F&'S'NT-<-+SITI+NG
U."U3$$/F+SITI+NIN7-M+D'G
FG
F&)ID-T+-D'T@G
7$7*$<U.;
FG
F&)M-ING
7%7%473%7*%#VVU4-.W-U./W:-U./@U%%FU*
7/#U./:U./&U./
FG
F@'1IC)1-M+('G
U/"$
5@I1'VU/1TU%,WD+%
I-VU4-.W<U.$
U/"U/A%
'ND%
FG
F&)M-+2TG
#-U./:U./&U./
7%73$#-VVU4-.W-U./W:-U./
FG
F&)ID-T+-S)('D-<-+SITI+NG
7$7*$<U%
FG
F&'ST+&'-+SITI+NIN7-M+D'G
IFVU.'Z*$W7+T+**
7*%
7+T+**
FG
F)1)&M-M'SS)7'SG
7+T+**
N4U/$$$"4FIN()1ID M)P+& DI)= D ()12'G
7+T+**
N*U/$$$"*FIN()1ID F''D &)T'= F ()12'G
7+T+**
N%%U/$$$"%%FIN()1ID &'7IST'&= @ ()12'G
7+T+**
N%,U/$$$"%,FIN()1ID &'(+12TI+NS= & ()12'G
7+T+**
N.$U/$$$".$FIN()1ID ITC@= T ()12'G
7+T+**
N./U/$$$"./FT++1 DI) T+ 1)&7'G
7+T+**
N.;U/$$$".;FIN()1ID D'T@= < ()12'G
FG
F&+7&)M-'NDG
N**M**
=rogrammed &iameter Feed Rate O/&
1hen thread milling7 your linear feed must be con.erted to circular feed
DchmarKe 5ool /o%
('/#(/N+
M% !erry
5op of =age
=rogrammed &iameter Feed Rate >/&
1hen thread milling7 your linear feed must be con.erted to circular feed
DchmarKe 5ool /o%
('/#(/N+
M% !erry
5op of =age
DchmarKe 5ool /o%
&r3% ,o% ("<##)A
M% !erry
5op of =age
DchmarKe 5ool /o%
&r3% ,o% ("<*$)A
M% !erry
5op of =age
>nternal threadmilling macro for FanucO (M controls
!y @elly &% rills7 @&<;ngineering
5his macro 3orks 3ith both single point and multi tooth cutters%
My goal 3as to eliminate the calculations reJuired for our operators to perform thread
milling7 thus pro.iding increased producti.ity%
5he functionality is basically like a drill cycle call 8+#7 +"7 etc:%
'' is 3hat is referred to as a modal macro statementP once in.oked the called
subroutine is e6ecuted at each a6is positioning mo.e follo3ing the in.ocation% >t is
cancelled 3ith a ') 8') is to '' as +( is to +#:%
&o3nload the macro here
The parameters needed by the macro are:
=N(*( the macro's name
& thread maKor radius
I cutter radius
R number of re.olutions of the tool path
For single point tools7 the number of threads to mill
For multi<pitch tools7 normally #
5 thread pitch
9 cut depth 8length of thread:
A typical calling program (1/4-20 Thread, 3/4" deep !o"ld loo# as
$ollo!s:
O#((( 8=rogram ,o%:
*+9( 89 a6is to home7 for safety sake:
(E$N(C(4( 8Rapid to part (:
$"9%#I# 8Apply tool length offset:
M"D#(((F*(% 8Dpindle on7 establish feed rate:
M+ 8/oolant on:
''=N(*(&%*EI%#+)ER#%5%(E9<%)E 8/all our macro7 passing appropriate .ariables:
C*%4( 8A6is location:
C<*% 8A6is location:
C(4*% 8A6is location:
4<*% 8A6is location:
') 8/ancel the macro call:
MN 8/oolant off:
*+9(ME 89 a6is to home7 spindle off:
M"( 8;nd program:
The macro itsel$:
ON(*(
8FA,0/<(M</O,5ROBB;R:
8>,5;R,AB<5IR;A&<M>BB>,:
8/ABB;&<AD<FOBBO1D:
8''=N(*(&%*EI%#+)ER#%5%(E9<%)E:
8&<MAQOR<5IR;A&<RA&:
8I</055;R<RA&:
8R<R;?OB05>O,D:
85<5IR;A&<=>5/I:
89</05<&;=5I:
8:
8?AB>&A5;<>,=05:
>FRS);TS(UO5O)8MAQOR<5IR;A&<RA&:
FRS##;TS(UO5O##8/055;R<RA&:
>FRS#+;TS(UO5O#+8R;?OB05>O,D:
>FRS*(;TS(UO5O*(85IR;A&<=>5/I:
>FRS*';TS(UO5O*'8/05<&;=5I:
8:
8/AB/0BA5;<A,&<?AB>&A5;<B;A&<RA&>0D:
S*"ARS)<RRS)<S##U/*UU
>FRS*"B5S##UO5O*"
8:
8DA?;<D4D5;M<?ARD:
S#ASE(("8=R;D;,5<9<=OD>5>O,:
S*AS$(("8=OD>5>O,>,<MO&;:
8:
8RA=>&<5O<&;=5I:
(N(9S*'
8:
8RAM=<>,:
"N#CRRS*"<S##UV*U4(>RS*"<S##UQ(
8:
8I;B>/AB<MO?;:
S"A(
1I>B;RS"B5S#+U&O#
"N#C(4(><S)Q(9S*(
S"AS"W#
;,&#
8:
8RAM=<O05:
"N#C<RRS*"<S##UV*U4(><RS*"<S##UQ(
8:
8RA=>&<5O<DA?;&<9<=OD>5>O,:
(N(9S#
8:
8R;D5OR;<=OD>5>O,>,<MO&;:
>FRS*;TN(UO5ONN
N#
O5ONN
8:
8ABARM<M;DDA;D:
O5ONN
,)S"(((A)8>,?AB>& MAQOR RA&7 & ?AB0;:
O5ONN
,##S"(((A##8>,?AB>& /055;R RA&7 I ?AB0;:
O5ONN
,#+S"(((A#+8>,?AB>& R;?OB05>O,D7 R ?AB0;:
O5ONN
,*(S"(((A*(8>,?AB>& =>5/I7 5 ?AB0;:
O5ONN
,*"S"(((A*"85OOB &>A 5O BAR;:
O5ONN
,*'S"(((A*'8>,?AB>& &;=5I7 9 ?AB0;:
8:
8=RORAM<;,&:
,NNMNN
If you need to dis-lay a multiline message you can do it by adding a control return
line feed at the end of each line of te*t. $ecause there is an icon in the message bo*
you can centre the te*t within the message bo* by adding a buffer to the end of the
first line of te*t as shown below.
code2
I -- Start Scri0t
Call MainFG
I --------------------
I Sub Declaration
I --------------------
Sub MainFG
Const D'FLC'NT&'LMS7 " E E

Dim strMulti1ineTeQt
strMulti1ineTeQt " EThis is on the first %stE R D'FLC'NT&'LMS7 R JbCr1f
R L
EThis is on the first .ndE R JbCr1f R L
EThis is on the first /rdE R JbCr1f R L
EThis is on the first 3thE
ShowString strMulti1ineTeQt
'nd Sub
Define a constant for the action you want to do>
code2
Const D'FLC&')T'L&'CL.L+INTS " Erec.0tsE

Call &unMastercamCommandFD'FLC&')T'L&'CL.L+INTSG
!ere3s a list of the actions. %ll menu items are available via ($'.
code2

II*$$%. E9oom! Screen-<oomE
II*$$.. Eun9oom! Screen-2n9oomE
II*$$/. Ere0aint! Screen-&e0aintE
II*$$3. Eanaly9e! )naly9eE
II*$$8. Edelete! DeleteE
II*$$;. Efile! FileE
II*$$4. Emodify! ModifyE
II*$$,. Ecreate! CreateE
II*$$*. Edis0info! Screen-Dis0lay infoE
II*$%$. Ehel0! @el0E
II*$%%. Efit! Screen-FitE
II*$%.. Eun9oom,! Screen-2n9oom by $.,E
II*$%/. Ecur0os! Cursor Trac6ing FToggleGE
II*$%3. Edelwndw! Delete-5indowE
II*$%8. Eeditfile! File-'ditE
II*$%;. Eblan6! Screen-?lan6E
II*$%4. Econfig! Screen-ConfigureE
II*$%,. EdrwaQes! Screen-Draw aQesE
II*$%*. Erundll! 'Qecute C-@oo6E
II*$.$. Edraft0m! Draft-7lobalsE
II*$.%. Efont! Menu FontE
II*$... EE
II*$./. Emmalloc! 1ist MemoryE
II*$.3. Emfile! 1ist FilesE
II*$.8. Eundo! 2ndoE
II*$.;. Esurfdis0! Screen-Surf Dis0E
II*$.4. Edrawnc! Screen-Draw Tool0athE
II*$.,. EJw0orts! Screen-(iew0ortsE
II*$.*. EJersion! (ersionE
II*$/$. EQform! #formE
II*$/%. EautosaJe! File-)utoSaJeE
II*$/.. Egrou0! 7rou0sE
II*$//. Echgcolrs! Screen-Change ColorsE
II*$/3. EchgleJs! Screen-Change 1eJelsE
II*$/8. Eautocl! )utomatic CenterlinesE
II*$/;. Ecolor! Main ColorE
II*$/4. EleJel! 1eJels-MainE
II*$/,. Emas6! 1eJels-Mas6E
II*$/*. Et0lane! T0laneE
II*$3$. Ec0lane! C0laneE
II*$3%. EgJiew! 7JiewE
II*$3.. E9de0th! C0lane-De0thE
II*$3/. EleJdlg! 1eJels-DialogE
II*$33. EJisleJ! 1eJels-(isibleE
II*$38. Etoolbar! Toolbar (isible FToggleGE
II*$3;. Edbstats! Screen-StatisticsE
II*$34. Eend0ts! Screen-'nd0ointsE
II*$3,. Eclrcolrs! Screen-Clear ColorsE
II*$3*. Eshade! Screen-Surf Dis0-ShadingE
II*$8$. Ecr0oint! Create-ointE
II*$8%. Ecr0t0os! Create-oint-ositionE
II*$8.. E0talong! Create-oint-)long 'ntityE
II*$8/. Enode0ts! Create-oint-Node ointsE
II*$83. Ectrl0ts! Create-oint-C0ts N2&?SE
II*$88. E0tdynmic! Create-oint-DynamicE
II*$8;. Ecr0tlen! Create-oint-1engthE
II*$84. E0tsrf0rN! Create-oint-Surface roNectE
II*$8,. Ecrline! Create-1ineE
II*$8*. Eclhor9! Create-1ine-@ori9ontalE
II*$;$. EclJert! Create-1ine-(erticalE
II*$;%. Ecle0ts! Create-1ine-'nd0ointsE
II*$;.. Eclmulti! Create-1ine-MultiE
II*$;/. Ecl0olar! Create-1ine-olarE
II*$;3. Ecltan! Create-1ine-TangentE
II*$;8. Ecltanang! Create-1ine-Tangent-)ngleE
II*$;;. Ecltan.a! Create-1ine-Tangent-. )rcsE
II*$;4. Ecltan0t! Create-1ine-Tangent-ointE
II*$;,. Ecl0er0! Create-1ine-er0endicularE
II*$;*. Ecl0aral! Create-1ine-arallelE
II*$4$. Ecrarc! Create-)rcE
II*$4%. Eca0olar! Create-)rc-olarE
II*$4.. Ecactr0t! Create-)rc-olar-Center ointE
II*$4/. Ecas6tch! Create-)rc-olar-S6etchE
II*$43. Ecastart! Create-)rc-olar-Start ointE
II*$48. Ecaend! Create-)rc-olar-'nd ointE
II*$4;. Ecae0ts! Create-)rc-'nd0ointsE
II*$44. Eca/0ts! Create-)rc-/ 0ointsE
II*$4,. Ecatan! Create-)rc-TangentE
II*$4*. Ecatan%! Create-)rc-Tangent-% 'ntityE
II*$,$. Ecatan/! Create-)rc-Tangent-/ 'ntitiesE
II*$,%. Ecatan0t! Create-)rc-Tangent-ointE
II*$,.. Eca.0tcir! Create-Circle-. ointsE
II*$,/. Eca/0tcir! Create-Circle-/ ointsE
II*$,3. Eca0trad! Create-Circle-oint-&adiusE
II*$,8. Eca0tdia! Create-Circle-oint-DiameterE
II*$,;. Eca0tedge! Create-Circle-oint-'dgeE
II*$,4. Ecrfillet! Create-FilletE
II*$,,. Ecrs0line! Create-S0lineE
II*$,*. EcrcurJe! Create-CurJeE
II*$*$. Eelli0se! Create-'lli0seE
II*$*%. Eccconst! Create-CurJe-Const arameterE
II*$*.. Eccedge! Create-CurJe-+ne 'dgeE
II*$*/. Eccinter! Create-CurJe-IntersectE
II*$*3. Ecc0atch! Create-CurJe-atch ?oundariesE
II*$*8. Eccflow! Create-CurJe-FlowlineE
II*$*;. Ecc0roN! Create-CurJe-roNectE
II*$*4. Eccdynmic! Create-CurJe-DynamicE
II*$*,. Ecc0art! Create-CurJe-arting 1ineE
II*$**. Ecrsurf! Create-SurfaceE
II*%$$. Ecsloft! Create-Surface-1oftE
II*%$%. Ecscoons! Create-Surface-CoonsE
II*%$.. Ecsruled! Create-Surface-&uledE
II*%$/. EcsreJ! Create-Surface-&eJolJedE
II*%$3. Ecsswe0t! Create-Surface-Swe0tE
II*%$8. Ecsdraft! Create-Surface-DraftE
II*%$;. Ecsfillet! Create-Surface-FilletE
II*%$4. Ecsofst! Create-Surface-+ffsetE
II*%$,. Ecstrim! Create-Surface-TrimE
II*%$*. Ecsblend! Create-Surface-. Surface ?lendE
II*%%$. Ecrrec! Create-&ectangleE
II*%%%. Erec%0t! Create-&ectangle-% ointE
II*%%.. Erec.0ts! Create-&ectangle-. ointsE
II*%%/. Ecrdraft! Create-DraftingE
II*%%3. Ecddim! Create-Drafting-DimensionE
II*%%8. Ecrnote! Create-Drafting-NoteE
II*%%;. Ecrlabel! Create-Drafting-1abelE
II*%%4. Ecrleader! Create-Drafting-1eaderE
II*%%,. Ecrwit! Create-Drafting-5itness 1ineE
II*%%*. Eeddraft! Create-Drafting-Multi editE
II*%.$. Ecrhatch! Create-Drafting-@atchE
II*%.%. Echamfer! Create-ChamferE
II*%... Ecrlets! Create-1ettersE
II*%./. E0attern! Create-atternE
II*%.3. Ean90t! )naly9e-ointE
II*%.8. Ean9only! )naly9e-+nlyE
II*%.;. Ean9b0ts! )naly9e-?etween 0ointsE
II*%.4. Ean9ang! )naly9e-)ngleE
II*%.,. Ean9dynm! )naly9e-DynamicE
II*%.*. Ean9area! )naly9e-)rea CalculationsE
II*%/$. Eeamod! 'ntity )ttributes F)00lyGE
II*%/%. Ean9scurJ! )naly9e-Surfaces-CurJatureE
II*%/.. Ean9norm! )naly9e-Surfaces-Test NormalsE
II*%//. Ean9base! )naly9e-Surfaces-?ase SurfsE
II*%/3. Edelchain! Delete-ChainE
II*%/8. Edeldu0! Delete-Du0licateE
II*%/;. Edelonly! Delete-+nlyE
II*%/4. Edelall! Delete-)llE
II*%/,. Edelgr0! Delete-7rou0E
II*%/*. Edelreslt! Delete-&esultE
II*%3$. Ecr0t0er0! Create-oint-er0endicularE
II*%3%. Ecr0tcirc! Create-oint-Small Circles
II*%3.. Eundelete! Delete-2ndeleteE
II*%3/. E E
II*%33. Efilemrg! File-MergeE
II*%38. EfilesaJe! File-SaJeE
II*%3;. Efileget! File-7etE
II*%34. Ehardco0y! File-@ardco0yE
II*%3,. Ebrowse! File-?rowseE
II*%3*. Ecommunic! File-CommunicationsE
II*%8$. EconJert! File-ConJertE
II*%8%. Eascii! File-ConJert-)SCIIE
II*%8.. Ecadl! File-ConJert-C)D1E
II*%8/. EdQf! File-ConJert-D#F F0re-(*GE
II*%83. Eiges! File-ConJert-I7'SE
II*%88. EJda! File-ConJert-(D)E
II*%8;. E E
II*%84. Erenumber! File-&enumberE
II*%8,. E E
II*%8*. Eshell! File-D+S ShellE
II*%;$. EleJelre0! 1eJels-&e0ortE
II*%;%. Etrim! Modify-TrimE
II*%;.. Etrim%! Modify-Trim-% 'ntityE
II*%;/. Etrim.! Modify-Trim-. 'ntitiesE
II*%;3. Etrim/! Modify-Trim-/ 'ntitiesE
II*%;8. Etrim.0t! Modify-Trim-To ointE
II*%;;. Etrimmany! Modify-Trim-ManyE
II*%;4. Eclosearc! Modify-Trim-Close )rcE
II*%;,. EdiJide! Modify-Trim-DiJideE
II*%;*. Ebrea6! Modify-?rea6E
II*%4$. Ebr6arcs! Modify-?rea6-)rcsE
II*%4%. Ebr6many! Modify-?rea6-Many iecesE
II*%4.. Ebr6.0cs! Modify-?rea6-. iecesE
II*%4/. Ebr6len! Modify-?rea6-)t 1engthE
II*%43. Ebr6note! Modify-?rea6-Draft-1ineE
II*%48. Ebr6hatch! Modify-?rea6-@atch-1ineE
II*%4;. Ebr6cdata! Modify-?rea6-Cdata-1ineE
II*%44. ENoin! Modify-PoinE
II*%4,. Emodnorm! Modify-NormalE
II*%4*. Emodnbs! Modify-C0ts N?SE
II*%,$. EQ.nbs! Modify-# to N?SE
II*%,%. EeQtend! Modify-'QtendE
II*%,.. Edrag! Modify-DragE
II*%,/. Escrnctr! Screen-CenterE
II*%,3. Einitscrn! File-NewE
II*%,8. EcombJws! Screen-Combine (iewsE
II*%,;. E0lot! Screen-lotE
II*%,4. EQfmmir! #form-MirrorE
II*%,,. EQfmrot! #form-&otateE
II*%,*. EQfmscale! #form-ScaleE
II*%*$. EQfms[sh! #form-S[uashE
II*%*%. EQfmtrans! #form-TranslateE
II*%*.. EQfmofst! #form-+ffsetE
II*%*/. EQfmoctr! #form-+ffset ContourE
II*%*3. Et0menu! Tool0athsE
II*%*8. Econtour! Tool0aths-ContourE
II*%*;. Edrill! Tool0aths-DrillE
II*%*4. E0oc6et! Tool0aths-oc6etE
II*%*,. Encflow! Tool0aths-FlowlineE
II*%**. Encmsurf! Tool0aths-SurfaceE
II*.$$. Enc0roN! Tool0aths-roNectE
II*.$%. Enctrim! Tool0aths-TrimE
II*.$/. Enccoons! Tool0aths-CoonsE
II*.$3. Encruled! Tool0aths-&uledE
II*.$8. Encswe0t! Tool0aths-Swe0tE
II*.$;. EncreJ! Tool0aths-&eJolutionE
II*.$,. Emanent! Tool0aths-Manual 'ntryE
II*.$*. Enc0oint! Tool0aths-ointE
II*.%8. Efilter! NC 2tils-FilterE
II*.%;. E0stmenu! NC 2tils-ostE
II*.%4. E0stchg! NC 2tils-ost-ChangeE
II*.%,. E0strun! NC 2tils-ost-&unE
II*.%*. E0streJ! NC 2tils-ost-&eJerseE
II*..$. Edeftls! NC 2tils-Define ToolsE
II*..%. Esetsht! NC 2tils-Setu0 SheetE
II*../. EeQefunc! 'Qecute FunctionE
II*..3. E0rom0t! rom0t (isible FToggleGE
II*..8. EgJto0! 7Jiew-To0E
II*..;. EgJfront! 7Jiew-FrontE
II*..4. EgJside! 7Jiew-SideE
II*..,. EgJiso! 7Jiew-IsometricE
II*..*. EgJnum! 7Jiew-NumberE
II*./$. EgJlast! 7Jiew-1astE
II*./%. EgJent! 7Jiew-'ntityE
II*./.. EgJrot! 7Jiew-&otateE
II*.//. EgJmouse! 7Jiew-MouseE
II*./3. EgJdymic! 7Jiew-DynamicE
II*./8. Ec0orgn! C0lane-+riginE
II*./;. Ec0/d! C0lane-/DE
II*./4. Ec0to0! C0lane-To0E
II*./,. Ec0frnt! C0lane-FrontE
II*./*. Ec0side! C0lane-SideE
II*.3$. Ec0num! C0lane-NumberE
II*.3%. Ec0last! C0lane-1astE
II*.3.. Ec0ent! C0lane-'ntityE
II*.3/. Ec0rot! C0lane-&otateE
II*.33. Ec0norm! C0lane-NormalE
II*.38. Ec0mouse! C0lane-MouseE
II*.3;. Ec00Q9! C0lane-#<FAGE
II*.34. Ec0nQ9! C0lane-#<F-GE
II*.3,. Ec00d9! C0lane-D<FAGE
II*.3*. Ec0nd9! C0lane-D<F-GE
II*.8$. Eeamgr! 'ntity )ttributes ManagerE
II*.8%. EeQtsrf! Modify-Surface-'QtendE
II*.8.. Ecli0brd! Screen-To Cli0boardE
II*.8/. Eregen! Screen-&egenerateE
II*.83. EslccrJs! Create-oint-SliceE
II*.88. Eslcsrfs! Create-CurJe-SliceE
II*.8;. Ecatan.! Create-)rc-Tangent-. 'ntitiesE
II*.84. Ecircmill! Tool0aths-Circle MillE
II*.8,. Es0rlhlQ! Create-S0iral-@eliQ
II*.8*. Ecr0tgrid! Create-oint-7ridE
II*.;$. Ecr0tbcir! Create-oint-?olt CircleE
II*.;%. Efillet! Create-Fillet-. 'ntitiesE
II*.;.. Efilletc! Create-Fillet-ChainE
II*.;/. Emc0lay! Macro-laybac6 FToggleGE
II*.;3. Emcrec! Macro-&ecord FToggleGE
II*.;8. Emcsto0! Macro-ause FToggleGE
II*.;;. Ean9snrms! )naly9e-Surfaces-Set NormalsE
II*.;4. Ecr0olyg! Create-olygonE
II*.;,. Ecl0r00t! Create-1ine-er0endicular-tE
II*.;*. Ecl0r0ar! Create-1ine-er0endicular-)rcE
II*.4$. Ecl0lldst! Create-1ine-arallel-Dist-SideE
II*.4%. Ecl0ll0t! Create-1ine-arallel-ointE
II*.4.. Ecl0llar! Create-1ine-arallel-)rcE
II*.4/. Eclbisect! Create-1ine-?isectE
II*.43. Ecatancl! Create-)rc-Tangent-Center 1ineE
II*.48. Eundelent! Delete-2ndelete-SingleE
II*.4;. Ehide! @ideE
II*.44. Egrid0rms! Screen-7ridE
II*.4,. Ecatadyn! Create-)rc-Tangent-DynamicE
II*.4*. EramsaJer! File-&)MsaJerE
II*.,$. Echgattrs! Screen-Change )ttributesE
II*.,%. ENobsetu0! Tool0aths-Pob Setu0E
II*.,.. Eo0list! Tool0aths-+0erations ManagerE
II*.,/. EnamJiew! 5CS - (iew ManagerE
II*.,3. EcnJ.arcs! Modify-ConJert to )rcsE
II*.,8. Eccedges! Create-CurJe-)ll 'dgesE
II*.,;. Estudio! Screen-Surf Dis0-StudioE
II*.,4. Eclclose! Create-1ine-ClosestE
II*.,,. Eautocur! )utoCursor FToggleGE
II*.,*. Eshadetog! Fulltime Shading FToggleGE
II*.*$. E[uito0! Delete-1ast +0erationE
II*.*%. Eeditlast! Modify-1ast +0erationE
II*.*.. Egrnamed! 7Jiew-NamedE
II*.*/. Ec0named! C0lane-NamedE
II*.*3. Et0named! T0lane-NamedE
II*.*8. EmultiaQ! Tool0aths-Multi)QisE
II*.*;. EcurJe8aQ! Tool0aths-CurJe 8 )QisE
II*.*4. Edrill8aQ! Tool0aths-Drill 8 )QisE
II*.*,. Eswarf8aQ! Tool0aths-Swarf 8 )Qis FloorE
II*.**. Eflow8aQ! Tool0aths-Flow 8 )QisE
II*/$$. Erotary3Q! Tool0aths-&otary 3 )QisE
II*/$%. Egrnormal! 7Jiew-NormalE
II*/$.. Egre[c0ln! 7Jiew-'[uals C0laneE
II*/$/. Egre[t0ln! 7Jiew-'[uals T0laneE
II*/$3. Eautodes6! File-ConJert-)utoDes6E
II*/$;. Edfregen! Draft-&egenerate-)llE
II*/$4. Edfrgsel! Draft-&egenerate-SelectedE
II*/$,. Edfrgaut! Draft-&egenerate-)uto FToggleGE
II*/$*. Ecrdmh9! Create-Dimension-@ori9ontalE
II*/%$. EcrdmJt! Create-Dimension-(erticalE
II*/%%. Ecrdm0ll! Create-Dimension-arallelE
II*/%.. Ecrdman! Create-Dimension-)ngularE
II*/%/. Ecrdmdia! Create-Dimension-CircularE
II*/%8. Ecrdmbsln! Create-Dimension-?aselineE
II*/%;. Ecrdmchn! Create-Dimension-ChaE
II*/84. Ean9c6sld! )naly9e-Surfaces-Chec6 SolidE
II*/8,. EQfmstrch! #form-StretchE
II*/8*. EQfmroll! #form-&ollE
II*/;$. EsldeQt! Solids-'QtrudeE
II*/;%. EsldreJ! Solids-&eJolJeE
II*/;.. Esldswee0! Solids-Swee0E
II*/;/. Esldloft! Solids-1oftE
II*/;3. Esldflt! Solids-FilletE
II*/;8. Esldchmfr! Solids-ChamferE
II*/;;. Esldshell! Solids-ShellE
II*/;4. Esldbool! Solids-?ooleanE
II*/;,. Esld0rim! Solids-rimitiJeE
II*/;*. Eslddrfac! Solids-Draft faceE
II*/4$. Esldtrim! Solids-TrimE
II*/4%. Esldlayot! Solids-1ayoutE
II*/4.. Esldfeat! Solids-Find featuresE
II*/4/. Esldthic6! Solids-Thic6enE
II*/43. Esldrmfac! Solids-&emoJe facesE
inedE
II*/%4. Ecrdmord! Create-Dimension-+rdinateE
II*/%,. Ecrdm0t! Create-Dimension-ointE
II*/%*. EdfJdate! Draft-&egenerate-(alidateE
II*/.$. Esldhist! Create-Solids-@istoryE
II*/.%. Esldma6e! Create-SolidsE
II*/... Ehidemore! @ide-@ide MoreE
II*/./. Eunhdsome! @ide-2nhide SomeE
II*/.3. Ema6ebboQ! Create-?ounding ?oQE
II*/.8. Esetmain! 1eJels-Main Ffrom entityGE
II*/.;. EgJbottom! 7Jiew-?ottomE
II*/.4. EgJbac6! 7Jiew-?ac6E
II*/.,. EgJleft! 7Jiew-1eftE
II*/8$. EgJdy0an! 7Jiew-Dynamic anE
II*/8%. EgJdy9um! 7Jiew-Dynamic <oomE
II*/8.. Eattribs! )ttributesE
II*/8/. Ean9numbr! )naly9e-NumberE
II*/83. Ean9chain! )naly9e-ChainE
II*/88. Ean9c6mdl! )naly9e-Surfaces-Chec6 ModelE
II*/8;. Ean9small! )naly9e-Surfaces-Small Surfs

You might also like