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

dividing an area/measurement in equal parts

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
2295 Views, 2 Replies

dividing an area/measurement in equal parts

Hi all,

I am looking for help in accomplishing something way above my skill level. I have attached a sketch to make it easier to understand. What I am trying to do is the following ...

I am trying to measure a distance between two points, P1 & P2 respectively, and divide that distance into equally spaced areas, separated by xlines. However, the distances from the 1st and last xlines to points P1 and P2 need to be HALF the distance between each of the xlines.

To choose the number of spaces and lines required, I need to divide the P1,P2 distance by a value (eg 4200) and round that value up to the nearest whole number. This number will be the number of xlines required between the two points.

The xlines need to run perpendicularly to the direction of the P1,P2 distance measured.

 

Can anyone point me in the right direction for this one? Thanks in advance!

2 REPLIES 2
Message 2 of 3
dbroad
in reply to: Anonymous

Typically I don't do that by program.  I just use the divide command.  In your illustration, you have 5 parts so you divide it into 10 parts and draw lines by snapping onto every other point.  

Architect, Registered NC, VA, SC, & GA.
Message 3 of 3
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

....
I am trying to measure a distance between two points, P1 & P2 respectively, and divide that distance into equally spaced areas, separated by xlines. However, the distances from the 1st and last xlines to points P1 and P2 need to be HALF the distance between each of the xlines.

To choose the number of spaces and lines required, I need to divide the P1,P2 distance by a value (eg 4200) and round that value up to the nearest whole number. This number will be the number of xlines required between the two points.

The xlines need to run perpendicularly to the direction of the P1,P2 distance measured.

....


Welcome to these Forums!

 

This is a perfect job for DivideMeasurePlus.lsp and its DIV+ command, available here.  Among its many enhancements over AutoCAD's Divide command, it will let you:

 

A)  specify a Maximum division length [your 4200] instead of an explicit number of divisions [it will figure out how many are needed], and

B)  place selected object(s) [your Xline]  instead of only Points or Blocks, and

C)  place them in the Middle of the divisions instead of at the dividing locations [which will achieve your half-length end spaces].

 

Download it, APPLOAD it, Draw a Line from P1 to P2 and a [in the case of your image] vertical Xline [anywhere], start the DIV+ command, and here's the command-line sequence:

 

Command: DIV+
Divide with Points/Blocks/Lines/Selection ? <P>: S

For Selection set with which to Divide,
Select objects: [pick the Xline] 1 found

Select objects: [Enter to complete selection]

Base point in relation to Selection: NEAREST
to [pick anywhere on Xline]
Selection rotation, or Aligned with path or Relative angle to path [angle/A/R] <A>: 0

Enter number of Segments, or M for Maximum spacing <M>: [Enter to accept M default]

Maximum spacing of Selection: 4200

Place Selection at division points (Standard) or at Midpoints of divisions [S/M]? <S>: M

Select object to Divide: [pick the Line]
Select object to Divide: [Enter to end it]

 

Erase the initial Xline, and the P1-P2 Line if you don't need to keep it.

 

If P1-P2 may not always be horizontal, you can just draw the initial Xline using those two points and Rotate it 90 degrees to be perpendicular -- everything else would be the same.  OR, better yet, draw the Xline vertical and at the rotation prompt, choose Aligned, or draw it horizontal and at the rotation prompt, choose a Relative angle and give it 90 degrees.  That will let you do the same thing on multiple P1-P2 Lines, even if they're all at different lengths and angles, provided the 4200-unit maximum applies to all of them, all in one running of the command, and it will put the Xlines perpendicular to all of them at appropriate spacing for each.  There would just be more

 

Select object to Divide: [pick the Line]

 

items in the command sequence -- as many as you need.

Kent Cooper, AIA

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

Post to forums  

Forma Design Contest


AutoCAD Beta