0 Members and 1 Guest are viewing this topic.
(defun cotbyl (obj) (cond ((= (type obj) 'VLA-OBJECT) (vlax-put-property obj 'Color acByLayer) (vlax-release-object obj) ) ) )
(setq obj (vlax-ename->vla-object (car (entsel))))(cotbyl obj)
;;; change selected objects color to 'ByLayer';;; ACAD versions 2000-2002(defun c:c2bl (/ ss parse-ss cotbyl) (defun parse-ss (ss / cntr ent obj-lst) (setq cntr 0) (while (setq ent (ssname ss cntr)) (setq obj-lst (cons (vlax-ename->vla-object ent) obj-lst) cntr (1+ cntr) ) ) ; while (if obj-lst (mapcar 'cotbyl obj-lst)) ) ; defun (defun cotbyl (obj) (cond ((= (type obj) 'VLA-OBJECT) (vlax-put-property obj 'Color acByLayer) (vlax-release-object obj) ) ) ) (if (setq ss (ssget)) (parse-ss ss) ) (princ) ); defun
Mark,Let me ask you this....what about MText that has had the color changed in the editor? is there a way to also implement that?Rug
1 offset and erase original line
;; DrawOffset.lsp;; Created by C. Alan Butler 2003;;;;; Draw a poly line and then offset it.;;;;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.;;;;;;;;;;;; error function & Routine Exit(defun *error* (msg) (if (not (member msg '("console break" "Function cancelled" "quit / exit abort") ) ) (princ (strcat "\nError: " msg)) ) ; if (princ)) ; ;end error function;; pre set global variable, it remember your entry ;====================== ; Start of Routine ;======================(defun C:DrawO (/ pt1 pt2 usercmd str en1 en2 );;; ------- Some Housekeeping ------------------ (setq usercmd (getvar "CMDECHO")) (setvar "CMDECHO" 0) (setvar "PLINEWID" 0) (setq useros (getvar "osmode") str "") (setvar "osmode" 175) (prompt "/nPick points, Enter when done.") ;;; Draw the pline (setq pt1 (getpoint)) (command "PLINE" pt1 (Setq pt2 (getpoint pt1))) ;_ COMMAND (while (setq pt2 (getpoint pt2 "\nNext point: "))(command pt2)) ;_ WHILE (command "") (princ) (setq en1 (entlast)) (initget 1) (setq pto (getpoint "\nSide to offset:")) (setq dist (getreal "\nEnter offset distance:")) (command "_.offset" dist en1 pto "") ;(setq en2 (entlast)) (entdel en1) ; remove the user drawn line;;;========== Exit Sequence ============ (setvar "osmode" useros) (setvar "CMDECHO" usercmd);;; Exit quietly (princ)) ;_end of defun;;; Notify user program ready to use(prompt "\n Pline Draw & Offest Loaded: Type 'DrawO' to run it.")(princ)