hosyn 发表于 2022-7-5 22:52:10

What's wrong in my code

What's wrong in my code , i wanna after running this code draw an arc from specified point to other one .but when run the code start from previously point
How can deactivate start from previously point to new one ???
 

(COMMAND "_PLINE" "" "A" "D")

BIGAL 发表于 2022-7-5 23:06:27

Just pick point 1st not tested
 

(DEFUN C:AR ( / pt)(setq pt (getpoint "\nPick start point"))(COMMAND "_PLINE" Pt "A" "D"))

hosyn 发表于 2022-7-5 23:14:57

thanxxxxxxxxxx bigal that's okkkkkkkkkkk

MSasu 发表于 2022-7-5 23:24:58

The empty string you used as first input is equivalent toand this will triger that behavior. To keep you code as one statement try:

(DEFUN C:AR ()(COMMAND "_PLINE" pause "A" "D"))

MSasu 发表于 2022-7-5 23:30:39

Hosyn, if you intend to add other code after that polyline draw, just ensure that you don't leave AutoLISP interpreter:

(DEFUN C:AR ()(COMMAND "_PLINE" pause "A" "D") (while (> (getvar "CMDACTIVE") 0) (command pause))(prompt "Done!")   ;this statement is reached)

hosyn 发表于 2022-7-5 23:36:55

thnxxxxxxxxxxx to Msasu and Bigal greaaaaaaaaaaaat:D
And I have a another question about::: is that possible use above define command"AR" and call and run in another lisp file like that:

(defun c:aaa()(command"_INSERT" "b1")(command"_AR" ""))
If answer no , How we can call and run this command in new lisp file??

BIGAL 发表于 2022-7-5 23:46:24

just change this
 

(command "_AR" "")to(c:ar)

hosyn 发表于 2022-7-5 23:54:52

Thanxxxxxxxxxxxxxxxxxxxx again BIGAL ,appreciate.
页: [1]
查看完整版本: What's wrong in my code