马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
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:
 - (vl-load-com)
- (defun test ()
- (setq mspace (vla-get-modelspace
- (vla-get-activedocument (VLAX-GET-ACAD-OBJECT))
- )
- )
- (setq pt1 (vlax-3d-point (list 3 1 )))
- (setq width 3 text "")
- (setq mtxtObj (vla-addmtext mspace pt1 width text))
- (setq ptlist (apply 'append (list '(1 1 0) '(3 1 0))))
- (setq pts (vlax-make-safearray vlax-vbDouble '(0 . 5)))
- (vlax-safearray-fill pts ptlist)
- (setq ptsVar (vlax-make-variant pts))
- (setq ldr (vla-addleader mspace ptsVar mtxtObj acLineWithArrow))
- )
|