Jump to content

Converting Arc to Polyline then change the width.


Czer

Recommended Posts

(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.

Link to comment
Share on other sites

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)
  )

 

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Czer
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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)
  )

 

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...