Autolisp to Visual lisp: Design Solutions for Autocad instructor’s Guide Chapter One



Download 210.39 Kb.
Page4/8
Date05.05.2018
Size210.39 Kb.
#47999
1   2   3   4   5   6   7   8

Definitions

Symbol Table – is similar to a filing cabinet for AutoCAD in the respects that it is used to store information regarding non-graphic (Layers, Linetypeas, Styles, Viewports, Views, Dimension Styles, User Coordinates Systems and Applications).


Application Identification Table – A table used by AutoCAD to store the names of all applications that have been registered in an AutoCAD drawing.
Application Name – In AutoCAD all extended entity data must be assigned an application name. The application name can only be used once in a drawing. This helps ensure that information assigned by more than one program to the same AutroCAD entity is unique.
Dictionary – Is similar in concept to a symbol table, however the dictionary is used to store non-graphic information that cannot be contained within a symbol table.
Extended Entity Data – Provides the programmer with a means of storing and managing information in an object’s association list using DXF codes. The attached information can be relevant or non-relevant to the particular entity.
Filters – Allows the developer to perform either a broad or narrow asearch of a drawing’s database.

Answers to Review Questions

2. See above


3. (REGAPP “VisualLisp”)

The REGAPP function when supplied with an application name, first checks the APPID table to determine if the application name is already in use. If the application name is not in use, then the function adds the name to the table and returns the name that was added. If the application name already exist, then the function returns NIL.


4. See Above
5. (SETQ Ans (TBLSEARCH “Appid” “VisualLISPExample”))

(IF (/= Ans Nil)

(REGAPP “VisualLispExample”)

(PRINC “\nApplication is already registered”)

)
6. False, The ENTMOD function can be used to modify extended entity data.
7. True
8. Extended Entity Data is designed to allow the developer to store non AutoCAD information in an object’s association list by using DXF codes.

Extended Entity Data is an extension of an object’s association list. In it’s native form an entity association list will only contain relevant AutoCAD information.


9. SSGET (SETQ SelectionOne (SSGET “X”))
10. The TBLSEARCH function searches a symbol table for a specific entity name, where as the TBLNEXT, function when supplied with a valid sub-table name returns the next entity residing in that table.
11.
12.
13.
14. ; error: bad point argument
15.
16.
17.
18.
19.
20. (_>
21. 4
22. 4
23.
24. ; error: bad argument type: lentityp nil
25. ((-1 . ) (0 . "LINE") (330 . ) (5 . "2E") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine") (10 8.49744 7.10482 0.0) (11 4.65396 6.52041 0.0) (210 0.0 0.0 1.0))
26. C:CREATE_XRECORD ------ then ; error: bad argument type: lentityp nil
27. ; error: too few arguments
28. ((0 . "LAYER") (2 . "0") (70 . 0) (62 . 7) (6 . "Continuous"))
29. ; error: bad argument type: lentityp nil
30. ; error: bad xdata list:
31. (SETQ SelEntity (ENTSEL “\nSelect Line on Wall”))

(IF (/= SELENTITY Nil)

(PROGN

(REGAPP “BtuPerHour”)



(SETQ Exdata

(LIST


(LIST “BtuPerHour”

(CONS 1000 (STRCAT “The total

BTU/HR Heat loss is “

(RTOS BtuPerHour)

)

)

)



)

)

(SETQ NewEnt (APPEND SelEntity



(LIST (APPEND ‘(-3)

Exdata)


)

)

)



(ENTMOD NewEnt)

(PRINC)


32.

(DEFUN C:ChangeLayers()

(PRINC “\nSelect entity to change”)

(SETQ SelSet (SSGET)

EntSelected (ENTSEL)

)

(WHILE (> EntSelected Nil)



(SETQ EntSelected (ENTSEL))

)

(SETQ EntData (ENTGET (CAR EntSelected)



)

Layer (CDR (ASSOC 8 EntData)

)

(COMMAND “Chprop” SelSet “” “La” Layer “”) ;See Note

)

Note: The Bolded Text above can be replaced with the following section.


(SETQ Cnt 1

NewLayer (CONS 8 Layer)

)

(While (> SSLENGTH Cnt)



(SETQ EntName (SSNAME Selset (1- Cnt))

EntDataSel (ENTGET ENTGET EntName)

OldLayer (ASSOC 8 EntDataSel)

EntDataSel (SETQ EntDataSel (SUBST NewLayer

OldLayer EntDataSEl)

)

(ENTMOD EntDataSel)



(ENTUPD (CDR (ASSOC -1 EntDataSel)))

(Setq Cnt (1+ Cnt))

) ;End of While Loop

Chapter Six



Definitions

Attributes – An argument for a DCL tile. They are used in DCL to define a DCL tile function and layout.


AutoCAD PDF – AutoCAD Programmable Dialog Box Facility contains the predefined tiles used to construct a Diametric Dialog Box.
Boxed_column – Is identical to column in all respects except a border is created around the group of tiles.
Children – A set of controls or tiles that are contained within another set of controls or tiles.
Concatenation – A line of text made up of two or more concatenated text_part tiles. The purpose is to allow the programmer to supply a standard message to a dialog box that contains a portion that might be changed during runtime.
DCL – Dialog Control Language, a language used to construct dialog boxes inside of AutoCAD.
DIESEL – Direct Interpretively Evaluated String Expression Language, a language used to modify AutoCAD status bar.
Julian Date – A date format in which a real number is used to represent the current date. In Julian format the integer portion represents the number of days that have passed since the beginning of the first Julian Cycle, January 1, 4713 BC. The fractional portion represents the portion of a 24-hour day that has elapsed for the current Julian day.
Julian Time – Can be calculated using the formula using the formula (H + (M + S/60)/60)24
Prototypes – A custom tile used in a dialog. Prototypes are typically defined when the developer wants to keep a certain consistency among several different dialog boxes or when a particular arrangement of tiles is to be used over and over again in different dialog boxes.
Status Line – The lower region of the AutoCAD window used to display information concerning the current state of AutoCAD to the user.
Subassemblies – A grouping of tiles into rows and columns. Subassemblies can either be enclosed or not enclosed by a border.
Tree Structure – A phrase used to describe the relationship of the child/parent objects an/or tiles. Typically associated with the windows directory structure.
Parent – The main tile as object that contains one or more children.



Download 210.39 Kb.

Share with your friends:
1   2   3   4   5   6   7   8




The database is protected by copyright ©ininet.org 2024
send message

    Main page