home *** CD-ROM | disk | FTP | other *** search
- ;Function CPROP
- ;
- ;Called with a required argument, which must be a valid
- ;entity association list.
- ;
- ;Changes current LAYER, LINETYPE, THICKNESS, and COLOR settings
- ;to those contained within the entity association list
- ;supplied as an argument.
-
- (defun cprop (elist)
- (command "layer" "s" (cdr (assoc 8 elist)) "")
- (if
- (assoc 6 elist)
- (command "linetype" "s" (cdr (assoc 6 elist)) "")
- (command "linetype" "s" "bylayer" "")
- )
- (if
- (assoc 39 elist)
- (command "elev" 0 (cdr (assoc 39 elist)))
- (command "elev" 0 0)
- )
- (if
- (assoc 62 elist)
- (command "color" (cdr (assoc 62 elist)))
- (command "color" "bylayer")
- )
- )
-
- ;Function C:DENT Draw ENTity
- ;
- ;For AutoCAD Release 10
- ;
- ;DENT prompts user to select an entity, and passes the
- ;entity association list of the selected entity to the
- ;function CPROP. Upon return from CPROP, DENT issues
- ;an AutoCAD command to draw the same type of entity as
- ;the one selected.
- ;
- ;This function is not fully de-bugged, and I expect you to
- ;encounter some situations where you will want to implement
- ;changes to this code. Please be my guest and modify this
- ;to your heart's content. I refuse to honor any requests for
- ;feature changes or bug fixes to this code; you're on
- ;your own. Have fun!
- ;
- ;Written by Brad Zehring
- ;Tuesday March 21, 1989 7:45 pm Sausalito, California
- ;
- ;Based on an idea from Creighton Hoke
-
- (defun C:DENT (/ ename elist)
- (setvar "cmdecho" 0)
- (if
- (setq ename (entsel))
- (progn
- (setq ename (car ename))
- (setq elist (entget ename))
- (cprop elist)
- (setvar "cmdecho" 1)
- (cond
- ((eq "TEXT" (cdr (assoc 0 elist)))
- (command "DTEXT" "Style" (cdr (assoc 7 elist))
- pause
- (cdr (assoc 40 elist))
- (/ (* 180 (cdr (assoc 50 elist))) pi)
- )
- )
- ((eq "POLYLINE" (cdr (assoc 0 elist)))
- (command "PLINE")
- )
- ((eq "INSERT" (cdr (assoc 0 elist)))
- (command "INSERT" (cdr (assoc 2 elist)))
- )
- (t (command (cdr (assoc 0 elist))))
- )
- )
- )
- (prin1)
- )
-