明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索

[函数] 发布基础函数库

    [复制链接]
发表于 2018-4-16 09:04 | 显示全部楼层
13826031454 发表于 2016-1-7 21:44
占个位置,方便找到组织

楼主:
       请看一下,list-utils.lsp中的这个函数好像有问题:
;;;desc:点表转普通表
;;;arg:lst:点表
;;;return:普通表
;;;exampleBF-dot->list '(1 2 3 . 4))
(defun BF-dot->list (lst)
  (if (BF-listp lst)
    lst
    (cond
      ((and lst (listp lst))
       (cons (car lst) (BF-dot->list (cdr lst)))
      )
      ((and lst (not (listp lst)))
       (cons lst (BF-dot->list nil))
      )
      (t nil)
    )
  )
)
; (BF-dot->list '(1 2 3 . 4))
; 错误: no function definition: BF-LISTP
发表于 2019-10-3 10:31 | 显示全部楼层
本帖最后由 1028695446 于 2019-10-3 10:33 编辑

;;;名称:BF-Excel-New
;;;说明:新建Excel工作簿
;;;参数:ishide:是否可见,t为可见,nil为不可见
;;;返回:一个表示Excel工作簿的vla对象
;;;示例BF-Excel-New t)
(Defun BF-Excel-New (ishide / Rtn)
  (if (setq Rtn (vlax-get-or-create-object "Excel.Application"))
    (progn
      (vlax-invoke
        (vlax-get-property Rtn 'WorkBooks)
        'Add
      )
      (if ishide
        (vla-put-visible Rtn 1)
        (vla-put-visible Rtn 0)
      )
    )
  )
  Rtn
)
建议调换下语句,如下:
(Defun BF-Excel-New (ishide / Rtn)
  (if (setq Rtn (vlax-get-or-create-object "Excel.Application"))
    (progn
      (if ishide
        (vla-put-visible Rtn 1)
        (vla-put-visible Rtn 0)
      )
      (vlax-invoke
        (vlax-get-property Rtn 'WorkBooks)
        'Add
      )                       
    )
  )
  Rtn
)

这样新建文档页的时候回自动切换到新页面去,不然还是原有页面,不太方便
发表于 2022-5-22 09:12 | 显示全部楼层
楼主,现在链接无法打开,2022.05.22
发表于 2022-5-22 09:48 | 显示全部楼层
啊    原来这里曾经还有这样好的宝贝,   可惜来晚了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-20 11:10 , Processed in 4.152314 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表