[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Collect Arc and Line Endpoints
Tip# 3706 By James Maeding On 16-Aug-2011
Rated By 0 users Downloaded : 209
Categories : LISP Code Modules, Programming Examples
Software type : AutoCAD 2012
Query any line or arc on the screen to get geometric information.

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.


Average Rating:

User comments

Log In