The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#37367 by Mark F. Madura
Fri Jun 27, 2008 3:34 pm
Dear 'Classic' DCAL Programmers:

I'm pleased to announce the availability of the first draft edition of the remastered DCAL manual. Please feel free to download this document and post your comments, corrections, and additions here on this forum.

DCAL 'Classic' Programmer's Reference Manual (Remastered)

Thank You,

#37377 by Miguel Palaoro
Sat Jun 28, 2008 8:26 am
Niiice job, Mark.

I'm busy here preparing the first release of LT 12 in portuguese, and almost didn't realize that you're about to make an unannounced kick-off for a new enterprise to be explored: the development of applications with DCAL on all its flavours.

Are you considering to make a refresh on the Tutorial as well ?
Or may be the Manual could embed the tutorial on it ?

Thanks for this new great endeavour.
I can foresee many things happening over this frontier.

#37382 by Roger D
Sat Jun 28, 2008 11:28 am
Miguel Palaoro wrote:Niiice job, Mark.
I can foresee many things happening over this frontier.

Itd be nice to see some new macros.
I might even scratch my head and try to think of sometihng and then try to dive back into programing.
#37425 by Michael Olney
Mon Jun 30, 2008 10:06 am
I can think of a few macros that would be nice...maybe I'll have to take a look at it when I have the time.
#37462 by Jon C. Hubart
Tue Jul 01, 2008 2:31 pm
I appreciate the investment of time to keep this alive.

