找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1481|回复: 2

[其他] 创建不带annotation 的 leader

[复制链接]

已领礼包: 40个

财富等级: 招财进宝

发表于 2021-1-16 21:05:32 | 显示全部楼层 |阅读模式

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

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

×
Creating a leader without annotation

问题:

When I create a leader without annotation in Visual LISP with vla-addLeader. I
use NIL for the annotation-parameter but Visual LISP does not accept NIL for the
annotation-object, and VBA permits "a nothing object" for this parameter. Is
there an analogous object in VLISP ActiveX that can be used?

解答:

VLISP ActiveX does not have a provision for creating a leader with a null
annotation. Although you can specify a nothing object in VBA for the parameter,
there is no parallel object in Visual LISP. Nil nor the constructs of
vlax-vbEmpty or vlax-vbNull will be accepted.

The workaround is to associate an MTEXT object that has an empty string with the
leader, and align the MTEXT object with the last point that is specified in the
leader:

  1. (vl-load-com)

  2. (defun test ()
  3. (setq mspace (vla-get-modelspace
  4.                          (vla-get-activedocument (VLAX-GET-ACAD-OBJECT))
  5.                    )
  6. )

  7. (setq pt1 (vlax-3d-point (list 3 1 )))
  8. (setq width 3 text "")
  9. (setq mtxtObj (vla-addmtext mspace pt1 width text))

  10. (setq ptlist (apply 'append (list '(1 1 0) '(3 1 0))))
  11. (setq pts (vlax-make-safearray vlax-vbDouble '(0 . 5)))
  12. (vlax-safearray-fill pts ptlist)
  13. (setq ptsVar (vlax-make-variant pts))

  14. (setq ldr (vla-addleader mspace ptsVar mtxtObj acLineWithArrow))
  15. )


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

已领礼包: 756个

财富等级: 财运亨通

发表于 2021-1-27 09:19:27 | 显示全部楼层
谢谢大神分享,学习理解中
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 47个

财富等级: 招财进宝

发表于 2021-2-4 10:24:56 | 显示全部楼层
当我用vla addLeader在visuallisp中创建不带注释的引线时。我

使用NIL作为注释参数,但是visuallisp不接受NIL作为注释参数

注释对象,VBA允许此参数使用“无对象”。是

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-29 04:03 , Processed in 0.336190 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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