メッセージ1/8
適用対象外
11-22-2017
11:12 AM
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- パーマリンクを表示
- 印刷
- 報告
Hello All,
I'm pretty new to VLA but it seems like a powerful tool in autolisp so I'm trying to learn.
The LISP I've been working on is meant to give a dimension from centreline (origin point) to the user selected point, and then through VLA it changes various properties of the dimension. Sometimes it works flawlessly and for seemingly no reason, other times it gives me the "error: bad argument type: VLA-OBJECT nil".
Could anyone shed some light on why this sometimes works and sometimes doesn't?
(defun C:OCL ()
(setq pt1
(getpoint "\nChoose a Point : ")
)
(setq pt2
(trans '(0 0 0) 0 1)
)
(setq x1
(car pt1)
)
(setq y1
(cadr pt1)
)
(setq z1
(caddr pt1)
)
(setq x
(car pt2)
)
(setq y
(cadr pt2)
)
(setq z
(caddr pt2)
)
(setq li0
(list x y1 z1)
)
(command "DIMLINEAR" pt1 li0 pause)
(command "_CHPROP" "LAST" "" "A" "YES" "")
(command "SELECT" "LAST" "")
(vl-load-com)
(vlax-for oDim
(setq ss
(vla-get-activeselectionset *activeDoc*)
)
(vla-put-textoverride oDim "<> OCL")
(vla-put-HorizontalTextPosition oDim acFirstExtensionLine)
(vla-put-Arrowhead2Type oDim acArrowNone)
(vla-put-ExtLine2Suppress oDim :vlax-true)
(vla-put-DimLine2Suppress oDim :vlax-true)
(vla-put-ArrowheadSize oDim 2.5)
(vla-put-ExtensionLineExtend oDim 1.5)
(vla-put-ExtensionLineOffset oDim 2.5)
(vla-put-TextHeight oDim 2.5)
(vla-put-textgap oDim 0.8)
)
(princ)
)Also,
Is there a way to change 'Annotative Scale' on a dimension through VLA or LISP?
Cheers,
Tyler
解決済! 解決策の投稿を見る。