明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1895|回复: 3

程序修改

[复制链接]
发表于 2012-2-25 13:07:28 | 显示全部楼层 |阅读模式
  1. (defun c:chColor (/ col ss n)
  2.   (if
  3.     (and (setq ss (ssget))
  4.          (progn
  5.            (setq col (acad_colordlg 7))
  6.            (while (not col)
  7.              (if (setq col (getint "\n指定颜色索引号(0~256): "))
  8.                (if (<= 0 col 256)
  9.                  T
  10.                  (progn (setq col nil) (princ "\n需要 0~256 的整数。"))
  11.                )
  12.              )
  13.            )
  14.            col
  15.          )
  16.     )
  17.      (repeat (setq n (sslength ss))
  18.        (vla-put-color
  19.          (vlax-ename->vla-object (ssname ss (setq n (1- n))))
  20.          col
  21.        )
  22.      )
  23.   )
  24.   (princ)
  25. )
上面这段程序执行起来,出现:错误: no function definition: vlax-ename->vla-object
请高手帮我看看修改一下,谢谢

发表于 2012-2-25 13:43:20 | 显示全部楼层
先加载  (vl-load-com) 再试
发表于 2012-2-25 13:45:04 | 显示全部楼层
这个程序没有问题
如果“出现:错误: no function definition: vlax-ename->vla-object”
可在最前面加一句
(vl-load-com)
试试
发表于 2012-2-25 15:35:48 | 显示全部楼层
楼上各位均为正解!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-9-25 02:36 , Processed in 0.147945 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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