home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
graphic1
/
dc-25c.lzh
/
DEMO1.MAC
< prev
next >
Wrap
Text File
|
1990-03-01
|
6KB
|
171 lines
; DEMO1.MAC, example macro program for DANCAD3D.COM v2.5x
; Copyright (c) 1988-1990, Daniel H. Hudgins, All rights reserved.
; Reproduction in any manner, without express permission, is prohibited.
RUN DEMO1.SUB ; Set-up and Intro.
NAME 1 = DEMO1P 0
LET |FRAMES = 37
LET |CRANKRAD = 100
LET |RODC2C = -600
LET |CRANKROT = 0
LET |COUNT = 0
{ START ANIMATION LOOP }
:LOOP_1
INITIALIZE
LOAD ELEMENTS DEMO1.3DE
LET |CRANKROT = [ |CRANKROT + ( 360 / |FRAMES ) ]
LET |YDIST = [ SIN( RAD( |CRANKROT ) ) * |CRANKRAD ]
LET |XDIST = [ |YDIST / TAN( RAD( |CRANKROT ) ) ]
LET |PSTNOFF = [ |RODC2C + |XDIST ]
# 1 ROTATE C 0 0 |CRANKROT
# 2 OFFSET C |XDIST [ |YDIST * -1 ] 0
# 2 ROTATE C 0 0 [ DEG( ARCSIN( ( |YDIST * -1 ) / |RODC2C ) ) ]
# 3 OFFSET C |PSTNOFF 0 0
LET |COUNT = [ |COUNT + 1 ]
GRAPHMODE B&W
LOCATE 2 2 ; Put text cursor at upper left of screen.
ECHO DANCAD3D v2.5 MACRO DEMO1.MAC, THIS IS FRAME NUMBER: %%
OUTPUT |COUNT
ECHO OF %%
OUTPUT |FRAMES
LOCATE 2 21
ECHO E X A M P L E D A T A W I N D O W %%
LOCATE 2 23
ECHO CRANK SHAFT'S ROTATION = %%
OUTPUT |CRANKROT
ECHO DEGREES
LOCATE 2 24
ECHO PISTON OFFSET DISTANCE = %%
OUTPUT |PSTNOFF
ECHO UNITS
# 0 DISPLAY -20 -20 0 -1000 1.9 1 275 0 ; Main display of parts.
IF |COUNT = 2 THEN GOTO :SAVE2D :RETURN2D ; Save frame 6 in 2D file.
INITIALIZE
{ This outline was made with pixel trace in the on-screen sub-menu. }
ENTER
-3.95 -2.7 0 -3.95 2.7 0 1 1 0 0
-3.95 2.7 0 3.95 2.7 0 1 1 0 0
3.95 2.7 0 3.95 -2.7 0 1 1 0 0
3.95 -2.7 0 -3.95 -2.7 0 1 1 0 0
-3.95 -2.3 0 3.95 -2.3 0 1 1 0 0
0.45 2.7 0 0.45 1.6 0 1 1 0 0
0.45 1.6 0 -3.95 1.6 0 1 1 0 0
-3.95 2 0 0.45 2 0 1 1 0 0
0 0 0 0 0 0 0 0 0 0 { END ENTER }
# 0 DISPLAY 0 0 0 1E18 240 1 0 0 ; Add outline.
SAVE PIXEL NAME 1 NEXT ; Save screen to a numbered file.
LOOP :LOOP_1 [ |FRAMES - 1 ]
; Show the frame set.
GRAPH B&W ; Set the video mode to display graphics.
ANIMATE DEMO1P 100
TEXTMODE ; Set video back in text mode.
GOTO :MAKEASCE :RETURNASCE
STOP ; END OF MAIN CODE
; SAVE 2D PROCEDURE
:SAVE2D
; Save drawing for print out.
# 0 SAVE 2D -20 -20 0 -1000 1.9 1 275 0 DEMO1A.2D
GOTO :RETURN2D
; MAKE ASCII PROCEDURE
:MAKEASCE
TEXT ; Clear the screen
ECHO ┌─────────────────────────────────────────────────────────────────────────────┐
ECHO │ DEMO1.MAC DEMONSTRATION MACRO FOR DANCAD3D v2.5x OR LATER. │
ECHO └─────────────────────────────────────────────────────────────────────────────┘
LOCATE 1 5
ECHO This DEMO1.MAC macro file will now make a drawing file of the piston screen
ECHO you have just been looking at so you can print out the drawing at high
ECHO resolution. The drawing will be put in an ASCII type file named DEMO1E.ASC.
ECHO The drawing will also be left in the workspace for you to look at in the
ECHO drawing editor or preview screen. Please read the file DANCAD3D.DOC on one of
ECHO the program disks for more information about printing drawings out. To print
ECHO this drawing you will have the perspective values set to:
LOCATE 1 13
ECHO FOR 11 INCH WIDTH or FOR 8 INCH WIDTH
ECHO X ROTATION = 0 or X ROTATION = 0
ECHO Y ROTATION = 0 or Y ROTATION = 0
ECHO Z ROTATION = 90 or Z ROTATION = 0
ECHO DISTANCE = 1E18 or DISTANCE = 1E18
ECHO SCALE = 320 or SCALE = 240
ECHO MODE = 1 or MODE = 1
ECHO X SHIFT = 0 or X SHIFT = 0
ECHO Y SHIFT = 0 or Y SHIFT = 0
LOCATE 1 23
ECHO To load the file DEMO1E.ASC a later date press F L A from the main menu.
LOCATE 1 25 ECHO <<< Read the above information while the program is working... >>> %%
INITIALIZE
LOAD ASCII DEMO1D.ASC
; If you have the full registered user outfit you can change the lettering
; font from DANCAD3D.FON to one of the other fonts i.e. INTRNAT1.FON
LETTERING
DANCAD3D v2.5 MACRO DEMO1.MAC, THIS IS FRAME NUMBER: 2 OF 37
0 -2.5 0 0 0 0 0.15 0.08 1 1 0 0 0 1 0.333333333 7.6
C J DANCAD3D.FON
LETTERING
EXAMPLE DATA WINDOW
-1.75 1.8 0 0 0 0 0.15 0.08 1 1 0 0 0 1 0.333333333 3.8
C J DANCAD3D.FON
LETTERING
CRANK SHAFT'S ROTATION = 19.4564594 DEGREES
-3.8 2.2 0 0 0 0 0.15 0.08 1 1 0 0 0 1.19 0.333333333 1
F M DANCAD3D.FON
LETTERING
PISTON OFFSET DISTANCE = -505.71225 UNITS
-3.8 2.5 0 0 0 0 0.15 0.08 1 1 0 0 0 1.19 0.333333333 1
F M DANCAD3D.FON
# 0 SAVE 2D 0 0 0 -1.0000E+18 240 1 0 0 DEMO1B.2D
INIT
LOAD 2D DEMO1A.2D
LOAD 2D DEMO1B.2D
# 0 MAGNIFY ZERO 0.0041666 0.0041666 0
# 0 SAVE ASCII DEMO1E.ASC ; Use this ASCII file for print out
BEEP
LOCATE 1 25 ECHO Press the [Return] key when finished reading the above information. %%
WAIT ; Wait for [Return] or [Mouse-Left] button to be pressed.
LOCATE 1 25 ECHO <<< Working: Macro now running, please stand by... >>> %%
GOTO :RETURNASCE
; END OF MACRO DEMO1.MAC