home *** CD-ROM | disk | FTP | other *** search
-
- ; edrsurf - edit a bigd revolved surface
-
- (defun c:edrsurf ( / cecho blkname blk insertpt e elast)
- (setq cecho (getvar "CMDECHO"))
- (setvar "CMDECHO" 0)
-
- ; get block name
- (setq blkname nil)
- (while (or (null blkname) (= blkname ""))
- (setq blkname (getstring "\nBIG D block to edit: "))
- (if (null (setq blk (tblsearch "block" blkname)))
- (progn
- (prompt (strcat "\n*** Error: Block " blkname
- " does not exist ***"))
- (setq blkname nil)
- )
- )
- )
-
- ; get insertion point
- (initget 1)
- (setq insertpt (getpoint "Insertion point: "))
-
- ; save the last main entity
- (setq elast (entlast))
-
- ; insert the block as separate parts
- (command "INSERT" (strcat "*" blkname) insertpt "" "")
-
- ; if no entities previously existed, start with first entity
- (if (null elast)
- (setq elast (entnext))
- (setq elast (entnext elast)))
-
- ; delete all new non-valid entities
- (while (setq e elast)
- (setq etype (cdr (assoc 0 (entget e))))
- (if (or (= etype "POLYLINE") (= etype "ATTDEF"))
- (entdel e)
- (setq elast (entnext elast))
- )
- )
-
- ; redraw the screen
- (command "REDRAW")
-
- (setvar "CMDECHO" cecho)
- (princ)
- )