LISP TO PLACE A CIRCLE AROUND A BLOCK

LISP TO PLACE A CIRCLE AROUND A BLOCK

ed.rci.rogers
Contributor Contributor
2,033 Views
8 Replies
Message 1 of 9

LISP TO PLACE A CIRCLE AROUND A BLOCK

ed.rci.rogers
Contributor
Contributor

I don't know anything about LISP Programming so I am here. I tried understanding how it works but really can't figure out how it works so any assistance from anyone is greatly appreciated. I have a coordinates file which came from a field survey and I want to place a circle on a block called treetrunk.dwg on the coordinates XYZ, the diameter of the tree and the text that needs to be placed on the circle. I have attached the following files.

 

1. Survey.dwg

2. treetrunk.dwg (The block that i need to place on the coordinates)

3. Screen shot of the final result.

 

 

 

Final Result.JPG

 

Thanks in advance

0 Likes
Accepted solutions (2)
2,034 Views
8 Replies
Replies (8)
Message 2 of 9

ed.rci.rogers
Contributor
Contributor

Suervey.dwg did not come thru..

0 Likes
Message 3 of 9

ВeekeeCZ
Consultant
Consultant

Could be a LISP or SCRIPT. I decided to show you how to do that with a SCRIPT in Excel. Because everybody knows excel, right? 🙂

 

Edit: Hope you know how a SCRIPT works... basically you need to create a formula that follows prompts given by autocad to command line.

 

So you can find xls with three framed columns - INSERT, CIRCLE and MTEXT. The second column (CIRCLE) you can copy-paste into autocad's command line directly.

The first and second are little bit tricky. INSERT and MTEXT command requires names or text finish by ENTER. You can do that in excel by char(10). But if you do so, then Excel wrap the hole expression in quite-marks, which you do not want for Autocad. So copy-paste it into NOTEPAD first, Replace quite-marks with nothing "", that copy-paste to autocad's command line.

 

Described workflow on the SCREENCAST

 

Good luck!

0 Likes
Message 4 of 9

ed.rci.rogers
Contributor
Contributor
Thanks for the help. I tried the commands it works fine with the tree symbol and the circle but not the the text. I don't know how to place the text asattached. I don't know how to represent the diameter symbol in text format. Thanks
0 Likes
Message 5 of 9

ВeekeeCZ
Consultant
Consultant
Accepted solution
 
All you want you can manage in excel.

 

For diameter use well know %%C

Break line is \P

If you want to put text little bit on the right, then add some delta to the x coordinate - in excel.

 

Maybe even better solution would be create a block with attribute.

 

Good luck!

0 Likes
Message 6 of 9

ed.rci.rogers
Contributor
Contributor

Thanks,

 

I got it working..

0 Likes
Message 7 of 9

ed.rci.rogers
Contributor
Contributor

Hi I'm back..what do you mean by add some delta to the x coordinate. Sorry for asking too many questions. I had working but the text is in bold.

 

Thanks again

0 Likes
Message 8 of 9

ВeekeeCZ
Consultant
Consultant
Accepted solution

It seems to me, that a label is little bit on the right from insertion point. So you can move it in autocad after the insertion, or make the calculation in excel and put it on the right place - this is what I meant - since you have x,y,z coords in excel, and you want to move your text by 20units on the right, then add a simple formula in excel. It was just an idea, move it in Autocad, if it's easier for you.

 

If your imported text is bold, then it's because your current text style is bold.

0 Likes
Message 9 of 9

ed.rci.rogers
Contributor
Contributor

Thanks, I got it fixed. WIth regards to the text location I will just leave it with the coordinates and let the drafter move it around.

 

Thanks again for your help..

0 Likes