Originally Posted by
blothian
Question No.2: How to divide a distance between 2 points on-the-fly by an integer
Progress is still going well until I have become stuck on this. In MS, there are many ways to divide a distance between 2 points into any number of equal sized parts. One is a built-in feature called the snap divisor (Sets the number of keypoints on a line, line string segment, or curve segment to one greater than this value), the other is to use the MS version of tracking and a keyin. For the latter say I have the a basic floor plan and I have some rectangles represent desks. What I want to do is move all of these desks to 1/3rd of the room width from one of the walls. To achieve this in MS I would:
- Select all the desks, activate copy and snap to basepoint (at this point the elements are floating ready for the destination point to be entered)
- Activate MS version of tracking
- Snap to first basepoint,left-click to send data point
- Lock direction of travel (just like turning ORTHO on)
- Move to next snap point however...
- On the Accudraw(MS Data entry tool) Type "/x" on (where x is the number of equal sizes the distance would be split into eg Midpoint = /2) and the current distance between the 2 tracking points is divided by the integer x.
- Left-click to send data point and place geometry at desired location
This is an extremely quick and efficient method to positioning geometry without resorting to method that place additional geometry to represent the snap points. This is the only solution I have found with the DIVIDE command though its somewhat not as streamlined due to having to set up an extra line first to match the length of wall (the extent of the original is not made from 1 single line), then divide that to create points and then go through the move procedure. Is there a less clunky
on-the-fly approach to be learned?
To achieve this in AutoCAD:
- Select all the desks, activate copy and snap to basepoint (at this point the elements are floating ready for the destination point to be entered)
- Enter plt(cur,cur,1/3) at command line
- Lock direction of travel (just like turning ORTHO on)
- Pick the two points to place the desks between
I added this macro under 'Mid Between 2 Points' in the 'Object Snap Cursor Menu' Shortcut Menus:
Code:
(setvar "USERR1" (getreal "Fraction of the distance between pick points: "));\'cal plt(cur,cur,getvar(USERR1));
with the Command Name 'Snap, Fraction Between 2 Points'
Then to achieve this in AutoCAD:
- Select all the desks, activate copy and snap to basepoint (at this point the elements are floating ready for the destination point to be entered)
- Select 'Snap, Fraction Between 2 Points' from the 'Object Snap Cursor Menu'
- Enter 1/3 or whatever fraction you like
- Pick the two points to place the desks between
This could also be done easilly with lisp or a script. There is many ways to do almost anything in AutoCAD once you get the hang of it.