AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

I offer the following tip for you and your readers.
Upon my return to AutoCAD, after using AES (Architectural & Engineering Series CAD program), I found AutoCAD was missing one very handy feature that AES had.
In AES it was possible to draw a line from any point to the X or Y component of any other point.
I was aware that AutoCAD point filters could be used but found them to be very clumsy.
After a bit of poking around, I found I was able to automate the point filters and created the 'X of...' and 'Y of...' object snaps in the POP0 menu as shown below.
The POP0 menu is found near the top of the acad.mns file which is located in the AutoCAD 'support' folder. Using the WordPad text editor, add the two lines starting with ID_PointXcom and ID_PointYcom as detailed below. I find these two additions to be absolutely invaluable as they save drawing and erasing temporary construction lines.
By way of explanation:
Start drawing a line from any point.
Invoke the Osnap menu (shift right click on my computer).
Select 'X of...' or 'Y of...' as required.
The Osnap menu is redisplayed.
You then pick from any of the traditional object snaps (end, mid, int, cen etc...)
You then pick on the required entity and the line is completed from its start location to the X or Y component of the selected entity.
The above may sound a bit cumbersome but it works very easily and smoothly. Give it a try...
(I have since been told that you can use something called 'tracking' to achieve the same function. I haven't tried this because I find it hard to imagine that it would be any easier.)
PS - You may notice I have also added 'Mid-way' to the POP0 menu. I stole this from the Autodesk site. Very handy for drawing a line from and/or to a point midway between two other points.

Regards
Craig Green

- Part acad.mns file starts here -
***POP0
**SNAP
[&Object Snap Cursor Menu]
ID_Tracking [Temporary trac&k point]_tt
ID_From [&From]_from
ID_MnPointFi [->Poin&t Filters]
ID_PointFilx [.X].X
ID_PointFily [.Y].Y
ID_PointFilz [.Z].Z
[--]
ID_PointFixy [.XY].XY
ID_PointFixz [.XZ].XZ
ID_PointFiyz [<-.YZ].YZ
[--]
ID_PointXcom [X of...]$p0=* ^P(progn (setq pt1 (getpoint "x of: ")) (command ".x" pt1 "@")) ^P
ID_PointYcom [Y of...]$p0=* ^P(progn (setq pt1 (getpoint "y of: ")) (command ".y" pt1 "@")) ^P
[--]
ID_OsnapEndp [&Endpoint]_endp
ID_OsnapMidp [&Midpoint]_mid
CAL_Mid3D [Mid-way]'CAL;(CUR+CUR)/2;
ID_OsnapInte [&Intersection]_int
ID_OsnapAppa [&Apparent Intersect]_appint
ID_OsnapExte [E&xtension]_ext
[--]
ID_OsnapCent [&Center]_cen
ID_OsnapQuad [&Quadrant]_qua
ID_OsnapTang [Tan&gent]_tan
[--]
ID_OsnapPerp [&Perpendicular]_per
ID_OsnapPara [Para&llel]_par
ID_OsnapNode [No&de]_nod
ID_OsnapInse [In&sert]_ins
ID_OsnapNear [Nea&rest]_nea
ID_OsnapNone [&None]_non
[--]
ID_Osnap [&Osnap Settings...]'_+dsettings 2
- Part acad.mns file ends here -

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website