Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

change 6-sided polygon to circle around text

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jhjirak
762 Views, 7 Replies

change 6-sided polygon to circle around text

I have a window schedule lisp routine that places a 6-sided polygon around text that label each window.  I want to change the code so that its a circle instead of a polygon.  Here is the code line that needs to be modified:

 

(command "polygon" "6" "fro" (cdr (assoc 10 (entget templine)))(strcat "@38,-" (rtos (+ (* linecount 18) 14) 2 0)) "C" "6")

 

thanks.

 

 

7 REPLIES 7
Message 2 of 8
Moshe-A
in reply to: jhjirak

Hi,

 

this is only a patial code, sent it all

 

you can label your windows with an attribute block, it's much more simple.

 

Moshe

 

Message 3 of 8
jhjirak
in reply to: Moshe-A

I dont really want to send everything since it was a purchased lisp routine.  I just really wanted to change the polygon to a simple circle by modifying this one line of code. 

Message 4 of 8
pbejse
in reply to: jhjirak


@jhjirak wrote:

I have a window schedule lisp routine that places a 6-sided polygon around text that label each window.  I want to change the code so that its a circle instead of a polygon.  Here is the code line that needs to be modified:

 

(command "polygon" "6" "fro" (cdr (assoc 10 (entget templine)))(strcat "@38,-" (rtos (+ (* linecount 18) 14) 2 0)) "C" "6")

 

thanks.

 

 


Not sure what the other values source is

 

(command "_circle" (cdr (assoc 10 (entget templine))) (* (+ (* linecount 18) 14) 6))

 

wher 10 is middle center and linecount is length of string

 

Not really sure

 

or it could be as simple as
(command "_circle" (cdr (assoc 10 (entget templine))) 6) where 6 is radius of cirlce

 

 

Message 5 of 8
pbejse
in reply to: jhjirak


@jhjirak wrote:

I dont really want to send everything since it was a purchased lisp routine.  I just really wanted to change the polygon to a simple circle by modifying this one line of code. 


Oh, i did not see your post there. Would it be easier to ask the guy who wrote the code to do just that. as a favor perhaps.

 

There are people out there that would do that as far as i know 🙂

 

 

Message 6 of 8
jhjirak
in reply to: jhjirak

Thanks Pro, I will try that code and see if it works.  Ya the guy who wrote it kinda gave me the line which I need to change but didnt really do it for me.  He just said change this line haha.  Whats your email address? I can send you the lisp file.

Message 7 of 8
Kent1Cooper
in reply to: jhjirak


@jhjirak wrote:

I have a window schedule lisp routine that places a 6-sided polygon around text that label each window.  I want to change the code so that its a circle instead of a polygon.  Here is the code line that needs to be modified:

 

(command "polygon" "6" "fro" (cdr (assoc 10 (entget templine)))(strcat "@38,-" (rtos (+ (* linecount 18) 14) 2 0)) "C" "6")

....


It's drawing a Polygon around a center point, since it doesn't call for the Edge option, so you can keep that center for the Circle, and eliminate the number-of-sides and Circiumscribed responses from the Polygon command.

 

(command

  "_.circle" ; [eliminate the "6" for number of sides]

  "fro" ; keep relative-location command modifier

  (cdr (assoc 10 (entget templine))); keep as base point for "from" displacement

  (strcat "@38,-" (rtos (+ (* linecount 18) 14) 2 0)); keep as displacement from there

  ; [eliminate the "C" for Circumscribed]

  6 ; keep as radius of Circle [can be in quotation marks or not]

); command

 

Since it was making a Circumscribed Polygon, the Circle resulting from the above will be the one inscribed in the Polygon it would have made.  If you want the Circle that circumscribes that Polygon, you'd need to increase the 6, which you could do precisely with a trigonometric calculation, or approximately.

 

By the way, if the 'linecount' variable is an integer rather than a real number, that one line could be simplified:

....

  (strcat "@38,-" (itoa (+ (* linecount 18) 14)))

....

Kent Cooper, AIA
Message 8 of 8
pbejse
in reply to: jhjirak


@jhjirak wrote:

Thanks Pro, I will try that code and see if it works.  Ya the guy who wrote it kinda gave me the line which I need to change but didnt really do it for me.  He just said change this line haha.  Whats your email address? I can send you the lisp file.


You can try the snippet that kent posted, what he said does make sense 😉

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost