Macro to Cut Thick Sections

  • This macro cuts thick sections from a solid.

     written by Naomi
'Cutoff-DELZYX.d3m 10 AUG 2001 reworked
18 AUUG - 7 SEP 2004
CLEAR 'clear variable memory
Sys(996) = 0 'ESC to Exit
sys(999) = 0 'ESC to Exit
SYS$(42) = "" 'WINDOW title off
SYS$(41) = "" 'INPUT title off
Window 22, 40
Color 0,1 'white,black
cls
Print "Multi-CUTOFF-deleteZYX"
Print " Makes Thick SECTIONs for
3D SOLIDS"
Print
Print " Default input:"
Print" 5 SECTIONS"
Print " +1.00 unit Spacing center
to center"
Print " (use (-) Spacing to
progress negatively)"
Print " 0.10 unit SECTION
thickness."
Print " 1 X-axis Y-Z cutting
box."
Print " ROTATE - Model for Custom like
angles."
Print " ESC key - Exit this Macro
process any time."
Print " UNDO - step backward thru final
drawing."
Print " DIMENSION - verify Section
locations!"
Print
Print " Select Start Point along the
+axis or -axis,"
Print " SECTIONS are cut perpendicular
along axis."
Print " A Box (100x100xthickness) cuts
Sections."
Print " Use the cursor or PointXYZ (:)
to set Start."
Print " Drawn on Current Drawing Layer."
Print " After Sections are drawn:"
Print " Explode Solid, Select the
Sections,"
Print " Copy and Paste to a new
Layer."
Print
Print " Press ANYKEY to
continue"
Anykey
WCLOSE
'Variable Listing==============
' Default parameters
Nsctn = 5 'Number of sections
SPA = 1.00 'Center to center spacing of
sections
Thck = 0.1 'Section thickness
Naxis=1
Aa$ = "THICKNESS is < ZERO, re-enter
THICKNESS Greater Than Zero!"
Bb$ = "SECTIONS will progress in NEGATIVE
direction from START POINT! Choose the
START POINT carefully along
#",Naxis,"-axis."
Cc$ = "THICKNESS ",Thck,">= ",SPA,"
|SPACING|, re-enter THICKNESS!"
RETRY1:
Input "How many SECTIONS (default
5)?",Nsctn
If Nsctn <= 0.00 or Nsctn > 100.00 then
goto RETRY1
RETRY2:
Input "What CENTER to CENTER SPACING of
sections (default 1.00)?",SPA
If SPA < -99999 or SPA > 99999 then
goto RETRY2
RETRY3:
Input "What THICKNESS of
Sections(default 0.1)?",Thck
If Thck < 0 then Message Aa$
If Thck < 0 then goto RETRY3
If ABS(Thck) >= ABS(SPA) then Message
Cc$
If ABS(Thck) >= ABS(SPA) then goto
RETRY3
RETRY4:
Input "Which AXIS (default X-axis)
1=X-axis 2=Y-axis 3=Z-axis?",Naxis
If Naxis < 1 or Naxis > 3 then goto
RETRY4
If SPA < 0 then Message Bb$
>SetStartPoint
{
}
Sys(36) = 1 'Use silent mode to speed up
drawing operations
Sys(49) = 1 'disable cursor
For N = 0 to Nsctn
Psctn1 = (N * SPA) + Thck
Psctn2 = (Psctn1 + SPA - Thck)
If SPA < 0 then Psctn1 = (N * SPA) -
Thck
If SPA < 0 then Psctn2 = (Psctn1 + SPA
+ Thck)
>CutoffDel
{
If Naxis=1 then <PointXYZ
[Psctn1],-50.0000,-50.0000
If Naxis=1 then <PointXYZ
[Psctn2],50.0000,50.0000
If Naxis=2 then <PointXYZ
-50.0000,[Psctn1],-50.0000
If Naxis=2 then <PointXYZ
50.0000,[Psctn2],50.0000
If Naxis=3 then <PointXYZ
-50.0000,-50.0000,[Psctn1]
If Naxis=3 then <PointXYZ
50.0000,50.0000,[Psctn2]
<SelectOnly 0
}
Next N
>FitToAllWindow
{
}
Sys(36) = 0 'silent mode off
Sys(49) = 0 'enable cursor
CLEAR
END

File to Download:

Cutoff-DELZYX.zip