PART NINE - A D4D PRIMER - REFERENCES, RESOURCES, & SETUP
Software
Delphi Starter Edition - This is a free download that gives you an IDE and access to online resources for writing and compiling D4D macros
DCAl for Delphi Package from Datacad - This is the package of tools necessary for Delphi to write the macros. It consists of five units which define the D4D envorinment to Delphi.
1. Uconstants.pas lists all of the constant values in DCAlr. Most of the constants are explained in theDCAl manual although some new ones were added for D4D specifically..
2. Uvariables.pas lists all Datacad variables accessible in macro programs. Most of the variables are explained in theDCAl manual.
3. Urecords.pas lists all of the record types used to store data specific to various Datacad entities, layers, and other operational features.
4. Uinterfaces.pas lists all user interface methods used in D4D. These are the methods that require user input and conclude the portion of a menu loop iteration contained in the Macro. Control of the loop must pass out of the macro and into Datacad whenever these methods are called.
5. UinterfacesRecords.pas lists all of the record structures used to pass data to/from the interface method when control changes between Datacad and the D4D macro.
Experience
The Postings in this series assume that the reader has a basic understanding of Pascal, Delphi and DCAL. It is a primer on how to implement DCAl for Delphi (D4D) macros and convert DCAL macros into D$D format.
Recommended References
DCAL Manual - (available as a download In 'Word' format at Datacad.com) Although written for DCAl it is essential for understanding various constants, variables, records and methods used to create a D4D macro. Interface methods, in particular have new arguments requiring different coding techniques to operate them, but the basic functions remain the same. Later PARTs will explain how to handle the different method arguments effectively.
Delphi in a Nutshell - ADesktop Quick Reference[/u] Ray Lischner, c2000 - O'Reilly & Associates. This is a comprehensive reference manual for Coding in Delphi. It is essential to writing Delphi code. The first section of the book covers many of the basic features in Delphi that extend the language from Pascal.
Oh! Pascal Second Edition Doug Cooper & Michael Clancy, c1985, 1982 - W.W. Norton Co., Inc. This book starts with the simplest pascal programming techniques and walks you how to use the full range of capabilities provided in the Pascal programming language.
Object Pascal Language Guide - c1983, 2002 - Borland Software Company. (Available as an online free 'pdf' download.) This book provides detailed explanations expanding the pascal language to include full object oriented programming structure.
Mastering Delphi Delphi 6, 7 - Marco Cantu - 2001 Sybex. (Also available online as free downloadable pdfs.) These books are enormous (running more than 1,000 pages) and cover a large swath of Delphi capabilities. They will be of great assistance in learning how to make windows style forms using the available graphic components in Delphi. There are later versions covering features added in later versions of Delphi, but these two cover many of the basics.
Setup
Installation:
Delphi Starter Edition (v10). This is the free edition of Delphi available for download from their website. The installation process is familiar and should provide you with an operating copy of the program. After it is installed you will need to perform several setup tasks to work on macros.
1. Setting Unit Directory Paths. Selecting the menu 'Tools/Options' brings a popup dialog. Select 'Environment Options/Delphi Options/Library' and choose the 'Library path '...' button. This will give you a list of the current directory paths that Delphi uses to search for unit files in your programs declared under the [color#0040ff]uses[/color] section. You must add the directory in which you will be placing your DCAL unit files so that Delphi can find them. To add a new directory select the folder icon button, browse to your desired path and select the add button.
2. Setting Macro Output Paths. Compiled macros are saved to a specified directory. You will want to redirect the macro files to the Datacad Macro directory so that they can be found by Datacad. The setting for this can be found in the Delphi 'Project/Options' menu calling a 'Project Options' popup dialog. Select the 'Output' '...' button to browse to the 'Datacad/Macros' directory. (At the time of this posting, it appears that this option must be set separately for each macro project written. Please post if you find a different option in Delphi that sets this option for all 'dll' projects.
Software
Delphi Starter Edition - This is a free download that gives you an IDE and access to online resources for writing and compiling D4D macros
DCAl for Delphi Package from Datacad - This is the package of tools necessary for Delphi to write the macros. It consists of five units which define the D4D envorinment to Delphi.
1. Uconstants.pas lists all of the constant values in DCAlr. Most of the constants are explained in theDCAl manual although some new ones were added for D4D specifically..
2. Uvariables.pas lists all Datacad variables accessible in macro programs. Most of the variables are explained in theDCAl manual.
3. Urecords.pas lists all of the record types used to store data specific to various Datacad entities, layers, and other operational features.
4. Uinterfaces.pas lists all user interface methods used in D4D. These are the methods that require user input and conclude the portion of a menu loop iteration contained in the Macro. Control of the loop must pass out of the macro and into Datacad whenever these methods are called.
5. UinterfacesRecords.pas lists all of the record structures used to pass data to/from the interface method when control changes between Datacad and the D4D macro.
Experience
The Postings in this series assume that the reader has a basic understanding of Pascal, Delphi and DCAL. It is a primer on how to implement DCAl for Delphi (D4D) macros and convert DCAL macros into D$D format.
Recommended References
DCAL Manual - (available as a download In 'Word' format at Datacad.com) Although written for DCAl it is essential for understanding various constants, variables, records and methods used to create a D4D macro. Interface methods, in particular have new arguments requiring different coding techniques to operate them, but the basic functions remain the same. Later PARTs will explain how to handle the different method arguments effectively.
Delphi in a Nutshell - ADesktop Quick Reference[/u] Ray Lischner, c2000 - O'Reilly & Associates. This is a comprehensive reference manual for Coding in Delphi. It is essential to writing Delphi code. The first section of the book covers many of the basic features in Delphi that extend the language from Pascal.
Oh! Pascal Second Edition Doug Cooper & Michael Clancy, c1985, 1982 - W.W. Norton Co., Inc. This book starts with the simplest pascal programming techniques and walks you how to use the full range of capabilities provided in the Pascal programming language.
Object Pascal Language Guide - c1983, 2002 - Borland Software Company. (Available as an online free 'pdf' download.) This book provides detailed explanations expanding the pascal language to include full object oriented programming structure.
Mastering Delphi Delphi 6, 7 - Marco Cantu - 2001 Sybex. (Also available online as free downloadable pdfs.) These books are enormous (running more than 1,000 pages) and cover a large swath of Delphi capabilities. They will be of great assistance in learning how to make windows style forms using the available graphic components in Delphi. There are later versions covering features added in later versions of Delphi, but these two cover many of the basics.
Setup
Installation:
Delphi Starter Edition (v10). This is the free edition of Delphi available for download from their website. The installation process is familiar and should provide you with an operating copy of the program. After it is installed you will need to perform several setup tasks to work on macros.
1. Setting Unit Directory Paths. Selecting the menu 'Tools/Options' brings a popup dialog. Select 'Environment Options/Delphi Options/Library' and choose the 'Library path '...' button. This will give you a list of the current directory paths that Delphi uses to search for unit files in your programs declared under the [color#0040ff]uses[/color] section. You must add the directory in which you will be placing your DCAL unit files so that Delphi can find them. To add a new directory select the folder icon button, browse to your desired path and select the add button.
2. Setting Macro Output Paths. Compiled macros are saved to a specified directory. You will want to redirect the macro files to the Datacad Macro directory so that they can be found by Datacad. The setting for this can be found in the Delphi 'Project/Options' menu calling a 'Project Options' popup dialog. Select the 'Output' '...' button to browse to the 'Datacad/Macros' directory. (At the time of this posting, it appears that this option must be set separately for each macro project written. Please post if you find a different option in Delphi that sets this option for all 'dll' projects.
joshhuggins likes this
Last edited by Jsosnowski on Sun Sep 17, 2017 8:11 pm, edited 1 time in total.
Joe
User since V2.4
User since V2.4