Czer Posted January 29, 2022 Posted January 29, 2022 (defun c:test() (command "arc" pause) (setq ent (entlast)) (setvar "PEDITACCEPT" 1) (command "PEDIT" ent "W" 20 "") (setvar "PEDITACCEPT" 0) (princ) ) Hi! there. Its been quite some time now that I am just a reader in this very informative forum, and to be honest I learned a lot. Thanks to the admin(s) of this forum. By the way, I have a problem with my simple code and I am hoping that someone can help me with this simple problem. I am new to autolisp. I am trying to create an arc then convert to polyline thru "PEDIT" command and change the width to 20. My question is, why my code is not working? What's wrong with my simple code? And how to fix this? Thanks in advance for those who will help me. Quote
Cad64 Posted January 29, 2022 Posted January 29, 2022 The arc command requires 3 inputs for the start, 2nd and end point, so you need 3 pauses. Try the code below. (defun c:test() (command "arc" pause pause pause) (setq ent (entlast)) (setvar "PEDITACCEPT" 1) (command "PEDIT" ent "W" 20 "") (setvar "PEDITACCEPT" 0) (princ) ) 1 Quote
Steven P Posted January 29, 2022 Posted January 29, 2022 6 hours ago, Czer said: My question is, why my code is not working? What's wrong with my simple code? And how to fix this? I always thought that giving a clue of why or how the routine isn't working gives us a clue where to look would be handy. OK in this case, short LISP and a simple fix.. but something longer we might need some guidance. Quote
Czer Posted January 30, 2022 Author Posted January 30, 2022 (edited) 11 hours ago, Cad64 said: The arc command requires 3 inputs for the start, 2nd and end point, so you need 3 pauses. Try the code below. (defun c:test() (command "arc" pause pause pause) (setq ent (entlast)) (setvar "PEDITACCEPT" 1) (command "PEDIT" ent "W" 20 "") (setvar "PEDITACCEPT" 0) (princ) ) Thanks Cad64, now it works. But now, I have a new problem, when I used the Center option in Arc command it doesn't work. The arc did not convert to polyline. Why was that? Edited January 30, 2022 by Czer Quote
Czer Posted January 30, 2022 Author Posted January 30, 2022 8 hours ago, Steven P said: I always thought that giving a clue of why or how the routine isn't working gives us a clue where to look would be handy. OK in this case, short LISP and a simple fix.. but something longer we might need some guidance. Thanks Steven for your input. I'll keep that in mind. 1 Quote
Cad64 Posted January 30, 2022 Posted January 30, 2022 1 hour ago, Czer said: Thanks Cad64, now it works. But now, I have a new problem, when I used the Center option in Arc command it doesn't work. The arc did not convert to polyline. Why was that? What does your code look like? This works for me: (defun c:test() (command "arc" "c" pause pause pause) (setq ent (entlast)) (setvar "PEDITACCEPT" 1) (command "PEDIT" ent "W" 20 "") (setvar "PEDITACCEPT" 0) (princ) ) Quote
Czer Posted January 30, 2022 Author Posted January 30, 2022 1 hour ago, Cad64 said: What does your code look like? This works for me: (defun c:test() (command "arc" "c" pause pause pause) (setq ent (entlast)) (setvar "PEDITACCEPT" 1) (command "PEDIT" ent "W" 20 "") (setvar "PEDITACCEPT" 0) (princ) ) My code has no "c" just like the first one. You mean to say that if I want to use Center option I have to write a new code? Like the one you created. Now I know, I have to be very specific when writing a code. Once again thank you very much for your time answering my question. I really appreciate your time and effort answering a question from a newbie. God bless you and God will repay you a million fold for your kindness and generosity. 1 Quote
Steven P Posted January 30, 2022 Posted January 30, 2022 9 hours ago, Czer said: Thanks Steven for your input. I'll keep that in mind. It just helps getter better replies. Quote
SLW210 Posted January 31, 2022 Posted January 31, 2022 You can just draw the polyline arc. After start point select Arc, then other options are available. Is there a purpose for using the LISP or is this LISP practice? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.