找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 679|回复: 1

[求助] [求助]:[0211]如何判断交点计算模式?

[复制链接]
发表于 2007-2-11 16:31:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
[求助]:[0211]如何判断交点计算模式?

想使用下面程式来完成交点计算,
若是两物件有相交,则不用使用延伸,
但若两物件无相交,则要延伸两物件.

问题:在于该怎样使用 IF 来判断执行
因为我在两物件无相交的情况下,执行结果回应了
_$ ; 错误: ActiveX 伺服器回覆一个错误讯息: 无效的索引。
我想可能是在判断 vlax-safearray->list 值时,出现问题.


(SETQ En1 (car (ENTSEL "\n 选取物件 A")))
(SETQ En2 (car (ENTSEL "\n 选取物件 B")))
(SETQ VEn1 (VLAX-ENAME->VLA-OBJECT En1 ))
(SETQ VEn2 (VLAX-ENAME->VLA-OBJECT En2 ))

(IF (= (vlax-safearray->list (VLAX-VARIANT-VALUE
        (VLA-INTERSECTWITH Ven1 Ven2 acExtendNone) ))
        T )
(SETQ INT (vlax-safearray->list (VLAX-VARIANT-VALUE
          (VLA-INTERSECTWITH Ven1 Ven2 acExtendNone) )) )
(SETQ INT (vlax-safearray->list (VLAX-VARIANT-VALUE
          (VLA-INTERSECTWITH Ven1 Ven2 acExtendBoth) )) )
)

烦请各位高手可以帮忙解答一下
谢谢...
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 7231个

财富等级: 富甲天下

发表于 2007-2-12 19:58:35 | 显示全部楼层
请看前辈的忠告

Tony Tanzillo  Nov 25 1999, 4:00 pm  
Newsgroups: autodesk.autocad.customization
Subject: Re: line inters polyline

Well - I Agree that vla-intersectwith should not return
empty safearrays if there is no intersection, it should
return a variant of type :vlax-vbEmpty, because that's
how other ActiveX clients would expect a 'null' result
to be represented (I haven't checked what the VBA/ActiveX
counterpart returns, but it should be an emptpy variant).

Most would probably prefer (vla-intersectwith) to return
nil when there's no intersection, but this method is just
a 'wrapper' for the underlying ActiveX method, and there
is no translation between LISP and ActiveX types done, I
think for a good reason: because it would result in a lot
of inconsistency.


So, it's probably a good thing that all ActiveX functions
behave in a *consistent* way, and do not attempt to cast
their results or output to LISP types
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-17 18:26 , Processed in 0.300633 second(s), 34 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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