object insertion automatically x and y direction

Discussion of Common Lisp
Post Reply
kaan
Posts: 2
Joined: Mon Oct 07, 2013 2:44 am

object insertion automatically x and y direction

Post by kaan » Mon Oct 07, 2013 6:45 am

Hi everyone,
I need a lisp. I want to insert automatically on a certain size (length,width,thickness) strip. That is, I want to add object one by one according to following rules:

Image

Image

Let me explain with an example:

I'm giving the dimensions

Strip dimensions :
length: 9 mm
width: 6.8 mm
thickness 0.16 mm

Part dimensions :
L= 2 mm
H= 2 mm
B= 1.25x0.16= 0.2 mm
C= L+B= 2+0.2= 2.2 mm

If the length of x-axis is greater than C= L+B I want to insert one part automatically
I want to do it in the same way as the y-axis.

Image

I draw the first part into the strip after calculate for the example above.

9-2.2=6.8 ≥ 2.2 insert one part

after the second part

6.8-2.2=4.6 ≥ 2.2 insert one part

after the third part

4.6-2.2=2.4 ≥ 2.2 insert one part

after the fourth part

2.4-2.2=0.2 < 2.2 finish

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: object insertion automatically x and y direction

Post by nuntius » Mon Oct 07, 2013 5:50 pm

Are you doing this in AutoCAD?

kaan
Posts: 2
Joined: Mon Oct 07, 2013 2:44 am

Re: object insertion automatically x and y direction

Post by kaan » Tue Oct 08, 2013 1:37 am

Yes I want to do that in AutoCAD. I wonder how a lisp can be written to do this?

Thanks in advance for your helps.

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: object insertion automatically x and y direction

Post by nuntius » Tue Oct 08, 2013 7:12 pm

Ahh, this forum is not very busy with AutoCAD users. We have a list of links to other sites that may be more helpful.

viewtopic.php?f=29&t=4036

Post Reply