明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 369|回复: 2

[提问] 请教vla-put-Center 出错了,什么问题

[复制链接]
发表于 2018-3-1 17:09 | 显示全部楼层 |阅读模式
  • (defun c:TT(/ ec area v_c)
  •   (vl-load-com)
  •   (setq ec(car (entsel "\n选择一个圆:")));获取圆的图元名
  •   (setq pt(getpoint "\n输入圆的新的面积:"));   
  •   (setq v_c(vlax-ename->vla-object ec));将圆的图元名转换为VLA对象
  •   (vla-put-Center v_c pt);更新圆的面积 这里出错,什么问题/
  •   (princ)
  • )

 楼主| 发表于 2018-3-1 19:57 | 显示全部楼层
(defun c:TT(/ ec area v_c)
  (vl-load-com)
  (setq ec(car (entsel "\n选择一个点:")));获取圆的图元名
  (setq pt(getpoint "\n输入圆的新的点:"));
        (setq newCenterPnt(vlax-make-safearray vlax-vbDouble '(0 . 2)))
        (vlax-safearray-fill newCenterPnt pt);存下数据
  (setq v_c(vlax-ename->vla-object ec));将圆的图元名转换为VLA对象
  (vla-put-Center v_c newCenterPnt);更改圆的中心点
        (vla-Update v_c);更新圆的中心点
  (princ)
)
回复 支持 1 反对 0

使用道具 举报

发表于 2018-3-2 19:29 | 显示全部楼层
本帖最后由 LPACMQ 于 2018-3-2 19:31 编辑

(setq pt(vlax-3D-point pt))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-29 07:54 , Processed in 0.166008 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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