- (defun C:OC (/ DI LANGLST LAY LST O PO)
- (setq LANGLST '(("ENU"
- "\nCurrent offset dist= "
- "\nEnter Offset Dist:"
- "\nSide to offset"
- )
- ("CHT"
- "\n目前偏移距离= "
- "\n输入偏移距离:"
- "\n选取偏移侧"
- )
- )
- )
- (setq LST (cdr (assoc (getvar "LOCALE") LANGLST)))
- (vl-cmdf "_.undo" "_group")
- (mapcar 'princ
- (list (nth 0 LST) (getvar "OFFSETDIST") " ")
- )
- (setq DI (getstring (nth 1 LST)))
- (setq O (ssget))
- (setq PO (getpoint (nth 2 LST)))
- (setq LAY (getvar "CLAYER"))
- (if (/= DI NIL)
- (command "OFFSET" DI O PO "")
- (command "CHPROP" "L" "" "LA" LAY "LT" "bylayer" "C" "bylayer" "")
- )
- (if (= DI NIL)
- (command "OFFSET" "" O PO "")
- (command "CHPROP" "L" "" "LA" LAY "LT" "bylayer" "C" "bylayer" "")
- )
- (vl-cmdf "_.undo" "_end")
- (princ)
- )
|