Another problem we have had with flat pattern translations is that, on occassion, the geometry will have 3D points. That is, some of the points have a Z component. This would cause our burn table to dwell for an instant and over burn at the point where is dwelled. To deal with that problem, I created this macro to set all points to Z0.
By the way the @DESSTART and @DESEND labels are things I added to
work with a visual basis program I wrote to keep an inventory of all the macros
and code generators.
David
************
@DESSTART
// Macro Name : ZSAME.MCL Author: David Hayden
Date Put Into Service: 01/08/97
// Description:
// This macro was created to to be used with Advanced Fabrication. When
unfolding some geometry
// using revision 4x the software occassionally does not put all the points at
Z0. This creates a
// problem when there is an arc involved because the I,J,K vectors are
calculated three dimensionally
// and in the t2o dimensional world of the burn table this creates a mismatch
between the end point
// of the arc and the end point of the IJK vector. The machine makes a
correction that leaves a straight
// line on the part that has to be ground out. This macro captures all Z
locations for the tools and mod-
// them to equal Z0.
@DESEND
AUTO_ANSWER[AA="YES"] // answers all yes now prompts to yes
MASK[LY="*", SH=0] // masks all the layers leaving only tools visible
FULL[] // fits part to screen
SELECT_ALL[] // Groups all the visible tool elements
#GrpNum=GRP(0) // Creates the variable "GrpNum" and sets it equal to GRP(0)
// The function GRP() returns the database number
for an element in a group
// so if elements 35-40 were grouped and
#GrpNum(2) was the command
// the function would return the value 36 since
elment 36 is the second element
// in the group. When GRP(0) is commanded it
returns an integer that is equal
// to the number of elements in the group. In
the example where elements 35-40
// are grouped GRP(0) would return six since
there are six elements in the group.
// the following loop looks for vertical lines and removes them.
#counter=1 //initializes counter to equal 1
WHILE(#Counter <= #GrpNum) //do the following while counter is <= the number of
elements in the group
IF(STX(GRP(#Counter))=ENX(GRP(#Counter)) ,AND
STY(GRP(#Counter))=ENY(GRP(#Counter)))
DELETE[EL=GRP(#Counter)]
#GrpNum=#GrpNum-1// since elements deleted counter needs incremented
ENDIF
#Counter=#Counter+1
ENDW
PAUSE[TX="Vertical lines have been removed, continuing on", PT=2]
GRP_CHAIN[PJ=0]
PAUSE[TX="Group has been re-chained, continuing on", PT=2]
// The following moves start and end points to Z0
#counter=1 //initializes counter to equal 1
WHILE(#Counter <= #GrpNum) //do the following while counter is <= the number of
elements in the group
IF(TYP(GRP(#Counter))=1) // If element is a point, modify Z to Z=0 leave x,y
same
MOD_POINT[EL=GRP(#Counter), XE=ENX(GRP(#Counter)), YE=ENY(GRP(#Counter)),
LV=0, SE=2]
ENDIF
IF(TYP(GRP(#Counter))=2) // If element is a line, modify z locations to Z=0
leave Xs,Ys unchanged
MOD_LINE[EL=GRP(#Counter), XS=STX(GRP(#Counter)), YS=STY(GRP(#Counter)),
ZS=0,
XE=ENX(GRP(#Counter)), YE=ENY(GRP(#Counter)), ZE=0, ZI=0,
SE=2, SS=2]
ENDIF
IF(TYP(GRP(#Counter))=3) // If element is an arc, modify z locations to Z=0
leave Xs,Ys unchanged
MOD_ARC[EL=GRP(#Counter), DR=DIR(GRP(#Counter)), XC=CEX(GRP(#Counter)),
YC=CEY(GRP(#Counter)),
XS=STX(GRP(#Counter)), YS=STY(GRP(#Counter)),
XE=ENX(GRP(#Counter)),
YE=ENY(GRP(#Counter)), RA=RAD(GRP(#Counter)), LV=0]
ENDIF
IF(TYP(GRP(#Counter))=10) // If element is a polyline
#GrpVar=GRP(#Counter) // captures the element number of the polyline
#ToolNum=TOOL(#GrpVar) //captures current tool number
NEW_GRP[] // clears group contents
ELMT_GRP[AR=0, EL=#GrpVar] //creates a new group only containing the
polyline
PCHG_LY[LY=93, LV=0, PN=2] //moves polyline elements to layer 93 and
sets z levels to 0
PCHG_ST[TL=#ToolNum, LV=0, CN=2, PN=2, OF=3] //converts back to tool
geometry w/level of 0
REDRAW[]
ENDIF
#Counter=#Counter +1 // increments counter by one every time it loops
ENDW // End of the while loop
NEW_GRP[]
FULL[]
AUTO_ANSWER[AA="NO"] // answers all yes now prompts back to NO
"Dave Hayden" <[EMAIL PROTECTED]> on 01/29/2001 08:09:43 AM
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED] (bcc: Dave Hayden/elliott)
Subject: Re: [mfg-smartcam] dxf & or iges files
[EMAIL PROTECTED] on 01/26/2001 04:55:23 PM
To: [EMAIL PROTECTED]
cc: (bcc: Dave Hayden/elliott)
Subject: [mfg-smartcam] dxf & or iges files
Does anybody else have problems with broken lines in flat pattern translated
files?
Often when using provided electronic data to make customer parts the lines
adjacent to scallops and radii dont meet by a few tenths and will not chain.
To drive a tool around perimeter a lot of time is used to connect the lines.
Does anybody know of a software or method that will make this process less of
a task?
any input would be greatly appreiatiated
Does anybody else have problems with broken lines in flat pattern translated
files?
Often when using provided electronic data to make customer parts the lines
adjacent to scallops and radii dont meet by a few tenths and will not chain.
To drive a tool around perimeter a lot of time is used to connect the lines.
Does anybody know of a software or method that will make this process less of
a task?
any input would be greatly appreiatiated
