Macro to Draw Multiple Contour Lines

  • This macro makes multiple evenly spaced contour lines.

     written by Naomi
'ContourXYZ.d3m 26 AUG 2004
CLEAR 'clear variable memory
Sys(996) = 0 'ESC to Exit
sys(999) = 0 'ESC to Exit
Nlay1=SYS(3) 'Lookup Current LAYER
Nred = SYS(300) 'Current color RED
Nblu = SYS(301) 'Current color BLUE
Ngrn = SYS(302) 'Current color GREEN
SYS$(42) = "" 'WINDOW title off
SYS$(41) = "" 'INPUT title off
Window 26,38
Color 0,1 'white,black
cls
Print " Multi-ContourXYZ LINE Maker -
2D or 3D"
Print
Print " CROSS SECTIONS are planes (Type
1);"
Print " CONTOUR LINES are vectors (Type
0),"
Print " perpendicular to X-axis
(Y-Z plane)"
Print " or perpendicular to Y-axis (X-Z
plane)"
Print " or perpendicular to Z-axis (X-Y
plane)"
Print " progressing along + or -
axis direction."
Print " to progress negatively, Input
(-) Spacing."
Print " on LAYER 6,7, or 8 Line
Color: RED"
Print
Print " Set Type 0 (Vectors) in the
macro, or"
Print " Group Explode Planes to make
Contours."
Print
Print " Default: 5 Contour Lines"
Print " +1.00 unit Spacing
between Contours"
Print " X-axis, LAYER 6"
Print " ROTATE - position Model, Custom
like angle."
Print " ESC key - Exit this Macro
process any time."
Print " UNDO - step backward thru final
drawing."
Print " DIMENSION - verify Contour
locations."
Print " Contours on Faceplanes display
Stray Lines."
Print
Print " Select Start Point: first
contour's position,"
Print " along the axis for the
cutting plane."
Print " Use the Cursor or
PointXYZ (:) to set."
Print
Print " Press ANYKEY to
continue"
Anykey

'Variable Listing==============
' If no input use these parameters
Ncontr = 5.00 'Number of Contour Lines
SPA = 1.00 'Spacing of Contours
Naxis = 1
Nlay = 6
RETRY1:
Input "How many Contour Lines (default
5)?",Ncontr
If Ncontr <= 0.00 or Ncontr > 100.00
then goto RETRY1
RETRY2:
Input "What SPACING for Contour Lines
(default +1.00 units)?",SPA
If SPA < -99999 or SPA > 99999 then
goto RETRY2
RETRY3:
Input "Which AXIS to cut along, (default
X-axis), 1=X, 2=Y, 3=Z?",Naxis
If Naxis <= 0.00 or Naxis > 3 then goto
RETRY3
>SetStartPoint
{
}
Sys(36) = 1 'Use silent mode to speed up
drawing operations
Sys(49) = 1 'Disable Cursor
If Naxis = 1 then Nlay = 6
If Naxis = 2 then Nlay = 7
If Naxis = 3 then Nlay = 8

For N = 0 to Ncontr - 1
Pcontr = (N * SPA)
>ContourLine
{
<Color 255,0,0
<Layer [Nlay]
<LineStyle 0,2.0000,0.0000
If Naxis=1 then <PointXYZ
[Pcontr],0.0000,0.0000
If Naxis=2 then <PointXYZ
0.0000,[Pcontr],0.0000
If Naxis=3 then <PointXYZ
0.0000,0.0000,[Pcontr]
<SelectOnly 0 '0=entire drawing
1=selection only
<Axis [Naxis] '1=X-axis (Y-Z cutting
plane)
<Type 1 '0=vector 1=plane
}
Next N
>FitToAllWindow
{
}
SYS(3)=Nlay1
SYS(300)=Nred 'restore RED
SYS(301)=Nblu 'restore BLUE
SYS(302)=Ngrn 'restore GREEN
Sys(36) = 0 'silent mode off
Sys(49) = 0 'enable Cursor
CLEAR
END

