home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p055 / 2.ddi / SUPPORT.LIF / 029.EDRSURF.LSP < prev    next >
Encoding:
Text File  |  1989-05-12  |  1.2 KB  |  51 lines

  1.  
  2. ;    edrsurf - edit a bigd revolved surface
  3.  
  4. (defun c:edrsurf ( / cecho blkname blk insertpt e elast)
  5.     (setq cecho (getvar "CMDECHO"))
  6.     (setvar "CMDECHO" 0)
  7.  
  8.     ; get block name
  9.     (setq blkname nil)
  10.     (while (or (null blkname) (= blkname ""))
  11.         (setq blkname (getstring "\nBIG D block to edit: "))
  12.         (if (null (setq blk (tblsearch "block" blkname)))
  13.             (progn
  14.                 (prompt (strcat "\n*** Error: Block " blkname
  15.                     " does not exist ***"))
  16.                 (setq blkname nil)
  17.             )
  18.         )
  19.     )
  20.  
  21.     ; get insertion point
  22.     (initget 1)
  23.     (setq insertpt (getpoint "Insertion point: "))
  24.  
  25.     ; save the last main entity
  26.     (setq elast (entlast))
  27.  
  28.     ; insert the block as separate parts
  29.     (command "INSERT" (strcat "*" blkname) insertpt "" "")
  30.  
  31.     ; if no entities previously existed, start with first entity
  32.     (if (null elast)
  33.         (setq elast (entnext))
  34.         (setq elast (entnext elast)))
  35.  
  36.     ; delete all new non-valid entities
  37.     (while (setq e elast)
  38.         (setq etype (cdr (assoc 0 (entget e))))
  39.         (if (or (= etype "POLYLINE") (= etype "ATTDEF"))
  40.             (entdel e)
  41.             (setq elast (entnext elast))
  42.         )
  43.     )
  44.  
  45.     ; redraw the screen
  46.     (command "REDRAW")
  47.  
  48.     (setvar "CMDECHO" cecho)
  49.     (princ)
  50. )
  51.