Details

AutoCAD Platform Customization


AutoCAD Platform Customization

AutoLISP
1. Aufl.

von: Lee Ambrosius

16,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 07.08.2014
ISBN/EAN: 9781118906965
Sprache: englisch
Anzahl Seiten: 432

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Customize and personalize programs built on the AutoCAD platform</b> <p>AutoLISP is the key to unlocking the secrets of a more streamlined experience using industry leading software programs like AutoCAD, Civil 3D, Plant 3D, and more.</p> <p><i>AutoCAD Platform Customization: AutoLISP</i> provides real-world examples that show you how to do everything from modifying graphical objects and reading and setting system variables to communicating with external programs. It also features a resources appendix and downloadable datasets and customization examples—tools that ensure swift and easy adoption.</p> <ul> <li>Find out how to remove unused buttons from the ribbon to gain screen space</li> <li>Discover how to create macros for frequently performed actions, or add your company's logo to the bottom of every drawing</li> <li>Learn to perform more involved customizations, like communicating with a database to validate and update information entered in drawing layers</li> <li>Ideal for CAD administrators, senior drafters, savvy users, and other professionals and students</li> </ul> <p>Through detailed discussions and tutorials that include real-world examples, this book gives you the power to enhance your program's experience and output.</p>
Introduction xix <p><b>Chapter 1 • Quick Start for New AutoLISP Programmers 1</b></p> <p>Working with AutoLISP Expressions 1</p> <p>Working with Commands and Input 3</p> <p>Conditionalizing and Repeating Expressions 5</p> <p>Grouping Expressions 7</p> <p>Storing and Loading AutoLISP Expressions 9</p> <p><b>Chapter 2 • Understanding AutoLISP 15</b></p> <p>Getting Started with AutoLISP 15</p> <p>Understanding the Syntax of an Expression 16</p> <p>Executing Expressions 18</p> <p>Accessing the AutoLISP Documentation 19</p> <p>Storing and Retrieving Values 19</p> <p>Setting and Using Variables 21</p> <p>Working with System Variables 25</p> <p>Accessing Environment Variables 26</p> <p>Exploring Data Types 28</p> <p>Leveraging AutoCAD and Third-Party Commands 30</p> <p>Using the command Function 31</p> <p>Using the command-s Function 32</p> <p>Working with Commands That Display a Dialog Box 33</p> <p>Defining and Using Custom Functions 33</p> <p>Defining a Custom Function 34</p> <p>Using a Custom Function 35</p> <p>Example: Drawing a Rectangle 36</p> <p><b>Chapter 3 • Calculating and Working with Values 39</b></p> <p>Calculating Values with Math Functions 39</p> <p>Performing Basic Math Calculations 39</p> <p>Performing Advanced Math Calculations 43</p> <p>Working with Bitwise Operations 44</p> <p>Manipulating Strings 48</p> <p>Concatenating Strings 49</p> <p>Getting the Length of and Searching for Strings 49</p> <p>Replacing and Trimming Strings 51</p> <p>Changing the Case of a String 55</p> <p>Evaluating Values to Strings 56</p> <p>Converting Data Types 57</p> <p>Converting Numeric Values to Strings 57</p> <p>Converting Strings to Numeric Values 58</p> <p>Converting Numeric Values to Other Number Types 60</p> <p>Returning a Value from a Custom Function 61</p> <p>Exercise: Drawing a Rectangle (Revisited) 63</p> <p>Creating the drawplatelsp File 64</p> <p>Revising the drawplate Function 65</p> <p>Adding the Revised drawplate Function to drawplatelsp 66</p> <p>Creating the utilitylsp File 67</p> <p>Loading the LSP Files into AutoCAD 68</p> <p><b>Chapter 4 • Working with Lists 71</b></p> <p>What Are Lists? 71</p> <p>Creating a List 73</p> <p>Getting an Element from a List 74</p> <p>Retrieving a Specifi c Element 75</p> <p>Stepping Through a List 78</p> <p>Appending, Substituting, and Removing Elements 79</p> <p>Appending Elements 79</p> <p>Substituting Elements 81</p> <p>Removing Elements 81</p> <p>Determining Whether an Item Exists in a List 82</p> <p>Sorting the Elements of a List 84</p> <p>Using Point Lists to Calculate Geometric Values 84</p> <p>Measuring Angular and Distance Values 85</p> <p>Calculating Points 86</p> <p>Finding and Snapping to Points 86</p> <p>Translating Points 88</p> <p>Converting Measurement Units 88</p> <p>Accessing the AutoCAD Calculator 89</p> <p>Converting Lists to Strings and Strings to Lists 90</p> <p>Exercise: Adding Holes to the Plate 90</p> <p>Defining the New Get-Sysvars and Set-Sysvars Utility Functions 91</p> <p>Defining the New createcircle Utility Function 93</p> <p>Revising the drawplate Function 94</p> <p>Using the Revised drawplate Function 95</p> <p><b>Chapter 5 • Requesting Input and Using Conditional and Looping Expressions 97</b></p> <p>Interacting with the User 97</p> <p>Requesting Input at the Command Prompt 98</p> <p>Providing Feedback to the User 113</p> <p>Working with the Graphics Windows 118</p> <p>Conditionalizing and Branching Expressions 120</p> <p>Comparing Values 120</p> <p>Grouping Comparisons 126</p> <p>Validating Values 126</p> <p>Evaluating if a Condition Is Met 127</p> <p>Testing Multiple Conditions 129</p> <p>Repeating and Looping Expressions 131</p> <p>Repeating Expressions a Set Number of Times 132</p> <p>Performing a Task While a Condition Is Met 133</p> <p>Exercise: Getting Input from the User to Draw the Plate 137</p> <p>Revising the drawplate Function 137</p> <p>Using the Revised drawplate Function 140</p> <p><b>Chapter 6 • Creating and Modifying Graphical Objects 143</b></p> <p>Working with Entity Names and Dotted Pairs 143</p> <p>Creating a Dotted Pair 145</p> <p>Accessing the Elements of an Entity Data List and Dotted Pair 146</p> <p>Adding Objects to a Drawing 147</p> <p>Selecting Objects 152</p> <p>Selecting an Individual Object 152</p> <p>Working with Selection Sets 154</p> <p>Filtering Selected Objects 160</p> <p>Modifying Objects 161</p> <p>Listing and Changing the Properties of an Object Directly 162</p> <p>Updating an Object’s Properties with an Entity Data List 168</p> <p>Deleting an Object 171</p> <p>Highlighting Objects 172</p> <p>Working with Complex Objects 173</p> <p>Creating and Modifying Polylines 173</p> <p>Creating and Modifying with Block References 176</p> <p>Extending an Object’s Information 180</p> <p>Working with XData 180</p> <p>Defining and Registering an Application Name 181</p> <p>Attaching XData to an Object 181</p> <p>Querying and Modifying the XData Attached to an Object 184</p> <p>Removing XData from an Object 186</p> <p>Selecting Objects Based on XData 186</p> <p>Exercise: Creating, Querying, and Modifying Objects 187</p> <p>Revising the Functions in utilitylsp 187</p> <p>Testing the Changes to the drawplate Function 188</p> <p>Defining the New Get-DXF-Value and Set-DXF-Value Utility Functions 189</p> <p>Moving Objects to Correct Layers 190</p> <p>Creating a Basic Block Attribute Extraction Program 192</p> <p>Using the Functions in the furntoolslsp File 196</p> <p><b>Chapter 7 • Creating and Modifying Nongraphical Objects 199</b></p> <p>Working with Symbol Tables 199</p> <p>Accessing and Stepping through Symbol Tables 200</p> <p>Adding and Modifying Entries in a Symbol Table 202</p> <p>Creating and Modifying Block Definitions 208</p> <p>Working with Dictionaries 210</p> <p>Accessing and Stepping through Dictionaries 210</p> <p>Creating a Custom Dictionary 213</p> <p>Storing Information in a Custom Dictionary 215</p> <p>Managing Custom Dictionaries and Entries 215</p> <p>Exercise: Creating and Incrementing Room Labels 216</p> <p>Revising the createlayer Function in utilitylsp 217</p> <p>Creating the Room Label Block Defi nition 217</p> <p>Inserting a Block Reference Based on the Room Label Block Definition 219</p> <p>Prompting the User for an Insertion Point and Room Number 222</p> <p>Adding Room Labels to a Drawing 224</p> <p><b>Chapter 8 • Working with the Operating System and External Files 227</b></p> <p>Storing Information in the Windows Registry or a Plist File 227</p> <p>Creating and Querying Entries 228</p> <p>Editing and Removing Entries 230</p> <p>Accessing Data from External Files 231</p> <p>Opening and Creating an External File 231</p> <p>Reading Characters and Lines from a File 234</p> <p>Writing Characters and Lines from a File 235</p> <p>Closing an Open File 236</p> <p>Working with Directories and Files in the Operating System 237</p> <p>Locating and Listing Files and Directories 237</p> <p>Managing Files and Directories 243</p> <p>Getting Information about a File 244</p> <p>Exercise: Reading and Writing Data 244</p> <p>Creating Layers Based on Data Stored in an External File 245</p> <p>Adding Layers to a Drawing with the loadlayers Function 247</p> <p>Writing the Bill of Materials to an External File 248</p> <p>Using the furnbomexport Function 249</p> <p><b>Chapter 9 • Catching and Handling Errors 251</b></p> <p>Identifying and Tracking Down Errors 251</p> <p>Putting Your Code Under the Microscope 252</p> <p>Displaying Messages During Execution 254</p> <p>Tracing Functions 259</p> <p>Catching Errors in a Program 260</p> <p>Defining and Using a Custom Error Handler 262</p> <p>Grouping Functions into a Single Undo Action 263</p> <p>Exercise: Handling Errors in the drawplate Function 266</p> <p>Using the drawplate Function 267</p> <p>Implementing a Custom *error* Handler and Undo Grouping 268</p> <p>Testing the Changes to the drawplate Function 269</p> <p><b>Chapter 10 • Authoring, Managing, and Loading AutoLISP Programs 271</b></p> <p>Storing AutoLISP Expressions 271</p> <p>Selecting an Editing Environment 272</p> <p>Creating an AutoLISP File 272</p> <p>Editing an AutoLISP File 274</p> <p>Writing Modular Code 275</p> <p>Adding Comments 276</p> <p>Undefining and Redefining Standard AutoCAD Commands 279</p> <p>Defining a Startup Function 280</p> <p>Loading AutoLISP Files 281</p> <p>Manually Loading an AutoLISP File 281</p> <p>Automatically Loading an AutoLISP File 282</p> <p>Using the Load/Unload Applications Dialog Box to Load a LSP File 284</p> <p>Managing the Locations of AutoLISP Files 287</p> <p>Specifying Support File Search Paths 287</p> <p>Identifying Trusted Locations 289</p> <p>Deploying AutoLISP Files 291</p> <p>Deployment Methods (Local vs External) 292</p> <p>Defining a Plug-in Bundle 294</p> <p>Implementing Help for Custom Functions 296</p> <p>Exercise: Deploying the drawplate Function 298</p> <p>Loading the utilitylsp File by Reference 298</p> <p>Loading the drawplatelsp File on Demand 299</p> <p>Enabling Help Support for the drawplate Function 299</p> <p>Configuring the AutoCAD Support and Trusted Paths 300</p> <p>Testing the Deployment of the drawplate Function 301</p> <p>Creating DrawPlatebundle 302</p> <p>Deploying and Testing the DrawPlatebundle 303</p> <p><b>Chapter 11 • Using the Visual LISP Editor (Windows only) 305</b></p> <p>Accessing the Visual LISP Editor 305</p> <p>Managing AutoLISP Files with the Visual LISP Editor 306</p> <p>Formatting an AutoLISP File 307</p> <p>Coloring Syntax 308</p> <p>Formatting Code 309</p> <p>Commenting Code 310</p> <p>Validating and Debugging Code 310</p> <p>Executing Code from the Visual LISP Editor 310</p> <p>Checking and Loading Code in the Current Editor Window 311</p> <p>Debugging Code 313</p> <p>Creating a Visual LISP Project 315</p> <p>Compiling LSP and PRJ Files into a VLX File 317</p> <p>Exercise: Working with the Visual LISP Editor 318</p> <p>Formatting, Checking, and Debugging the badcode Function 318</p> <p>Stepping Through and Inspecting the badcode Function 320</p> <p>Creating and Compiling a Project 323</p> <p><b>Chapter 12 • Working with ActiveX/COM Libraries (Windows only) 325</b></p> <p>Understanding the Basics of ActiveX 325</p> <p>Accessing Classes, Objects, and Collections 326</p> <p>Specifying Properties and Invoking Methods 329</p> <p>Working with Variants and Arrays 332</p> <p>Importing COM Libraries 336</p> <p>Using the AutoCAD COM Library 337</p> <p>Accessing the AutoCAD Application and Current Drawing Objects 338</p> <p>Working with Graphical and Nongraphical Objects in the Current Drawing 339</p> <p>Monitoring Events with Reactors 342</p> <p>Leveraging the Windows and Microsoft Office COM Libraries 344</p> <p>Accessing the Windows Shell Object 345</p> <p>Working with Microsoft Office 347</p> <p><b>Chapter 13 • Implementing Dialog Boxes (Windows only) 349</b></p> <p>What Is Dialog Control Language? 349</p> <p>Defining and Laying Out a Dialog Box 351</p> <p>Defining a Dialog 351</p> <p>Adding Tiles 352</p> <p>Grouping, Aligning, and Laying Out Tiles 356</p> <p>Creating and Previewing a Dialog in a DCL File 360</p> <p>Loading and Displaying a Dialog Box 362</p> <p>Loading and Unloading a DCL File 362</p> <p>Displaying a Dialog 363</p> <p>Initializing Tiles 365</p> <p>Interacting with and Responding to a User 369</p> <p>Specifying the Action of a Tile 369</p> <p>Getting Information about a Tile 370</p> <p>Terminating or Closing a Dialog Box 371</p> <p>Hiding a Dialog Box Temporarily 372</p> <p>Exercise: Implementing a Dialog Box for the drawplate Function 373</p> <p>Creating the drawplate Dialog Box 374</p> <p>Renaming the Existing drawplate Function 376</p> <p>Defining a New drawplate Function 376</p> <p>Testing the drawplatelsp Changes 379</p> <p>Index 381</p>
<p><b>Lee Ambrosius</b> is a Principal Learning Content Developer at Autodesk for AutoCAD and AutoCAD LT products and has worked on end-user and API documentation for nine releases. He has presented customization and programming sessions at Autodesk University for a decade, and has authored and edited several AutoCAD-related books. Follow him on twitter at @leeambrosius.</p>
<p><b>Streamline and customize the AutoCAD platform using AutoLISP</b></p> <p><i>AutoCAD Platform Customization: AutoLISP</i> teaches you how to customize and personalize AutoCAD, Civil 3D, Plant 3D, and other programs built on Autodesk’s industry-leading AutoCAD platform. Written by the foremost authority on AutoCAD customization, this comprehensive learning resource features detailed discussions backed by real-world examples and tutorials designed to help you harness the full potential of AutoLISP. Downloadable datasets and examples are included to ensure a functional understanding of the presented concepts.</p> <ul> <li><b>Learn the basics of AutoLISP, and how to author and load LSP files</b></li> <li><b>Calculate and work with values</b></li> <li><b>Create and modify graphical and nongraphical objects</b></li> <li><b>Make choices and repeat expressions</b></li> <li><b>Work with the drawing environment</b></li> <li><b>Access directories and external files</b></li> <li><b>Use the Visual LISP<sup>®</sup> editor</b></li> <li><b>Work with ActiveX/COM libraries</b></li> <li><b>Create dialog boxes</b></li> </ul>

Diese Produkte könnten Sie auch interessieren:

AutoCAD 2013 For Dummies
AutoCAD 2013 For Dummies
von: Bill Fane, David Byrnes
PDF ebook
23,99 €
IBM Workplace Services Express For Dummies
IBM Workplace Services Express For Dummies
von: Stephen R. Londergan, Michael Loria
PDF ebook
16,99 €
Building Flash Web Sites For Dummies
Building Flash Web Sites For Dummies
von: Doug Sahlin
PDF ebook
18,99 €