2
5
3
初来乍到
(defun c:ENDT ( / );define function(setvar "cmdecho" 0);switch off command echo (prompt "\nSelect the entity to Modify data : ");prompt the user (setq e (entget (car (entsel)) '("AFRALISP")));get the associative code list(setq e1 (assoc -3 e));get the xdata(if (not e1);if there is no exdata(progn;do the following(if (not (tblsearch "APPID" "AFRALISP"));check if the application has been registered (regapp "AFRALISP") ;if not, register it);if (setq e1 '(( -3 ("AFRALISP" (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") (1000 . " ") )))) ;create a default xdata list (setq e (append e e1)) ;append to to the main list (entmod e) ;modify the entity );progn);if(setq e2 (assoc -3 e));get the code -3 list(setq e3 (car (cdr e2)));get the exdata list(setq PN (cdr (nth 1 e3)));get the partnumber index number(setq EV (cdr (nth 2 e3)));get the elevation index number(setq DS (cdr (nth 3 e3)));get the description index number (setq LE (cdr (nth 4 e3)));get the Leading Angle index number(setq TR (cdr (nth 5 e3)));get the trainling Angle index number(setq FL (cdr (nth 6 e3)));get the floor index number (setq TA (cdr (nth 7 e3)));get the tag index number(setq CO (cdr (nth 8 e3)));get the color index number(setq LN (cdr (nth 9 e3)));get the length index number (setq QU (cdr (nth 10 e3)));get the quanity index number(setq userclick T);set flag(setq PN1 PartNumber);Part Number Entry (setq EL1 Elevation);Elevation Value Entry (setq DS1 Description);Description value entry (setq LE1 Langle);Part leading angle entry (setq TR1 Tangle);part trailing angle entry (setq FL1 Floor);floor (setq TA1 Tag);Tag