Monday, 18 February 2013

Change Text Style

(defun c:CTS(/ *error* adoc sset userkey ApplyStyle CreateTextStyles) (vl-load-com) ;Load activex Support (defun *error* (s) (if adoc (vla-endundomark adoc)) (if (not (member s '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n---->Error:" s)) ) (princ) ) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setq cmh (getvar 'cmdecho)) (vla-startundomark adoc) (setvar 'cmdecho 0) ;;Apply Text Styles (defun CreateTextStyles (name ttf) (if (not (tblsearch "STYLE" name)) (progn ...

Polyline Measurments

Info : Creates Distance Text  to Selected Polylines , Lwpolyline and Line (defun c:mse (/ *error* adoc space sset i ang e en p s nd _Text c pp p1 p2) (vl-load-com) (defun *error* (x) (if adoc (vla-endundomark adoc) ) (cond ((not x)) ((member x '("Function cancelled" "quit / exit abort"))) ((princ (strcat "\n----> Error:" x))) ) (princ) ) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setq space (vla-get-modelspace adoc)) (vla-startundomark adoc) (prompt "\nSelect...

Line Total

(defun c:Line_Total(/ sset *adco* total len) ;;Author:Ganesh Shetty, Copyright © 2013 -http://autolispgs.blogspot.in   (vl-load-com)   (if (setq sset (ssget "_:L" '((-4 . "<Or") (0 . "POLYLINE") (0 . "LINE") (0 . "LWPOLYLINE") (-4 . "or>")) ) )     (progn       (setq *adoc*(vla-get-activedocument(vlax-get-acad-object)))       (setq total 0)       (vlax-for x (setq sset(vla-get-activeselectionset *adoc*)) (setq len(vlax-curve-getdistatparam x (vlax-curve-getendparam...

Create New Layer

Autolisp Codes : (defun c:Newlayer (/ Layername Color)   ;;Author:Ganesh Shetty, Copyright © 2013 -http://autolispgs.blogspot.in   (setq Layername(getstring "\nEnter New Layer Name:"))   (if (not (Tblsearch "LAYER" Layername))     (progn       (setq color(getint "\nEnter Color Type for New Layer:"))       (command "_Layer" "New" layername "c" color layername "")       (princ(strcat "\nLayer \"" layername "\"Created ."))     )     (princ "\nLayer Name...

Set Current Layer

Autolisp Codes: (defun c:Sl(/ old_cmh sel ent laynme ) ;;Author:Ganesh Shetty, Copyright © 2013 -http://autolispgs.blogspot.in   (setq old_cmh(getvar 'cmdecho))   (setvar 'cmdecho 0)   (if (setq sel (car (entsel "\nSelect an Object to set Layer Current:")))     (progn       (setq ent(entget sel))       (setq laynme(cdr (assoc 8 ent)))       (command "_Layer" "set" laynme "")       (princ (strcat "\nLayer \""   laynme "\" is  Current Now:"))  ...

Match Layer

(defun c:Cl (/ *error* adoc sset e lay layname e changelayer) (defun *error* (s) (if adoc (vla-endundomark adoc)) (if (not (member s '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n---->Error:" s)) ) (princ) ) (defun changelayer (ent name / ss ename i) (if (> (sslength ent) 1) (princ (strcat "\n"(rtos (sslength ent) 2 0) " objects changed Layer to \"" name "\"")) (princ (strcat "\nOne object changed Layer to \"" name "\"")) ) (repeat (setq i(sslength ent)) (setq ss(ssname ent(setq...

Change Text Height Globally

(defun c:CTH(/ *error* adoc sset value i en) (vl-load-com);Load Activex Support (defun *error* (s) (if adoc (vla-endundomark adoc)) (if (not (member s '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n---->Error:" s)) ) (princ) ) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark adoc) (if (and (setq sset (ssget '((0 . "TEXT,MTEXT")))) (setq value (getreal "\nEnter New Height Value:")) ) (progn (if (<= value 0) (*error* "Negative Values Not...

Change Rotation Angle

(defun c:CTR(/ *error* ) (vl-load-com);Load Activex Support (defun *error* (s) (if adoc (vla-endundomark adoc)) (if (not (member s '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n---->Error:" s)) ) (princ) ) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark adoc) (if (and (setq sset (ssget '((0 . "TEXT,MTEXT")))) (setq value (getreal "\nEnter New Rotation Value in Degrees:")) ) (progn (if (< value 0) (*error* "Negative Values Not Allowed") ...