the autocad technical reference - gbv
TRANSCRIPT
The AutoCAD Technical Reference
RALPH GRABOWSKI
-
DELMAR PUBLISHERS INC.
Table of Contents
Introduction xxi
The Purpose of This Book xxi Successful CAD Though Better Technique xxii The Audience for This Book xxiii The Organization of This Book xxiii Versions of AutoCAD Covered xxv Conventions Used in This Book xxvi Acknowledgements xxvi
I Performance & Peripherals
1 The CAD Environment 1
The AutoCAD Platforms 1 Pros and Cons of Platforms 2 Hardware Independence 3 File Interchange 4 Host User Interface 4
Selecting the 386 Hardware 7 Rock-bottom 386SX 7 Top-of-the-Line 486 8
v
The DOS Environment 9 Multiple Menü Files 9 Memory and Disk Paging n Protected-Mode Drivers \ \
Summary 13 Resource Guide 14
2 Memory Management 15
Memory Structures Low Memory . , High Memory 17
Expanded Memory Specification 19
Extended Memory 9 n vcpi ::::::::::::::::: £ DPMI 2 2
Extended AutoLISP 22 High Memory Area 2-3 Virtual Memory Manager 24
The AutoCAD Memory Map 25 AutoCAD 386 95 A Computer Stethoscope 26
386 Memory Management 2« Expanded Memory Managers 28 Tutorial: Qualitas 386max 2Q
Top384 . . . . . . . . . . . . . 30 Norom ~n Use=b000-b800 30 Nohigh 3 0
Ext and Ems 3 0
Tutorial: 386max Professional 3 1
Loading TSRs into High Memory 3 1
Tutorial: Quarterdeck QEMM-386 34 Optimize and Loadhi 34 Optimizing by Hand 35 I=b000-b800 35 Handles=16 3g Maps = 0 3g Norom 3g Rom '.'.'.'.'.'.'.WWW. 36
vi THE AUTOCAD TECHNICAL REFERENCE
Exclude= 37 Frame= 37 Nowindows3 37
Analysis by QEMM 37 Miscellaneous Tweaking 38 System Resources 39 Vidram 39
Summary 40 Resource Guide 40
3 Graphics Boards 41
The Architecture of Graphics Boards 41 Monochrome vs. Color 42
Monochrome . 42 Color 42 True Color 42
Low vs. High Resolution 43 Frame Buffer vs. Coprocessor 45
Frame Buffers 45 Coprocessor-Based . 45
Graphics Standards 46 IBM Standards 46 Non-IBM Standards 48 Extensions to IBM Standards 49 The VGA Standards Set by VESA 51
Matching Monitors to Boards 52 Interlaced vs. Non-Interlaced 52
AutoCAD and Graphics Boards 53 Viewres 53
Fast Redraws 53 Circle Zoom Percent 53
Resolution and Colors vs. Speed 54 Graphics Board Drivers 55
ADI Versions 55 Real-Mode Drivers 56 Protected-Mode Drivers 56 High-End vs. VGA 57 Faster in Theory 58 The Future of VGA 59
THE AUTOCAD TECHNICAL REFERENCE vii
Summary 59 Resource Guide 50
4 Speeding Up Graphics 65
Faster Zooms and Pans 55 Avoiding Regens 55
The Virtual Screen 55 Virtual Screen Limitations 56 The Maximum Zoom 5-7 The Minimum Zoom 5g Regenauto 5g Zoom Dynamic 59 Define Views 70 Zooms at Redraw Speed 72
Commercial Redraw Software 72 Display-List Processing 73
Hardware Display-List 73 Autodesk's Support for display Lists 74 Common Display-List Features 74
Bird's-Eye View 75 Pixel Pickers 75 Current Color 75 Memory Status 75 Memory Overflow 75 Dynamic Pan and Zoom 77 Views and Südes 77 Display-List Viewports 77 Color and Layer Toggling 7g Command Implementation 7g Button Assignments 7g User-Defined Commands 78 Control Panels 7g Icon Menüs 79 Configuration 79
Limitations to Display-List Processing 79 Slower Regen Times 80 Erasing Irregularities 80 Dragging Overhead 81 Zoom and Pan Limits 81
viii THE AUTOCAD TECHNICAL REFERENCE
Appetite for Memory 81 Autoshade and 3D Studio Support 82 Driver Update Delays 82 Prices 83
Summary 83 Resource Guide 83
5 Plotters and Printers 85
Output Considerations 85 Graphics Languages 85 Paper Sizes 87 Plotting Area 87 Rollfeed 89 Resolution, Repeatability and Accuracy 89 Resolution 89 Repeatability 90 Accuracy 90
Pen Plotters 91 Rollerbed Plotters 91 Flatbed Plotters 91 Servo and Stepper Motors 92 Pencil Plotting 92
Start-Up and Storage 92 Plotting Duration 93 Cost 93 Pen Speed 93 Quality 93 Out of Lead/Ink 93
Raster Plotters 94 Electrostatic Technology 94 Thermal Technology 94 Page Printer Technology 94 Bubble-Jet Technology 95 Dot-Matrix Printer 95
Producing a Plot 95 The AutoCAD Stage 95
Computer Speed 96 Plot Optimization . . . ., 96 Plot to Disk 98
THE AUTOCAD TECHNICAL REFERENCE ix
Vector Processing 93 The Serial Port Stage 100
Data Speed 100 Transmission Method 100
The Plotter Stage 1 0 i Pen Speed 202 Pen Acceleration 102 Color Plots 103 Plotter Model 103 Speed Increases 104
Summary 104 Resource Guide 105
6 Buffers and Spoolers 107
Hardware Buffers 10g Internal Buffers 108 External Buffers 108 Increasing the Baud Rate 109
r: Buffer Ahead of the Port 109 Disk-Based Buffers 109
Software Spoolers 110 Single-Plot Spoolers HO Queuing Spoolers 110 Spooler Features Hl
Rollfeed Support Hl Multi-Pen Support 111 Multiple Ports 1H User Interface 1H Plot File Records 111 Hyper Spooling Hl
AutoCAD's Spooling Capability 112 A Buyer's Guide to Buffers and Spoolers 113
Will a Buffer or Spooler Help? 113 Is Your Plotter Supported? 114 How Much Capacity? 115 How Many Computers per Plotter? 115
Summary 116 Resource Guide 117
x THE AUTOCAD TECHNICAL REFERENCE
7 Benchmarking AutoCAD 119
Benchmark Philosophy 119 High-Level Benchmarking 120 Low-Level Benchmarking 120
Developing a Benchmark for AutoCAD 121 Benchmarking Plotters 121
Plotter Speed 122 Plot Quality 122 How to Time the Plotter 124
Benchmarking Graphics Boards 125 AutoCAD Commands 126 Accurate Timings 126 Benchmark Drawings 129 The Pan Index 129 Standardized Hardware 132 Other Graphics Benchmarks 132
Benchmarking Systems 132 The Speed of AutoCAD 133 Summary 135 Resource Guide 136
I I Output File Formats
8 HPGL and HPGL/2 139
Reading HPGL Plot Files 140 Conventions 140 HPGL Instructions 140 Device-Control Instructions 141 Coordinate System 141 Plotting Limits 142
HPGL 142 Plotter On 144
THE AUTOCAD TECHNICAL REFERENCE xi
Set Handshake Mode 144 Set Xoff Trigger Character 245 Initialize 245 User-Defined Scale 246 P e n UP '.'.'.'.'.'.'.'. 146 Select Pen ,4g Line Type 1 4 6
Velocity Select 1 4 7
Plot Absolute 1 4 7
Pen Down 14g Return Pen 14g Enable Cut Line 14g Page Advance 14g Output Error 24g
HPGL/2 '.'.'.'.'.'.'.'.'.'.'.'.'. 149 Polyline Encoding 250
Comments on AutoCAD's HPGL Driver 152 PLT File Efficiency 152 Driver Compatibility 153
Resource Guide 254
9 DM/PL I55
Reading DM/PL Files 1 5 5
Conventions 256 Coordinate System 256
D M ' p L .*.'.*.'.* .*." 156 Mode One Select 157 Absolute Pen Positioning 157 Home Position 257 Set Plot Origin 1 5 7
Line Type 1 5 8
Coordinate Addressing 258 Pen Up 259 New Pen 259 Set Velocity 259 Vector Move 260 Pen Down 261 Return Pen 261 End of Plot 161
xii THE AUTOCAD TECHNICAL REFERENCE
Plotter Deselect : •• • 1 6 1
Resource Guide 162
10 PostScript Files 163
Conventions 164 PostScript 1 6 5
Comment Lines 166 Procedures 167 Setline Operators 167 Position Operators 168 Pen Changes 169 Operators 169 Showpage 172
Resource Guide 172
11 HP PCL 173
Reading PCL Files 174 Conventions 175 Coordinate System 176
Printer Control Language 177 Reset 178 Number of Copies 179 Top Margin 179 Disable Perf Skip Protection 179 Delete Fonts 179 Delete Macros 179 Raster Resolution 180 Start Raster Graphics 181 Transfer Raster Data 181 End Raster Graphics 182 Form Feed 182 Reset 183
Resource Guide 184
• \
THE AUTOCAD TECHNICAL REFERENCE xiii
12 ADI Plotting 1 8 5
ASCII Format 1 8 6
Start Plot '.'.'.'.'.'.'.'.'.','.'.]''' 187 Pen Change jgy Set Linetype jgg Set Speed Igg Move and Draw Igg End Plot 189
Binary Plots ^Q Conventions 190
DXB Format 192 Conventions 192 Header 193 Scale Factor 195 Draw 19 5
Line Extension 195 End of File 19g
Summary 197 Resource Guide 19g
III Programming AutoCAD
13 Introduction to LISP 201 At the Command Prompt 201
Basic Algebra 202 Integer and Real Division 202
Working with Lists 203 Nested Expressions 204 Setting Variables 204 An Example in Algebra 206
Reporting the Results . 2 0 7 Loading LISP from Disk 208
The Load Function 208
xiv THE AUTOCAD TECHNICAL REFERENCE
Defining a Command 208 Automatically Loading Functions 209 Other Mathematical Operators 209
Reading and Writing Files 210 Opening and Reading Files 211 Closing a File 212 Writing and Appending Files 212 Writing to Other Devices 214 Escape Characters 215
Putting the Program Into a Loop 216 If and Cond 218 If...Then...Else 218 Cond 219
Converting Between Types 219 Summary 220
1 4 AutoLISP Programming 221 Drawing with AutoLISP 221
The Command Function 222 . Synthetic Drawing with Grdraw 224
Simple Parametric Programming 224 Screen Functions 226
Giving Input to AutoLISP 226 Cleaner Code with Cmdecho 227 The Other Ways to Input 229 Trig, the AutoLISP Way 230
Access to Devices Z J 1
Manipulating Entities With AutoLISP 233 Other Powerful Functions 235
Summary 236
1 5 Programming in C 237 To C Via ADS 237 Adding Two Numbers ^ °
Comments and main( ) 2 3^ Declaring Variables 2 4 0
Output with printf 2 4 1
Running the Program 2 4 1
THE AUTOCAD TECHNICAL REFERENCE xv
Input From the Keyboard 242 Prompts and Input with scanf 243 Summing Variables 244 Print to Screen 245
Other Input Functions 245 String Input with gets 245 Char Input with getch 246 Other get... Functions 246
Pointers and Address-of 246 Pointers 247 Address-of 247 Practical Pointers 248
Reading Disk Files 248 Readadi.C 249 Definitions 251 Including Header Files with #include 251 Defining Constants with #define 252 Error Checking 252 Command Line Arguments with arge and argv 252 Checking For the Data File 253 File Reading and Screen Output 253 Reading a Binary File »254 Switch and Case 254 Erroneous Data Trapping 255
Summary 255 Resource Guide 256
1 6 Introduction to ADS 257
What ADS Is 257 How ADS Works . . . . . . . 258
ADS Without Programming 258 Loading an ADS Program 259 Running an ADS Program 260 Multiple ADS Applications 262 Unloading an ADS Application 263
Programming with ADS 264 Selecting a C Compiler 264 Cross-Platform Compatibility 265
Writing an ADS Program 265
xvi THE AUTOCAD TECHNICAL REFERENCE
Include Files 267 The Main Function 267 Define Result Codes 267 Initialize the Interface 269 Begin the Loop 270 Report Error Codes 270 Begin the Result Branching 270 Register External Functions 271 Miscellaneous Requests 273 Ending the Code 273
An Example ADS Application 274 The Application Programming Interface 276 Summary 277 Resource Guide 277
1 7 Introduction to ADI 279
An Overview of ADI 279 The History of ADI 279
ADI vl.O 280 ADI v2.0 and v2.1 280 ADI v3.0 and v3.1 281 ADI v4.0 281 ADI v4.1 282 The Future of ADI 282 ADI for Non-DOS Platforms 282
The Benefits of ADI 283 Display-List Processing 283 Protected-Mode Drivers 285
Types of ADI Drivers 286 Vector Display 286 Rendering Display 286 Digitizers 287 Vector Plotters 287 Raster Plotters 287 The Layout of an ADI Driver 287
1. First-Time Initial ization 287 2. Wait State 288 3. Application-Time Initial ization 288 4. General Operation 288
THE AUTOCAD TECHNICAL REFERENCE xvii
5. Termination 288 6. Unload 288
ADI Communications 288 Interrupt Mode 288 Packet Mode 289 Protected-Mode Packets 290
Summary 290
1 8 Programmer's Tools 291
The Autodesk Software Developer's Kit 291 AutoLISP Prototyping Environment 292
Using APE's Clp 292 Editing LISP with Clp 293
Protecting AutoLISP Code 295 The Kelvinator Protector 296 AutoLISP Protection 298
Automatically Formatting LISP Code 299 LISP Beautifier 3QQ Pretty Printer 301
Third-Party Tools 304 The Ideal Text Editor 305
Features to Look For 305 PC Tools 307
File Viewer 30g L i s t 308
The Programming Environment 308 A11y 309
Summary 32Q Resource Guide 310
xviii THE AUTOCAD TECHNICAL REFERENCE
IV Appendices
A The Complete Dictionary of Computer & CAD Abbreviations 313
B The Ultimate ASCII Table 327 The ASCII Codes 327
Control Characters 328 Extended Keyboard Codes 329
Conversion Table 329
C Metrie Equivalency Table 339
D Standard Video Modes 340
E HPGL and HPGL/2 Command Summary 342 Command Delimiters 342 HPGL 342 HPGL/2 343
F DM/PL Command Summary 344 Command Delimiters 344
G PostScript Command Summary 346 Command Delimiters 346
H HP PCL Command Summary 348 Command Delimiters 348
I ADI Command Summary 350 Command Delimiters 350 ASCII and Binary Plotting 351 DXB Plotting 352
J A C Programmer's Cheat Sheet 353
THE AUTOCAD TECHNICAL REFERENCE xix
Subroutines are Functions 353 Data Types 353 Operators 354 Format Codes 355 Escape Sequences 355 Input 356 The If Condition 356 The While Condition 357 The For Condition 357 The Do Condition 357
K Summary of ADS Library Functions 358 The ADS Functions 358 The AutoLISP Functions 364 Abbreviations 371
Colophon 372
Index 373
XX THE AUTOCAD TECHNICAL REFERENCE