- (defun c:Sx (/ ACADOBJECT ACADDOCUMENT FOUND LINETYPESEL GETDS0 OBJ)
- (setq AcadObject (vlax-get-acad-object)
- AcadDocument (vla-get-ActiveDocument Acadobject)
- )
- (setq found :vlax-false)
- (setq LinetypeSel (vla-get-Linetypes AcadDocument))
- (VLAX-FOR entry LinetypeSel
- (IF (= (VLA-GET-NAME ENTRY) "CENTER")
-
- (SETQ FOUND :VLAX-TRUE)
- )
- )
- (IF (= FOUND :VLAX-FALSE)
- (VLA-LOAD LINETYPESEL "CENTER" "ACAD.LIN")
- )
- (if (null vlax-dump-object)
- (vl-load-com)
- )
- (SETVAR "CMDECHO" 0)
- (or *getds* (setq *getds* 90))
- (setq
- getds0 (getdist (strcat "\n输入宽度<" (rtos *getds* 2 3) ">:"))
- )
- (if getds0
- (setq *getds* getds0)
- )
- (while (setq obj (entsel))
- (setq obj (vlax-ename->vla-object (car obj)))
- (vla-offset obj (* 0.5 *getds*))
- (vla-offset obj (* 0.5 *getds* -1))
- (vla-put-color obj 1)
- (vla-put-Linetype Obj "CENTER")
- )
- (SETVAR "CMDECHO" 1)
- (princ)
- )
|