I'm looking for a simple way to check to see if
there is any T1 geometry in a .pm4 file while
leaving the selected geometry in place.

Filtering works fine but the problem with this macro
is that you're suppose to pick a number of hole(s)
in the order that you want them skimmed out to
before running the macro.

Below is the macro.

// Advanced_Wedm 11.5 Windows 10/16/98 16:48:10 Macro File
// w:\mcl\3CN12NS.mcl
// CREATED: 05/29/01
//  
// Three Cut Number 1 & 2 No Stop macro
//
// Purpose: This SHIM macro takes a selected number of hole(s) and 
//          makes a 3 skim pass on that hole with T1.
// 1) Pass One   = D01 T01 P16 S01 = 1st pass
// 2) Pass Two   = D02 T02 P16 S02 = 2nd pass
// 3) Pass Three = D03 T03 P16 S03 = 3rd pass
//
// Instructions:
// 1) F2 unselect all geometry
// 2) Select the hole(s) in the order that you want the cut and run the
macro
//
//PAUSE[TX="The so far so good macro pause!", LR=10, LC=5, SR=2, SC=40,
PT=1]
VAR_REMOVE_ALL[]

PAUSE[TX="Have you saved the file yet?\n
   NOTE: Agie No.1 can only read approx 300\n
                lines of code before the memory is full.", PT=1]

<-------------------------------- add T1 geomtry check here
*********************************************************

GRAPHICS_Off[]

FILTER_USE[ON=0]// turn filter off

//---------- insert before last point in data base and name it INSERT
JTOOL_SEQ[BA=1, TL=1, ME=0]
ELMT_SEQ[BA=1, EL="seqel()-1", ME=0]
NAME_ELMT[EL="seqel()", EN="insert"]

WHILE( GRP(0)<=0)
 PAUSE[TX="ERROR: You have not selected any geometry!", PT=1] 
// If no geometry is selected this loop loops continuously until you select
cancel
GRAPHICS_ON[]
ENDW

// Set sequence at end of database
ELMT_SEQ[BA=1, EL="totel()", ME=0]

// Move selected elements to end of database in the order they were picked
SEQ_MOVE[SC=1]

// Get first element in group
#Start=GRP(1)

// Get number of elements in group
#No_Elmt=GRP(0)

// Get last element in database
#End=totel()

STRING:#Name
INTEGER:#Count
INTEGER:#Next

//Keep count of # of profiles
#Count=1

WHILE(#Start<=#End)

     PROF_GRP[AR=0, EL=#Start]

     //Name element
     NAME_ELMT[EL=#Start, EN=STRTMP("E%Count") ]

     //NEW_GRP[]

     #Start=#Start+1

     #Count=#Count+1

ENDW

REDRAW[]

//----- insert E1,E2... group before INSERT element
ELMT_SEQ[BA=1, EL="insert", ME=0]
SEQ_MOVE[SC=0]
NEW_GRP[]

//----------------------------- Loop for adding cutoffs for E1,E2,E3 etc
-------------------

#Count=1
STRING:#Prof // this is the name for E1, E2, E3 etc

WHILE(#Count<=#No_Elmt)

  #Prof=STRTMP("E%Count") 
  // set to E1 for 1st 4 cut hole, E2 for 2nd 4 cut hole  etc

ELMT_SEQ[BA=1, EL="#Prof", ME=0]

WITH_STEP[ST=1, WP="XY_PLANE", OF=0, LV=0, CL=?, PT=?]// offset Left T1
// arc from 0 to -20 degrees
ARC[DR=1, XC=cex(#Prof), YC=cey(#Prof), RA=rad(#Prof), AS=0, AE=-20, SE=2,
SS=2, SI=2, SC=2, LV=0]

UEVENT[XS=ENX(SEQEL()), YS=ENY(SEQEL()), LV=0, TX="@NOSTOP"]
// arc after glue stop from -20 to 0 degrees
ARC[DR=1, XC=CEX(#Prof), YC=CEY(#Prof), RA=RAD(#Prof), AS=-20, AE=0, SE=2,
SS=2, SI=2, SC=2, LV=0]

LEAD_IN[EL="SEQEL()", AN=90, DS=RAD(#Prof), LC=2, TY=0, CS=0, RP=0, MO=0]

ELMT_SEQ[BA=1, EL="#Prof", ME=0]
WITH_STEP[ST=1, WP="XY_PLANE", OF=2, LV=0, CL=?, PT=?]
POINT[XE=CEX(#Prof), YE=CEY(#Prof), LV=0, CO=0, SE=2]
UEVENT[XS=ENX(SEQEL()), YS=ENY(SEQEL()), LV=0, TX="#DOFF=1,#TOOL=1"]


ELMT_GRP[AR=0, EL="seqel()-1"]// select point
ELMT_GRP[AR=0, EL="seqel()"]// select user_cmd
PROF_GRP[AR=0, EL="seqel()+1"]// select profile

PROF_SEQ[BA=1, EL="seqel()+1", ME=0]// insert at end of 1st skim pass to
copy next 2 skim passes
// copy profile twice for three passes in total
MOVE[CP=1, NC=2, TS=0, XS=0, YS=0, XE=0, YE=0]

NEW_GRP[]

PROF_SEQ[BA=0, EL="SEQEL()", ME=0]
ELMT_SEQ[BA=0, EL="SEQEL()", ME=0]
MOD_UEVENT[EL=SEQEL()-1, XS2=ENX(SEQEL()-1), YS2=ENY(SEQEL()-1),
TX="#DOFF=3,#TOOL=2", LV=0]

PROF_SEQ[BA=0, EL="SEQEL()-3", ME=0]
MOD_UEVENT[EL=SEQEL()-1, XS2=ENX(SEQEL()-1), YS2=ENY(SEQEL()-1),
TX="#DOFF=2,#TOOL=1", LV=0]

MAC_EXE[FN="C:\\mcl\\u.mcl"]//F2

  #Count=#Count+1

ENDW

//-------------- Clear names using loop -------------------
#Count=1
WHILE(#Count<=#No_Elmt)

 CL_NAME_ELMT[EL=STRTMP("E%Count")]
 #Count=#Count+1

ENDW
CL_NAME_ELMT[EL=STRTMP("Insert")]

//--------------- change Clear_Z and Prof_Top to off for T1
TOOL_GRP[AR=0, TL="1"]
PCHG_ST[CN=0, PN=0, OF=3]
NEW_GRP[]

//--------------- sequence T1 after 0
ELMT_SEQ[BA=1, EL="TOTEL()-TOTEL()", ME=1]
// insert before 0 unsing the totel macro commenad
STEP_GRP[AR=0, ST="1"]// select T1
SEQ_MOVE[SC=1]// move T1 before 0
NEW_GRP[]
ELMT_SEQ[BA=1, EL="0", ME=1]

GRAPHICS_ON[]

Thanks in advance for any ideas

Regards,
Michael Senack
 <<3CN12NS.MCL>> 

Attachment: 3CN12NS.MCL
Description: Binary data

Reply via email to