Copyright (C) 1986-2008 by Daniel H. Hudgins, All Rights Reserved.
No part of "This Web Site" (HTML document), including associated files, may be: distributed, sublicensed, transmitted, copied, archived, mirrored, modified, bundled, embedded, sold, given away, rented, loaned, or shared in any form without express written permission in a formal Vendor agreement contract dated and signed in ink obtained directly from Daniel H. Hudgins by registered postal mail. All agreements for permission to distribute expire after a period no greater than one year from the date of the signing of the agreement by Daniel H. Hudgins. See the current "EULA" for information regarding limited copying and storage for the purpose of "Beta Testing" "This Web Site."
To view or use the current version of this Web page you may need to reload or refresh the display of this page by your browser. Just clicking on the browser's [Reload] or [Refresh] icon may not be enough to insure that all of the page's most current contents have been cached and displayed. Some browsers may have additional commands to help display the page's most current contents such as: holding down the [Shift] key and clicking on the [Reload] icon, holding down the [Control] key and clicking on the [Refresh] icon, holding down the [Control] and [Shift] keys and clicking on the [Refresh] icon, pressing the [Control] and [F5] keys, pressing [Control] and the [R] key, or some other combination of keys or clicks. Check to see which commands your HTML browser uses to load the most current page contents into its cache and then to display them onto the screen.
This Web site is dedicated to the thousands of "users" of my programs, those who have helped test my programs over the last 22 or so years, and especially those who shared their experiences with me.
You must read this notice: This is a licensed Web site (HTML document and associated files). You must read and agree to be legally bound in contract by the Terms of Use and conditions given in the End User License Agreement ("EULA"), Legal Notices, Instructions, Warnings, Disclaimers, and all other text in "SECTION: 0" of "This Web Site" (HTML document and associated files) before reading or using any of the information, software programs, and or files, contained in, linked to, and or associated with, "This Web Site" (HTML document and associated files). Any use or "Beta Testing" of "This Web Site" constitutes your acknowledgment of your full agreement with the current End User License Agreement ("EULA") and your decision to have this current license supersede all prior and contemporaneous agreements and understandings. Information and files in "This Web Site" (HTML document and associated files) have been placed here so that long time users of "The Author's" programs DANCAD3D.COM (tm) , DANCAM.EXE (tm) , or DANPLOT.EXE (tm) could help proofread the text of the documentation files or screens displayed, and also help test data files, example files, and or any software programs that might be made available from time to time, to aid "The Author" in finding mistakes, bugs, and other errors, omissions, defects, mistakes, and faults. Everything in "This Web Site" (HTML document and associated files) is "Beta Test", "Beta Code", Experimental, Preliminary, requires proofreading, or is being evaluated for possible revision, and is NOT warranted to be free of defect. To help "The Author" report any bugs, foul-ups, defects, or mistakes that you find, see "SECTION: 8" for instructions. "This Web Site" (HTML document and associated files) and all other files and programs by Daniel H. Hudgins are made available "AS IS" without warranty of any kind express, expressed, or implied. All offers and specifications are subject to change or discontinuation without notice of any kind. Please read "SECTION: 8" of "This Web Site" (HTML document and associated files) before trying to contact "The Author."
The text in this section was derived from the v2.5 CAD manual, and has been updated somewhat, but differences between different releases of v2.5, v2.6 and v2.7 may mean that some of the information may not apply to the version you are using. Some adjustment may be required for versions prior or subsequent to v2.7A.
You may not distribute, sell, rent, share, or give away these HTML documentation files or printed copies of them. You may not extract text from these HTML documentation files for distribution, sale, rent, sharing, or giving away. You can use the [Print] option in your browser to make one copy for yourself to mark up in order to help me proofread the text for mistakes.
Documents may be available to download from time to time, you can check SECTION: 9 to see what the current situation with regard to downloadable files is. The names of these documentation files may change, and they may be edited, combined, or eliminated in the future, without notice.
You may need to adjust your browser for best viewing of the pre- formatted text by changing the "font" size using the commands in your browser (see the help in your browser, or use the pull-down menus in your HTML browser.) If some letters in words on the screen appear to be missing or scrambled try changing the font size in your browser as this sometimes happens even though the words are spelled correctly in the HTML code.
Use the "Edit, Find in page Ctrl+F" or "Edit, Find (in this page)... Ctrl+F" command in your browser to search for keywords within the documentation text in this HTML page. You will need to search over again in the other pages in this HTML document for the same keyword since your browser may not search for a keyword beyond the current page that is loaded.
DANCAD3D (tm) macro commands can used to write a macro "program" that will operate DANCAD3D (tm) automatically. DANCAD3D (tm) can also automatically generate an output macro file of these commands while you use the programs menus. Appendix B lists detailed information about many of the individual macro commands.
Steps to use Appendix B: Macro commands.
Read this section to learn what commands are available.
Use [W]rite from DANCAD3D (tm)'s main menu to write or edit macros.
Use the automatic [O]utput macro feature to automatically code these macro commands to a file while you use the menu commands.
This appendix contains information on the DANCAD3D (tm) macro programming commands that are available for your use in writing automatic CAD-CAE or CAM programs. See the pages in this Web site that link to this page for additional information.
Below are details about macro commands that start with E.
PURPOSE: To display a message on the video screen.
MAIN MENU: NA
KEYWORD: ECHO
PARAMETERS: 1 or 2
TYPE: A line of text of less than 255 characters with optional
terminator to put cursor at end of the echoed text. The
optional terminator is %% at the end of the line.
Putting %% at the end of the text keeps the text cursor
from dropping to the next line on the screen.
FORMAT: ECHO text ... text ... text ... text
or
ECHO text ... text ... text ... text%%
EXAMPLE: ECHO The text goes to the end of line1.
ECHO The text goes to the end of line2.
; Line 2 will be below line 1.
TEXT_MODE
LOCATE 1 14 ECHO This text will be near the center.
; This will clear the screen and put the text near the
; center with the cursor below the text.
TEXT_MODE
LET |X = 0
LOCATE 1 14 ECHO Input the value of |X = %%
INPUT |X
; This will clear the screen and put the text near the
; center of the screen with the cursor after the text,
; wait for the value to be input, and then assign the
; value to the variable.
LOCATE 1 1 ECHO The value of Y is: %%
OUTPUT Y ECHO .
; This will put the value of Y after the text and move
; the cursor to the next line, n.b. echo MUST be
; followed by a piece of text to echo.
HINT: You can OUTPUT the value of variables on screen before
you save the screen in pixel form so that you can see
the relationships when you view the pixel frame files
with ANIMATE. Press the [S] (Step) key when ANIMATE
runs to step through the frames so the information ECHO
displayed can be read. See also LOCATE to position the
text cursor before you use ECHO. The OUTPUT$ command can
be used in place of the ECHO command, but requires the
text to be between quotation marks.
PURPOSE: To manually enter line data by value of end-points.
MAIN MENU: [N] [E]
KEYWORD: ENTER
PARAMETERS: 1 or more lines of 10 arguments.
TYPE: r......... X1 -1E18 to 1E18.
r......... Y1 -1E18 to 1E18.
r......... Z1 -1E18 to 1E18.
r......... X2 -1E18 to 1E18.
r......... Y2 -1E18 to 1E18.
r......... Z2 real -1E18 to 1E18.
i......... Color -127 to 127.
i......... Thickness 0 to 255.
i......... Shape 0 to 255 (See Appendix N.)
i......... Style 0 to 255 (See Appendix N.)
FORMAT: ENTER
x1 y1 z1 z2 y2 z2 1 1 0 0
x1 y1 z1 z2 y2 z2 1 1 0 0
(ditto and so on...)
0 0 0 0 0 0 0 0 0 0
EXAMPLE: ; Do not put comments inside ENTER.
ENTER
100.00 0.00 0.00 50.00 86.60 0.00 1 1 0 0
-50.00 86.60 0.00 -100.00 0.00 0.00 1 1 0 0
-100.00 0.00 0.00 -50.00 -86.60 0.00 1 1 0 0
|x1 [ |y1 + 4 ] |z1 |x2 [ |y2 + 4 ] |z2 |c |w 0 0
49.99 -86.60 0.00 100.00 -0.00 0.00 1 1 0 0
0 0 0 0 0 0 0 0 0 0
; 0 0 0 0 0 0 0 0 0 0 ends list of line's points.
; ENTER always starts a new element.
; Use APPEND to add lines to the latest element.
; Use BEGIN to start a new element for APPEND.
HINT: To make entering the data easier draw the element with
the drawing editor and save the element as an ASCII type
file, then in the [W]rite command use [F1] then [R] to
read the ASCII data file into your macro as a block of
text. You can use the ENTER command to enter complex
curves manually by typing out the line segment end point
values.
PURPOSE: To remove a complete element from the drawing workspace
permanently and decrement the element number of all
elements with a higher element number by one, e.g. if
you have ten elements and you erase element eight, then
element nine will become element eight, and element ten
will become element nine.
MAIN MENU: [D] [?...] [E] [E]
KEYWORD: ERASE
PARAMETERS: None (Acts on currently selected element.)
TYPE: NA
FORMAT: ERASE
EXAMPLE: # 4 ERASE ; Removes element number 4.
LET |ES -> ELEMENTS
# |ES ERASE ; Erase the latest element.
# 2 COPY
# 2 ERASE ; Make element 2 the into the
; element with the highest element
; number.
HINT: Remember that all the elements after the element that
gets erased will have their element number decremented
by one for each erased element. It is wise to [B]ack-up
any element you are going to ERASE with the SAVE
ELEMENTS command. See also the FILES ERASE command and
the RELEASE command to erase DOS or on disk files.
PURPOSE: To expand an array of variables stored on disk to make
intermediate values between the ones in the source
array. Works like the CURVE_FIT and BETWEENS commands
except that you can fit an array of disk variables
values rather than line segments in an element in the
workspace, or a set of congruent elements on disk. The
macro EXPAND_ARRAY command has been changed and updated
in v2.7A so that it can now work with larger sets of
values if you wish to do that, please read the
information below. EXPAND_ARRAY can also now work on a
single "array" file rather than a large set of
individual files.
MAIN MENU: [W] (Write a macro using this command.)
KEYWORD: EXPAND_ARRAY
PARAMETERS: 5
TYPE: w......... mode = S, Short set of variable files using
numbered extensions, i.e.
filename.1 through filename.999
L, Long set of variable files using up
to 8 numbers plus a three letter name
in the extension space, i.e
1.fil through 99999999.fil
A, Array of values in a single array file
where the first line is NUM_ARRAY_V27,
and the last line is EOF, with the values
on the lines in between. Each value is on
a text line by itself in the array file.
f......... Source array filename. A set of files or array file
corresponding to the mode selected for expansion.
f......... Result array filename. A set of files or array file
corresponding to the mode selected for the
output of the expanded array of values.
i......... Iteration, 1 to 9.
(The number of files in the result array will
increase by (n*2)-1 with each iteration.)
r......... Damping, 0 to 1E18, 0.2 is normal.
(The higher the damping the shallower the
curve that will be made, or more abrupt the
transition in the case of a rotation.)
FORMAT: EXPAND_ARRAY w f f i r
EXAMPLE: ; To create a source array for the Short and Long options of
; EXPAND_ARRAY you can use the LET command in the normal way,
FILES MAKE SHORT
LET SHORT\A.1 = 1.250
LET SHORT\A.2 = 1.262
LET SHORT\A.3 = 1.273
; or
FILES MAKE LONG
LET LONG\1.B = 1.250
LET LONG\2.B = 1.262
LET LONG\3.B = 1.273
; the EXPORTFILE macro command can be used to make the
; source set for the A option,
EXPORTFILE T SOMENAME.ARR
NUM_ARRAY_V27
1.250
1.262
1.273
EOF
ENDEXPORTFILE
; Here is an example macro that shows how to use all
; three array types,
VERSION v2.7A ; First line of this example macro.
; EXPANDTE.MAC How to use EXPAND macro command's options.
LET CTEST.1 = 2.250
LET CTEST.2 = 2.262
LET CTEST.3 = 2.273
EXPAND_ARRAY S CTEST.1 DTEST.1 1 0.2
TEXT
LOCATE 1 1 OUTPUT DTEST.1
LOCATE 1 2 OUTPUT DTEST.2
LOCATE 1 3 OUTPUT DTEST.3
LOCATE 1 4 OUTPUT DTEST.4
LOCATE 1 5 OUTPUT DTEST.5
WAIT
LET 1.ETE = 3.250
LET 2.ETE = 3.262
LET 3.ETE = 3.273
EXPAND_ARRAY L 1.ETE 1.FTE 1 0.2
TEXT
LOCATE 1 1 OUTPUT 1.FTE
LOCATE 1 2 OUTPUT 2.FTE
LOCATE 1 3 OUTPUT 3.FTE
LOCATE 1 4 OUTPUT 4.FTE
LOCATE 1 5 OUTPUT 5.FTE
WAIT
EXPORTFILE T ATEST.ARR
NUM_ARRAY_V27
1.250
1.262
1.273
EOF
ENDEXPORTFILE
EXPAND_ARRAY A ATEST.ARR BTEST.ARR 1 0.2
ARRAY R BTEST.ARR BTEST.1 1
ARRAY R BTEST.ARR BTEST.2 2
ARRAY R BTEST.ARR BTEST.3 3
ARRAY R BTEST.ARR BTEST.4 4
ARRAY R BTEST.ARR BTEST.5 5
TEXT
LOCATE 1 1 OUTPUT BTEST.1
LOCATE 1 2 OUTPUT BTEST.2
LOCATE 1 3 OUTPUT BTEST.3
LOCATE 1 4 OUTPUT BTEST.4
LOCATE 1 5 OUTPUT BTEST.5
WAIT
; End EXPANDTE.MAC
VERSION v2.7A
; Start, an older example macro revised for v2.7A
LET X_IN.1 = 0 LET Y_IN.1 = -1 ; Set up source.
LET X_IN.2 = 1 LET Y_IN.2 = 0
LET X_IN.3 = 0 LET Y_IN.3 = 1
LET X_IN.4 = -1 LET Y_IN.4 = 0
LET X_IN.5 = 0 LET Y_IN.5 = -1
LET X_IN.6 = 1 LET Y_IN.6 = -1
EXPAND_ARRAY S X_IN.1 X_OUT.1 3 0.2 ; Make result.
EXPAND_ARRAY S Y_IN.1 Y_OUT.1 3 0.2
LET |J -> COUNT X_OUT ; Count result.
NAME 1 = X_OUT 0 NAME 2 = Y_OUT 0 ; Name result.
:L0123 ; Label loop.
LOAD ASCII SYMBOL.ASC ; Load a symbol.
LET |K -> ELEMENTS ; Get element No.
FILES COPY NAME 1 NEXT X_VALUE ; Pass array value.
FILES COPY NAME 2 NEXT Y_VALUE
# |K OFFSET ZERO X_VALUE Y_VALUE 0 ; Use passed values.
LOOP :L0123 [ |J - 1 ] ; Loop result times.
; End older example.
NOTE: EXPAND_ARRAY can be used to smooth values used to
control the display rotations and other values used in
an animation macro and values passed to the various
other macro commands such as OFFSET, ROTATE, and
MAGNIFY.
HINT: The use of the LET |var -> COUNT result is very useful
since you can vary the iterations and the rest of the
macro can adjust it self to the varying length of the
result array. The result array is limited to 99999999
members, but you can always split the result array into
two of more source arrays and expand them, this is not
normally a problem. This EXPAND_ARRAY command is useful
in cases where you wish to OFFSET or ROTATE an element
through space in some complex and irregular motion. The
BETWEENS command would be used in cases where you want
the element to bend or otherwise metamorphose its shape
and form as well as its location and orientation. With
the EXPAND_ARRAY command you need to know the explicit
values for the OFFSET and ROTATION of the element to be
manipulated for a few major points along the elements
path. With the BETWEENS command none of the parameters
of the elements orientation need to be known. With the
EXPAND_ARRAY command the number of line segments in the
element being manipulated can vary, in strong contrast
to the use of the BETWEENS command where the number of
line segments in the element(s) must remain constant.
The EXPAND_ARRAY command lets you smooth the transition
of any number of parameters influencing an element, such
as OFFSET, DISPLAY scale or lighting, ROTATION, and line
width. See also the ARRAY macro command to read values
from the result file when a single array file is to be
used.
PURPOSE: EXPORTFILE macro command makes a file on disk from data
stored within the text of the macro file body, and can
be used to make a text file for the macro BLOCK_TEXT
command, can be used to export drawing data into an
*.ASC (ASCII type) file, can be used to export a sub-
macro for the macro RUN command to use, or be used to
export binary data for creating *.FON font files and
other files of any type. New for v2.7A.
MAIN MENU: [W] or [F] [U] [H] [H]
KEYWORD: EXPORTFILE
PARAMETERS: 2
TYPE: w......... mode, T = make text file.
A = append text to a text file.
B = make a binary file from hexadecimal
text data in macro.
f......... filename of file to make by export.
FORMAT: EXPORTFILE
EXAMPLE: EXPORTFILE T C:\SUB\SOMENAME.TXT
start......text
more.......text
last.......text
ENDEXPORTFILE
EXPORTFILE A C:\SUB\SOMENAME.TXT
start......text to append
more.......text to append
last.......text to append
ENDEXPORTFILE
EXPORTFILE B C:\SUB\SOMENAME.BIN
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 FF FE FD FC FB
ENDEXPORTFILE
NOTE: EXPORTFILE macro command is useful to keep all the
needed parts of a macro in a single macro file body, and
then have the macro automatically create, i.e. export,
those various parts as additional files that the macro
needs for various commands at the time that the macro is
run. In other words it is a way to supply a macro as a
single file rather than a collection of files of various
kinds.
If sub-macros or other data is to be exported, the
export entries should be below the bottom of the macro
code and use the GOTO command to go down to the
EXPORTFILE commands, then back up to near the top of the
macro so that the extra text does not slow down the
macro code, the "end" of the macro would then be in the
middle of the macro file, and a GOTO command would jump
to a label at the bottom of the macro file to exit.
Do not put data to be saved on the same lines as the
EXPORTFILE or ENDEXPORTFILE commands. Do not put macro
comments within the EXPORTFILE command using ; or { }.
HINT: The HEX data can be made by using the Files Utilities
Hex Hex command to make a file of HEX data, then use the
Load command in the Write command to read the HEX data
from the file made by the HEX command into your macro
code, between the macro commands EXPORTFILE and
ENDEXPORTFILE. See also CHECK_SUM to check the file
made.