home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / ACADWIN / SAMPLE / BMAKE.LSP < prev    next >
Encoding:
Lisp/Scheme  |  1995-07-14  |  18.9 KB  |  577 lines

  1. ; Next available MSG number is    19
  2. ; MODULE_ID LSP_BMAKE_LSP_
  3. ;;;---------------------------------------------------------------------------;
  4. ;;;
  5. ;;;   BMAKE.LSP   Version 0.5
  6. ;;;
  7. ;;;   (C) Copyright 1988-1995 by Autodesk, Inc.
  8. ;;;  
  9. ;;;   This program is copyrighted by Autodesk, Inc. and is  licensed
  10. ;;;   to you under the following conditions.  You may not distribute
  11. ;;;   or  publish the source code of this program in any form.   You
  12. ;;;   may  incorporate this code in object form in derivative  works
  13. ;;;   provided  such  derivative  works  are  (i.) are  designed and
  14. ;;;   intended  to  work  solely  with  Autodesk, Inc. products, and
  15. ;;;   (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  16. ;;;   1988-1994 by Autodesk, Inc."
  17. ;;;
  18. ;;;   AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  19. ;;;   AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  20. ;;;   CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  21. ;;;   DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  22. ;;;   UNINTERRUPTED OR ERROR FREE.
  23. ;;;   
  24. ;;;   by Kieran V. McKeogh
  25. ;;;   28 Feb 1991
  26. ;;;   
  27. ;;;---------------------------------------------------------------------------;
  28. ;;;  DESCRIPTION
  29. ;;;
  30. ;;;  Programming example of defining blocks using (entmake) with a dialog
  31. ;;;  interface.  Uses BMAKE.LSP/DCL.
  32. ;;;---------------------------------------------------------------------------;
  33.  
  34. ;;; ===================== load-time error checking ============================
  35.  
  36.   (defun ai_abort (app msg)
  37.      (defun *error* (s)
  38.         (if old_error (setq *error* old_error))
  39.         (princ)
  40.      )
  41.      (if msg
  42.        (alert (strcat " Error de aplicaci≤n: "
  43.                       app
  44.                       " \n\n  "
  45.                       msg
  46.                       "  \n"
  47.               )
  48.        )
  49.      )
  50.      (exit)
  51.   )
  52.  
  53. ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
  54. ;;; and then try to load it.
  55. ;;;
  56. ;;; If it can't be found or it can't be loaded, then abort the
  57. ;;; loading of this file immediately, preserving the (autoload)
  58. ;;; stub function.
  59.  
  60.   (cond
  61.      (  (and ai_dcl (listp ai_dcl)))          ; it's already loaded.
  62.  
  63.      (  (not (findfile ;|MSG0|;"ai_utils.lsp"))                     ; find it
  64.         (ai_abort "BMAKE"
  65.                   (strcat "Imposible localizar el archivo AI_UTILS.LSP."
  66.                           "\n Comprobar el directorio de soporte.")))
  67.  
  68.      (  (eq ;|MSG0|;"failed" (load ;|MSG0|;"ai_utils" ;|MSG0|;"failed"))            ; load it
  69.         (ai_abort "BMAKE" "Imposible cargar el archivo AI_UTILS.LSP"))
  70.   )
  71.  
  72.   (if (not (ai_acadapp))               ; defined in AI_UTILS.LSP
  73.       (ai_abort "BMAKE" nil)           ; a Nil <msg> supresses
  74.   )                                    ; ai_abort's alert box dialog.
  75.  
  76. ;;; ==================== end load-time operations ===========================
  77.  
  78. ;;;---------------------------------------------------------------------------;
  79. ;;; The Main Function which pops up the dialogue with the defaults.  A while
  80. ;;; loop is used to allow the dialogue to be hidden for point and object
  81. ;;; selection.  
  82. ;;;---------------------------------------------------------------------------;
  83. (defun c:bmake (/ bname unnamed x_pt y_pt z_pt retain selection_set)
  84.   ;;
  85.   ;;  Main error routine.
  86.   ;;
  87.   (defun bmake_error (s)                ; If an error (such as CTRL-C) occurs
  88.     (if (/= s "Funci≤n cancelada.")
  89.       (princ (strcat "\nError: " s))
  90.     )
  91.     (if olderr (setq *error* olderr)) ; Restore old *error* handler
  92.     (princ)
  93.   )
  94.   ;;
  95.   ;; If unnamed is toggled on, disable Block Name edit box and vice versa.
  96.   ;;
  97.   (defun do_unnamed()
  98.     (rs_error)
  99.     (mode_tile ;|MSG0|;"bname" (setq unnamed (atoi (get_tile ;|MSG0|;"unnamed"))))
  100.   )
  101.   ;;
  102.   ;; Check validity of the Block name.
  103.   ;;
  104.   (defun do_bname()
  105.     (check_name (setq bname (xstrcase (get_tile ;|MSG0|;"bname"))))
  106.   )
  107.   ;;
  108.   ;;  Figure defaults, for initial dialogue and when returning from object 
  109.   ;;  selection or point picking.
  110.   ;;
  111.   (defun defaults()
  112.     (if bname 
  113.       (set_tile ;|MSG0|;"bname" bname)
  114.     )               
  115.     (if (= 0 retain) 
  116.       (set_tile ;|MSG0|;"retain" ;|MSG0|;"0") 
  117.       (progn 
  118.         (set_tile ;|MSG0|;"retain" ;|MSG0|;"1") 
  119.         (setq retain 1)
  120.       )
  121.     )
  122.     (if (= 1 unnamed) 
  123.       (progn 
  124.         (mode_tile ;|MSG0|;"bname" 1)
  125.         (set_tile ;|MSG0|;"unnamed" ;|MSG0|;"1")
  126.       )
  127.     ) 
  128.     (if x_pt 
  129.       (set_tile ;|MSG0|;"x_pt" x_pt)
  130.       (progn 
  131.         (set_tile ;|MSG0|;"x_pt" (rtos 0.0000 2))
  132.         (setq x_pt (rtos 0.0000 2))
  133.       )
  134.     )
  135.     (if y_pt 
  136.       (set_tile ;|MSG0|;"y_pt" y_pt)
  137.       (progn 
  138.         (set_tile ;|MSG0|;"y_pt" (rtos 0.0000 2))
  139.         (setq y_pt (rtos 0.0000 2))
  140.       )
  141.     )
  142.     (if z_pt 
  143.       (set_tile ;|MSG0|;"z_pt" z_pt)          
  144.       (progn 
  145.         (set_tile ;|MSG0|;"z_pt" (rtos 0.0000 2))
  146.         (setq z_pt (rtos 0.0000 2))
  147.       )
  148.     )
  149.     (set_tile ;|MSG0|;"how_many" 
  150.               (if (/= selection_set nil) 
  151.                 (rtos (sslength selection_set) 2 0) 
  152.                 ;|MSG0|;"0"
  153.               )
  154.     )
  155.   )
  156.   ;;
  157.   ;;  X coordinate action.
  158.   ;;
  159.   (defun do_x_pt()
  160.     (check_real (setq x_pt (get_tile ;|MSG0|;"x_pt")) ;|MSG0|;"x_pt")   ; if valid input
  161.   )
  162.   ;;
  163.   ;;  Y coordinate action.
  164.   ;;
  165.   (defun do_y_pt()
  166.     (check_real (setq y_pt (get_tile ;|MSG0|;"y_pt")) ;|MSG0|;"y_pt")   ; if valid input
  167.   )
  168.   ;;
  169.   ;;  Z coordinate action.
  170.   ;;
  171.   (defun do_z_pt()
  172.     (check_real (setq z_pt (get_tile ;|MSG0|;"z_pt")) ;|MSG0|;"z_pt")   ; if valid input
  173.   )
  174.   ;;
  175.   ;; Reset the error tile to null.
  176.   ;;
  177.   (defun rs_error()
  178.     (set_tile ;|MSG0|;"error" "")
  179.   )
  180.   ;;
  181.   ;;  This function checks the validity of the coordinates.  It returns the
  182.   ;;  real number or nil.
  183.   ;;
  184.   (defun check_real (real_number coord)
  185.     (if (distof real_number 2)
  186.       (progn 
  187.         (rs_error) 
  188.         real_number
  189.       )
  190.       (progn 
  191.         (set_tile ;|MSG0|;"error" 
  192.                   (strcat "No vßlido " 
  193.                           (strcase (substr coord 1 1)) 
  194.                           " coordenada."
  195.                   )
  196.         )
  197.         nil
  198.       )
  199.     )
  200.   ) 
  201.   ;;
  202.   ;;  This function checks the validity of the Block name.  If legitimate, the  
  203.   ;;  Block name is returned, nil otherwise.
  204.   ;;
  205.   (defun check_name(name)
  206.     (if (wcmatch name ;|MSG0|;"*[] `#`@`.`?`*`~`[`,`'!%^&()+={}|`\\:;\"<>/]*")
  207.       (progn
  208.         (set_tile ;|MSG0|;"error" "Caracteres no vßlidos en el nombre del bloque.") 
  209.         nil
  210.       )
  211.       (progn 
  212.         (rs_error)
  213.         name
  214.       )
  215.     )
  216.   )
  217.   ;;
  218.   ;;  This function is called on OK in the main dialogue.  It confirms that all 
  219.   ;;  input is correct and whether the block name already exists...
  220.   ;;
  221.   (defun bexist()
  222.     (setq reference 0)
  223.     (cond
  224.       ;; Check each coordinate.
  225.       ((not (check_real x_pt ;|MSG0|;"x_pt"))) 
  226.       ((not (check_real y_pt ;|MSG0|;"y_pt"))) 
  227.       ((not (check_real z_pt ;|MSG0|;"z_pt"))) 
  228.   
  229.       ;; If block name is null, give message.
  230.       ((and (/= 1 unnamed)
  231.             (or (not bname) (= "" bname))
  232.        ) 
  233.         (set_tile ;|MSG0|;"error" "Nombre de bloque nulo no permitido.")
  234.       ) 
  235.  
  236.       ;; Self-referencing check, check_ref returns T on a self reference.
  237.       ((and selection_set (check_ref)))
  238.  
  239.       ;; If the name exists, question via dialogue to overwrite it.
  240.       ((and (member bname table_list) (/= 1 unnamed))
  241.         (if (not (new_dialog ;|MSG0|;"bname_exists" dcl_id)) (exit))   
  242.         (action_tile ;|MSG0|;"yes" ;|MSG0|;"(done_dialog 2)")
  243.         (action_tile ;|MSG0|;"no" ;|MSG0|;"(done_dialog 0)")
  244.         (if (= (start_dialog) 2) (done_dialog 2))        
  245.       )
  246.  
  247.       ;; If a new named block, check validity of name.
  248.       ((/= unnamed 1) 
  249.         (if (check_name bname)
  250.           (done_dialog 2) 
  251.           T
  252.         )
  253.       )
  254.       ;; If unnamed, just make it.
  255.       ((= 1 unnamed) (done_dialog 2))
  256.       ;; if none of above then error.
  257.       (t (princ "\nError de programaci≤n en bexist()."))
  258.     )
  259.   )
  260.   ;;
  261.   ;; Check to see if the block contains a self reference.
  262.   ;;
  263.   (defun check_ref (/ ref)
  264.     (setq a 0)
  265.     (setq self_list '())
  266.     ;; make a list of all insert entities in the selection set.
  267.     (while (< a (setq ss_length (sslength selection_set)))
  268.       (if (= (cdr (assoc '0 (entget (ssname selection_set a)))) ;|MSG0|;"INSERT")
  269.         (setq self_list 
  270.               (cons (cdr (assoc '2 (entget (ssname selection_set a)))) 
  271.                     self_list
  272.               )
  273.         )
  274.       )
  275.       (setq a (1+ a))
  276.     )
  277.     (cond 
  278.       ;; if bname is in the selection set, report error.
  279.       ((and self_list (member bname self_list))     
  280.         (set_tile ;|MSG0|;"error" "Error - este bloque hace referencia a si mismo.")
  281.       )
  282.       ;; 
  283.       ((and self_list (self_ref bname self_list))
  284.         (set_tile ;|MSG0|;"error" "Error - este bloque hace referencia a si mismo.")
  285.       )
  286.       (t nil)
  287.     )
  288.   )
  289.   ;;
  290.   ;; This recursive function takes two arguments, a Block name and a list of
  291.   ;; Block names.  It checks to see whether any of the Blocks in the list 
  292.   ;; contain  a reference to the first argument.  Recursion is used to take 
  293.   ;; care of possible nested references.  Candidate for rainy day optimisation.
  294.   ;;
  295.   (defun self_ref (self others / ref other_list)
  296.     (setq other_list '())
  297.     (foreach n others 
  298.       (setq en1 (cdr (assoc '-2 (tblsearch ;|MSG0|;"block" n)))) ; first entity 
  299.       (while en1
  300.         (if (and (= ;|MSG0|;"INSERT" (cdr (assoc '0 (entget en1))))
  301.                  (not (member 
  302.                         (setq other_name (cdr (assoc '2 (entget en1)))) 
  303.                         others
  304.                       )
  305.                  )
  306.              )
  307.           (setq other_list (cons other_name other_list))
  308.         )
  309.         (setq en1 (entnext en1))
  310.       )    
  311.       (if (and other_list
  312.                (member self other_list)
  313.           )
  314.         (setq ref t) 
  315.         (self_ref self other_list)
  316.       )
  317.     )
  318.     ref                              ; return t on a self reference, else nil.
  319.   )              
  320.   ;;
  321.   ;; This function, when passed a symbol table name, returns a list of 
  322.   ;; entries in that table.  
  323.   ;;
  324.   (defun get_table (table_name)
  325.     (setq table_item (tblnext table_name T))
  326.     (setq table_list '())                          
  327.     (while (and table_item)
  328.       (setq just_name (cdr (assoc 2 table_item)))
  329.       (setq table_list (cons just_name table_list))
  330.       (setq table_item (tblnext table_name))
  331.     ) 
  332.   )
  333.   ;;
  334.   ;; Displays a nested dialogue containing an edit box for wildcards and
  335.   ;; a list box of the associated blocks in the drawing.
  336.   ;;
  337.   (defun list_blocks()    
  338.     (setq bl_match '())
  339.     (if (not (new_dialog ;|MSG0|;"list_blocks" dcl_id)) (exit))
  340.     (if (not pat) (setq pat ;|MSG0|;"*"))
  341.     (set_tile ;|MSG0|;"pattern" pat)
  342.     (pat_match pat)
  343.     (action_tile ;|MSG0|;"bl_match" ;|MSG0|;"(set_tile \"bl_match\" \"\")")
  344.     (action_tile ;|MSG0|;"pattern" ;|MSG0|;"(pat_match (setq pat (xstrcase $value)))")
  345.     (action_tile ;|MSG0|;"accept" ;|MSG0|;"(done_dialog 0)")
  346.     (start_dialog)
  347.   )
  348.   ;;
  349.   ;; This function displays the block list based on the pattern.
  350.   ;;
  351.   (defun pat_match (pat)
  352.     (setq bl_match '())
  353.     (foreach n table_list 
  354.       (if (wcmatch n pat) 
  355.         (setq bl_match (cons n bl_match))
  356.       )
  357.     )
  358.     (if (>= (getvar ;|MSG0|;"maxsort") (length bl_match)) ; Alphabetise the list
  359.       (setq bl_match (sort bl_match))             ; in accordance with maxsort
  360.     )
  361.     (start_list ;|MSG0|;"bl_match")
  362.     (mapcar 'add_list bl_match)
  363.     (end_list)
  364.   )
  365.   ;;
  366.   ;; Alphabetize a list.
  367.   ;;
  368.   (defun sort (list1 / item1 item2)
  369.     (setq item1 (car list1))
  370.     (foreach item2 (cdr list1)
  371.       (if (> item2 item1)
  372.         (setq item1 item2)
  373.       )
  374.     )
  375.     (if list1
  376.       (append
  377.         (sort
  378.           (append  (cdr (member item1 list1))
  379.                    (cdr (member item1 (reverse list1))))
  380.         )
  381.         (list item1)
  382.       )
  383.     )
  384.   )
  385.   ;;
  386.   ;; Routine that makes the block.
  387.   ;;
  388.   (defun entmake_block()
  389.     (setq a 0)
  390.     (setq att 0)
  391.  
  392.     ;; Check selection set for an ATTDEF.  
  393.     (if selection_set 
  394.       (while (< a (sslength selection_set))            
  395.         (if (= ;|MSG0|;"ATTDEF" (cdr (assoc '0 (entget (ssname selection_set a)))))
  396.           (setq att 1 a (+ (sslength selection_set) a)) 
  397.         )
  398.       (setq a (1+ a))
  399.     ))
  400.  
  401.     ;; Set header_name and 70 flag depending on named/unnamed and whether an 
  402.     ;; ATTDEF exists. 
  403.     (cond 
  404.       ((= unnamed 1) 
  405.         (setq header_name ;|MSG0|;"*U")
  406.         (if (= 1 att) (setq flag70 (+ 1 2)) (setq flag70 1))
  407.       )
  408.       ((setq header_name bname)
  409.         (if (= 1 att) (setq flag70 (+ 64 2)) (setq flag70 64))
  410.       )
  411.     )
  412.     ;; Block header information.
  413.     (setq header (list
  414.       (cons 0 ;|MSG0|;"block")
  415.       (cons 2 header_name)
  416.       (cons 70 flag70)
  417.       (cons 3 "")
  418.       (list 10 0.0 0.0 0.0)
  419.     ))
  420.     (setq a 0)
  421.  
  422.     ;; Start (entmake)ing the entities...
  423.     (if (entmake header)    
  424.       (progn 
  425.         (if selection_set 
  426.           (while (< a (sslength selection_set))  
  427.             (ent_copy (ssname selection_set a) 
  428.                       (- (atof x_pt)) 
  429.                       (- (atof y_pt))
  430.                       (- (atof z_pt)))
  431.             (setq a (1+ a))
  432.           )
  433.         )
  434.       )
  435.     )
  436.     (entmake (list (cons 0 ;|MSG0|;"endblk")))    ; Entmake the block end.
  437.  
  438.     (if (= 0 retain)              ; Delete entities after entmake is sucessful.
  439.       (progn
  440.         (setq a 0)
  441.         (if selection_set
  442.           (while (< a (sslength selection_set))
  443.             (entdel (ssname selection_set a))
  444.             (setq a (1+ a))
  445.           )
  446.         )
  447.       )  
  448.     )
  449.   )
  450.   ;;
  451.   ;; Routine that copies an entity to a new location.  Pass the ename and the
  452.   ;; X, Y, and Z coordinates of the displacement vector and a new entity is
  453.   ;; created.
  454.   ;;
  455.   (defun ent_copy(ent x2 y2 z2)
  456.     (setq ent_type (cdr (assoc 0 (entget ent))))
  457.     (setq ent_list (cdr (entget ent (list ;|MSG0|;"*"))))      ; don't forget the xdata.
  458.  
  459.     ;; A cond with two choices, a complex entity or a regular entity.
  460.     (cond 
  461.       ;; Complex entities like Polyline and Insert with attributes.
  462.       ((or (= ;|MSG0|;"POLYLINE" ent_type)
  463.            (and (= ;|MSG0|;"INSERT" ent_type) (= 1 (cdr (assoc '66 ent_list))))
  464.        ) 
  465.         (if (= ;|MSG0|;"POLYLINE" ent_type) 
  466.           (entmake ent_list)     ; Make polyline header with no changes.
  467.           (entmake               ; Insert needs it's 10 group updated.
  468.             (subst (mapcar '+ (list 0 x2 y2 z2) (assoc 10 ent_list))
  469.                    (assoc 10 ent_list) 
  470.                    ent_list
  471.             )
  472.           )
  473.         )
  474.         (while (/= ;|MSG0|;"SEQEND" (cdr (assoc '0 (entget (entnext ent)))))
  475.           (entmake 
  476.             (subst (mapcar '+ (list 0 x2 y2 z2) 
  477.                               (assoc 10 (cdr (entget (entnext ent))))
  478.                    )
  479.                    (assoc 10 (cdr (entget (entnext ent)))) 
  480.                    (cdr (entget (entnext ent)))
  481.             )       
  482.           )
  483.           (setq ent (entnext ent))
  484.         )
  485.         (entmake '((0 . ;|MSG0|;"SEQEND")))
  486.       ) 
  487.       (t 
  488.         (foreach n '(10 11 12 13 14 15 16)
  489.           (if (assoc n ent_list)
  490.             (progn 
  491.               (setq ent_list
  492.                     (subst (mapcar '+ (list 0 x2 y2 z2) (assoc n ent_list));new
  493.                            (assoc n ent_list)                              ;old 
  494.                            ent_list                                       ;list
  495.                     )
  496.               )                                         
  497.             )
  498.           )
  499.         )
  500.         (entmake ent_list)              ; make the copy
  501.       )
  502.     )
  503.   )
  504.  
  505.   ;; Main BMAKE routine
  506.  
  507.   (defun bmake_main (/ dcl_id olderr what_next )
  508.     (if (< (setq dcl_id (load_dialog ;|MSG0|;"bmake.dcl")) 0) (exit))
  509.     (setq olderr  *error*
  510.           *error* bmake_error)
  511.     (get_table ;|MSG0|;"block")               ; Make a list of blocks in the drawing.
  512.     (setq what_next 5)
  513.     (while (< 2 what_next)            ; Start the dialogue.
  514.       (if (not (new_dialog ;|MSG0|;"bmake" dcl_id)) (exit))
  515.       ;; Set up defaults, for initial load and when returning from object
  516.       ;; selection or point picking.
  517.       (defaults)
  518.       (if (= 5 what_next) (mode_tile ;|MSG0|;"bname" 2)) ; set focus to block name.
  519.       ;; Define what happens when each control is picked.  Mode_tile is
  520.       ;; used to set focus to the next relevant action, cuts down mouse
  521.       ;; handling in the dialogue.
  522.       (action_tile ;|MSG0|;"bname"       ;|MSG0|;"(do_bname)")
  523.       (action_tile ;|MSG0|;"unnamed"     ;|MSG0|;"(do_unnamed)")
  524.       (action_tile ;|MSG0|;"pick_pt"     ;|MSG0|;"(done_dialog 4)")
  525.       (action_tile ;|MSG0|;"x_pt"        ;|MSG0|;"(do_x_pt)")
  526.       (action_tile ;|MSG0|;"y_pt"        ;|MSG0|;"(do_y_pt)")
  527.       (action_tile ;|MSG0|;"z_pt"        ;|MSG0|;"(do_z_pt)")
  528.       (action_tile ;|MSG0|;"sel_objs"    ;|MSG0|;"(done_dialog 3)")
  529.       (action_tile ;|MSG0|;"list_blocks" ;|MSG0|;"(list_blocks)")
  530.       (action_tile ;|MSG0|;"retain"      ;|MSG0|;"(setq retain (atoi $value))")
  531.       (action_tile ;|MSG0|;"accept"      ;|MSG0|;"(bexist)")
  532.       (action_tile ;|MSG0|;"cancel"      ;|MSG0|;"(done_dialog 0)")
  533.       (action_tile ;|MSG0|;"help"        ;|MSG0|;"(help \"\" \"block\")")
  534.  
  535.       (setq what_next (start_dialog)) ; Throw up the dialogue.
  536.  
  537.       (cond                           ; Decide what to do next.
  538.         ;; If select objects was picked...
  539.         ((= what_next 3)
  540.           (setq selection_set
  541.                 ;; disallow viewports and shapes as these cannot be (entmake)d
  542.                 ;; currently.
  543.                 (ssget '((-4 . ;|MSG0|;"<AND")
  544.                            (-4 . ;|MSG0|;"<NOT")(0 . ;|MSG0|;"VIEWPORT")(-4 . ;|MSG0|;"NOT>")
  545.                            (-4 . ;|MSG0|;"<NOT")(0 . ;|MSG0|;"SHAPE")(-4 . ;|MSG0|;"NOT>")
  546.                         (-4 . ;|MSG0|;"AND>"))
  547.                 )
  548.           )
  549.           (rs_error)
  550.         )
  551.         ;; If base point was picked...
  552.         ((= what_next 4)
  553.           (initget 1)
  554.           (setq pick_pt (getpoint "Punto de base para la inserci≤n: "))
  555.           (setq x_pt (rtos (car pick_pt) 2 4))
  556.           (setq y_pt (rtos (cadr pick_pt) 2 4))
  557.           (setq z_pt (rtos (caddr pick_pt) 2 4))
  558.         )
  559.       )
  560.     )
  561.     ;; If OK was picked.
  562.     (if (= what_next 2)
  563.          (entmake_block)
  564.     )
  565.     (setq *error* olderr)
  566.   )
  567.  
  568.   (if (ai_notrans) (bmake_main))      ; BMAKE can't be used transparently
  569.   (princ)
  570. )
  571.  
  572. ;;;---------------------------------------------------------------------------;
  573. ;;; This is printed on loading.
  574. ;;;---------------------------------------------------------------------------;
  575. (princ "\nC:BMAKE cargado. Iniciar el comando con BMAKE.")
  576. (princ)
  577.