补充wyb-if类的函数。
都算是比较简单和通用的函数,就不挂附件了,直接贴出来。
- ;|= 3.5. 判断是否val对象
- @== (wyb-if-vlaObject obj)
- #== return: t / nil
- ====================|;
- (defun wyb-if-vlaObject (@obj)
- (equal (type @obj) 'vla-object)
- )
- ;|= 3.6. 判断是否字符串
- @== (wyb-if-string x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-string (@x)
- (equal (type @x) 'str)
- )
- ;|= 3.7. 判断是否实数
- @== (wyb-if-real x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-real (@x)
- (equal (type @x) 'real)
- )
- ;|= 3.8. 判断是否ename对象
- @== (wyb-if-ename x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-ename (@x)
- (equal (type @x) 'ename)
- )
- ;|= 3.9. 判断是否变体
- @== (wyb-if-variant x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-variant (@x)
- (equal (type @x) 'variant)
- )
- ;|= 3.10. 判断是否是选择集且长度不为0
- @== (wyb-if-ssp ss)
- #== return: t / nil
- ====================|;
- (defun wyb-if-ssp (@ss)
- (and (= (type @ss) 'PICKSET) (> (sslength @ss) 0))
- )
- ;|= 3.11. 判断是否为点对表
- @== (wyb-if-consp lst)
- #== return: t / nil
- ====================|;
- (defun wyb-if-consp (@lst)
- (and (vl-consp @lst)(not (vl-list-length @lst)))
- )
- ;|= 3.12. 判断是否为整数
- @== (wyb-if-int x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-int (@x)
- (= (type @x) 'INT)
- )
- ;|= 3.13. 判断是否为整数或整实数
- @== (wyb-if-int2 x)
- #== return: t / nil
- ====================|;
- (defun wyb-if-int2 (@x)
- (= (fix @x) @x)
- )
- ;|= 3.14. 判断字符串首字符是否中文字符
- @== (wyb-if-chiCh str)
- #== return: T / nil
- par:
- sample:
- (wyb-if-chiCh "好") ;;return: T
- (wyb-if-chiCh "1") ;;return: nil
- ver:
- [1.0] by woyb 20170425
- ====================|;
- (defun wyb-if-chiCh (@str)
- (> (ascii (substr @str 1 1)) 127)
- )
|