Sunday, February 21, 2010

Introduction to Extended Entity Data

Chapters Three and Four introduced list manipulation and processing which is the true power of AutoLISP programming. Even though these capabilities have greatly extended the potential of AutoLISP programming, one down fall still exists concerning non-AutoCAD entity information. Unless the information is either assigned to an AutoCAD attribute or saved in an external file, the program is unable to recall any of the information once the current drawing session has been terminated. This limits the applications where these theories can be used. For example, if the resistance program illustrated in Chapter Four used attributes contained within blocks to store information concerning the resistance and voltage drop for each resistor, then extreme care would have to be taken to insure that these blocks are not exploded. If one or more of the blocks were exploded, then this would result in the program ignoring the values that were assigned to those entities thereby increasing the voltage drop for the remaining resistors. If this were to happen and the situation were to go unnoticed, then the results obtained from running the program would produce a situation in which the actual circuit could fail. Therefore the programmer is forced to rely on constructing a program that would either prevent the user from exploding the attributed blocks or one that warns the user of the potential danger involved if this process is continued. On the other hand if the program had saved the information to an external file, then a similar situation could result if the file were deleted. AutoLISP provides two possible solutions to this problem. They are Extended Entity Data (or Xdata as it is sometimes referred to) and Xrecord. While both methods are similar in concept and application each method has its advantages and disadvantages. The programmer should be well versed in the use of both of these methods. The intent of these methods is to provide the programmer with a means of storing and managing information in an object's association list using DXF codes. Attached information can be relevant or non-relevant to the particular entity.

No comments:

Post a Comment