The description of how to compile the sample macros needs to be updated. It still lists the directory structure starting at MTEC. (That hasn't been used since version 4) The whole structure listed is out of date. I would think this section should be updated to include a description of how to create path statements to the compiler and how to compile a macro without the use of the go.bat files (or at least a description of what the go.bat is doing).

I may have missed it but, I saw very little mention of the include files. There should be more about what they do and how to use them.

Also the odd page headers in chapter 8 say "Viewing Database Management" carried over from chapter 7.
#37490 by Mark F. Madura
Wed Jul 02, 2008 10:20 am
Miguel Palaoro wrote:Are you considering to make a refresh on the Tutorial as well?

The DCAL Tutorial has been revised with the assumption the reader is using DataCAD 12 and Windows XP.

#37568 by Miguel Palaoro
Thu Jul 03, 2008 2:31 pm
Mark F. Madura wrote:...The DCAL Tutorial has been revised with the assumption the reader is using DataCAD 12 and Windows XP.

Nice job, Mark. Congratullations!

It was a quite silent movement!
I guess you just gave us a handy tool for alluring new developers. I'll keep you aware of the progress over this new frontier.

#71380 by dhs
Mon May 01, 2017 9:01 pm
Hi Mark,
I have come across a few errors in the DCAL manual over the years, but have not always made not of them. But here are a couple of things that need fixing (based on the manual that I downloaded as part of the DataCAD 18 evaluation program last year):

1.The manual still has the user fields (user0 thru user3) in the entity definition. I believe these fields were renamed over 20 years ago. The new names would imply that the fields are no longer available to the macro writer (although as far as I know this has never been stated).

2. The example code under disfrompolyvert (page 131) has invalid code for the polyvert_get call (it does not include the frst and last parameters).

Will post any other errors that I find here.

David H
#71513 by dhs
Fri May 19, 2017 7:43 pm
A few more corrections that could be made to the DCAL manual if you update it again:

The definition of msg_dlg on page 213 is incorrect. It is missing a type for the msgDlgType parameter (should be integer)

In the Hatch sample program, several of the strings are missing one or both quotes (starting on page 180).

In the description of ExecAndWait (page214):
- it says that visibility values are defined in, but I cannot find this file anywhere in my Datacad installation.
- mention is made of an ExecProg function, but ExecProg is not documented anywhere that I can find (nor is it defined in any of the include files).

In the getmode example (p78-79) the code uses a variable named 'move' in the getmode call, but then uses a variable named 'mode' in the subsequent lines.

lyr_create (p117-118). Talks about the return value of 'lyr_clear'. It should be 'lyr_create'.

in the description of min & max parameters to mode_hatch (p166), it refers to ent_extents procedure. It should be ent_extent (without the s)
#75684 by dhs
Tue Feb 12, 2019 12:30 pm
I have recently made significant updates to the copy of the DCAL Manual that I maintain. All known BUILTIN procedures are included (up to and including DataCAD 21 ... the version number where they were introduced is noted for each).
I know there are some procedures missing - notably in the range 634 to 651 - but I have been unable to discover what these are.

You can download the updated manual from the page at
#75685 by Mark F. Madura
Tue Feb 12, 2019 2:51 pm
Hi David,

Taking a quick look through the source, I found the following procedures:

UndoStartTransaction; BUILTIN 634
UndoEndTransaction; BUILTIN 635
getLongLayerName; BUILTIN 636
Lyr_Find_LongName; BUILTIN 637
Get_InpStyl; BUILTIN 638
Set_InpStyl; BUILTIN 639
Get_DimFont; BUILTIN 640
setMSPSheetToPlotByName; BUILTIN 641
setMSPSheetToPlotByNum; BUILTIN 642
GetMSPSheetName; BUILTIN 643
setToPlotQuickLayout; BUILTIN 644
plotOpen10; BUILTIN 645 // Replaces DOS version
plotMode10; BUILTIN 646 // Replaces DOS version
plotClose10; BUILTIN 647 // Replaces DOS version
setPenTableNameToLoad; BUILTIN 648
setPrinterByName; BUILTIN 649
GetPrinterNames; BUILTIN 650
SetMacroHints; BUILTIN 651

I'll see if I can get you specifics on the parameters for each when I get a chance.

#75748 by Joseph Baron
Thu Feb 21, 2019 5:46 pm
We have SetPenStyle () and SetPenSpacing ().

Can we please get GetPenStyle () and GetPenSpacing ()?

This would allow us to store those current settings, have the DCAL macro draw whatever it needs to, then restore the user's current PenStyle and PenSpacing settings.

If there is another way to do that please let me know, I have a current situation to remedy so that the user's settings are restored after the macro is done.

Thank you!
Last edited by Joseph Baron on Thu Mar 14, 2019 8:39 am, edited 1 time in total.
#75965 by Mark F. Madura
Tue Mar 12, 2019 11:01 am
Thanks to Dave for documenting these, here are the declarations for BUILTIN 634 - 651.

PROCEDURE UndoStartTransaction; BUILTIN 634;
PROCEDURE UndoEndTransaction; BUILTIN 635;

These procedures mark the beginning and end of what the undo system sees as a "transaction".

For example, when creating a single line, the undo system sees the following:

- An entity was added
- It was drawn to the screen
- It was marked as the end of a "group"

These 3 steps are seen as a single "transaction" and will be "un-done" together.

PROCEDURE getLongLayerName(pLayer : lgl_addr; Name : IN OUT str80); BUILTIN 636;

pLayer is the address of the layer being queried
Name is the long name of that layer

FUNCTION Lyr_Find_LongName(Name : str80; pLayer : lgl_addr); BUILTIN 637;

Name is the layer name to look for
pLayer is the address of the layer if found
The function returns True if it found a layer by that Name

FUNCTION Get_InpStyl : integer; BUILTIN 638;

This function returns the index of the current input style where:

0 = Relative Polar
1 = Absolute Polar
2 = Relative Cartesian
3 = Absolute Cartesian
4 = Direction/Distance

PROCEDURE Set_InpStyl(InputStyle : integer); BUILTIN 639;

This function sets the index of the current input style where:

0 = Relative Polar
1 = Absolute Polar
2 = Relative Cartesian
3 = Absolute Cartesian
4 = Direction/Distance

PROCEDURE Get_DimFont(Ent : Entity; FontName : IN OUT str80); BUILTIN 640;

This procedure retrieves the name of the font used in the associative dimension, Ent

FUNCTION setMSPSheetToPlotByName(Name : str80) : boolean; BUILTIN 641;

Name is the name of the MSP sheet to make current
This function returns True if it was able to find a sheet with the Name provided

FUNCTION setMSPSheetToPlotByNum(SheetNum : integer); BUILTIN 642;

Makes SheetNum the current MSP sheet (1-256)
This function returns True if a valid SheetNum was passed in

FUNCTION GetMSPSheetName(SheetNum : integer; SheetName : IN OUT str80) : boolean; BUILTIN 643;

SheetName is the name of the MSP sheet specified by SheetNum
This function returns True if a valid SheetNum was passed in

PROCEDURE setToPlotQuickLayout(DoQuickLayout : boolean); BUILTIN 644;

DoQuickLayout tells DataCAD to default to plotting the Quick Layout rather than MSP

FUNCTION plotOpen10(PenWidth : integer; WinPaperSize : integer; PaperSizeX, PaperSizeY : integer; NumCopies : integer; PlotToFileName : str80; ErrorMessage : IN OUT str80) : boolean; BUILTIN 645;

PenWidth specifies the pen width in millimeters
WinPaperSize is the index into the available paper sizes
PaperSizeX/PaperSizeY specify the custom paper size in millimeters
NumCopies is the number of copies
PlotToFileName is the name of the plot file to create if plotting to file
ErrorMessage is a string to receive any error message (i.e. the printer doesn't support the paper size specified in PaperSizeX/PaperSizeY

FUNCTION plotMode10(Mode : IN OUT mode_type; paperMin, paperMax, WindowMin, WindowMax, RotationCenter : point; RotationAngle : real; MaintainAspect : boolean; ErrorMessage : IN OUT str80) : boolean; BUILTIN 646;

Mode is what will be plotted
PaperMin and PaperMax specifies the custom paper size in millimeters
WindowMin and WindowMax specify the real-world coordinates of the viewport to be plotted
RotationCenter is the real-world coordinate of the center of rotation if the printer is setup to rotate the print
MaintainAspect should be set to True if no distortion of the X or Y axis is desired
ErrorMessage is a string to receive any error message
This function returns True if no errors were encountered

PROCEDURE plotClose10; BUILTIN 647;

This procedure should be called after calling plotMode10

FUNCTION setPenTableNameToLoad(PenTableName : str80); BUILTIN 648;

PenTableName Name of Pen Table
This function returns True if successful

FUNCTION setPrinterByName(PrinterName : str80; ErrorMessage : IN OUT str80); BUILTIN 649;

PrinterName Name of printer
ErrorMessage is a string to receive any error message
This function returns True if successful

PROCEDURE GetPrinterNames(PrinterNamesArrary : IN OUT; TPrinterNamesArr; NumPrinters : IN OUT integer) BUILTIN 650;

PrinterNamesArrary will contain the names of the printers available to the system.
The type TPrinterNamesArr is declared as:

TPrinterNamesArr = ARRAY[1..50] of string[80];

NumPrinters is the number of printers found

PROCEDURE SetMacroHints(DoHints : boolean); BUILTIN 651;

DoHints tells DataCAD whether or not to display tooltips for the function key labels

Who is online

Users browsing this forum: No registered users and 4 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.


Software for AEC Professionals Since 1984