James Maeding offers up a unique AutoLISP function to get line and arc geometric information for anything you see on screen in AutoCAD, whether it be in a block, group, external reference, or just a plain entity. The best thing about this technique is that last point: any line or arc on the screen can be queried without using the (nentsel) function or sorting through the item’s properties, and you don't have to worry about doing any transformations.
The core idea is to use "quick osnaps" to try to snap to the center of an object. If that gives a non-nil return, you try to snap to the endpoint and midpoint of whatever was picked. Using the info from the osnaps, the function can reconstruct the line or arc geometry. The core function here is meant to be used in other routines, and is supplied as such. James has also included a sample routine to demonstrate use of this function. To run the sample, load the LISP file and type in the command TwistView, then pick any line or arc. |