'NOTE
' Associated ICON.bmp (not included) is
24 x 24 pixels @ 24 bit color, 2K size.
' Bitmaps 1024 x 768 will scale
automatically down in DCv14 as an Icon,
' however the file size for one icon
is large.
'
'Stray lines on faceplanes are drawn when
the starting setpoint is on a faceplane.
'Since I installed v14 update 29 AUG
2004, if the stray lines are deleted they
erase
' part of the contour segments on the
faceplane contour only.
'Also, the Contour as Plane stopped
working for me instead I always get
vectors.
'I am running on Windows 95 with an
openGL card. 26 AUG 2004
CLEAR 'clear variable memory
Sys(996) = 0 'ESC to Exit
sys(999) = 0 'ESC to Exit
Nlay1=SYS(3) 'Lookup Current LAYER
Nred = SYS(300) 'Current color RED
Nblu = SYS(301) 'Current color BLUE
Ngrn = SYS(302) 'Current color GREEN
SYS$(42) = "" 'WINDOW title off
SYS$(41) = "" 'INPUT title off
Window 26,38
Color 0,1 'white,black
cls
Print " Multi-ContourXYZ LINE Maker -
2D or 3D"
Print
Print " CROSS SECTIONS are planes (Type
1);"
Print " CONTOUR LINES are vectors (Type
0),"
Print " perpendicular to X-axis
(Y-Z plane)"
Print " or perpendicular to Y-axis (X-Z
plane)"
Print " or perpendicular to Z-axis (X-Y
plane)"
Print " progressing along + or -
axis direction."
Print " to progress negatively, Input
(-) Spacing."
Print " on LAYER 6,7, or 8 Line
Color: RED"
Print
Print " Set Type 0 (Vectors) in the
macro, or"
Print " Group Explode Planes to make
Contours."
Print
Print " Default: 5 Contour Lines"
Print " +1.00 unit Spacing
between Contours"
Print " X-axis, LAYER 6"
Print " ROTATE - position Model, Custom
like angle."
Print " ESC key - Exit this Macro
process any time."
Print " UNDO - step backward thru final
drawing."
Print " DIMENSION - verify Contour
locations."
Print " Contours on Faceplanes display
Stray Lines."
Print
Print " Select Start Point: first
contour's position,"
Print " along the axis for the
cutting plane."
Print " Use the Cursor or
PointXYZ (:) to set."
Print
Print " Press ANYKEY to
continue"
Anykey

'Variable Listing==============
' If no input use these parameters
Ncontr = 5.00 'Number of Contour Lines
SPA = 1.00 'Spacing of Contours
Naxis = 1
Nlay = 6
RETRY1:
Input "How many Contour Lines (default
5)?",Ncontr
If Ncontr <= 0.00 or Ncontr > 100.00
then goto RETRY1
RETRY2:
Input "What SPACING for Contour Lines
(default +1.00 units)?",SPA
If SPA < -99999 or SPA > 99999 then
goto RETRY2
RETRY3:
Input "Which AXIS to cut along, (default
X-axis), 1=X, 2=Y, 3=Z?",Naxis
If Naxis <= 0.00 or Naxis > 3 then goto
RETRY3
>SetStartPoint
{
}
Sys(36) = 1 'Use silent mode to speed up
drawing operations
Sys(49) = 1 'Disable Cursor
If Naxis = 1 then Nlay = 6
If Naxis = 2 then Nlay = 7
If Naxis = 3 then Nlay = 8

For N = 0 to Ncontr - 1
Pcontr = (N * SPA)
>ContourLine
{
<Color 255,0,0
<Layer [Nlay]
<LineStyle 0,2.0000,0.0000
If Naxis=1 then <PointXYZ
[Pcontr],0.0000,0.0000
If Naxis=2 then <PointXYZ
0.0000,[Pcontr],0.0000
If Naxis=3 then <PointXYZ
0.0000,0.0000,[Pcontr]
<SelectOnly 0 '0=entire drawing
1=selection only
<Axis [Naxis] '1=X-axis (Y-Z cutting
plane)
<Type 1 '0=vector 1=plane
}
Next N
>FitToAllWindow
{
}
SYS(3)=Nlay1
SYS(300)=Nred 'restore RED
SYS(301)=Nblu 'restore BLUE
SYS(302)=Ngrn 'restore GREEN
Sys(36) = 0 'silent mode off
Sys(49) = 0 'enable Cursor
CLEAR
END

'NOTE
' Associated ICON.bmp (not included) is
24 x 24 pixels @ 24 bit color, 2K size.
' Bitmaps 1024 x 768 will scale
automatically down in DCv14 as an Icon,
' however the file size for one icon
is large.
'
'Stray lines on faceplanes are drawn when
the starting setpoint is on a faceplane.
'Since I installed v14 update 29 AUG
2004, if the stray lines are deleted they
erase
' part of the contour segments on the
faceplane contour only.
'Also, the Contour as Plane stopped
working for me instead I always get
vectors.
'I am running on Windows 95 with an
openGL card.

File to Download:

ContourXYZ.zip