[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.
Block Object Point Translation
Tip# 3355 By Peter Jamtgaard On 22-Feb-2010
Rated By 2 users Downloaded : 304
Categories : LISP Code Modules
Software type : AutoCAD 2010
Rename File To : TranslateWorldToObject.lsp
Translate points back and forth between the world and a block objects coordinate system.

AutoLISP guru Peter Jamtgaard submits two routines that translate points between the world and a block objects coordinate system, and vice versa. These routines handle irregular normal vectors and non-uniform scaling, and are very useful tools when working with blocks and components of blocks relative to the WCS. These functions are to be called from within other code, and require two arguments. The first argument is a block in the form of a VLA-Object, and the second argument is a 3D point. This is a great example of concise AutoLISP code.


Average Rating:

User comments
Comment by Barnard,Irne
Posted on 2011-03-04 04:56:51
This doesn't work for mirrored blocks. I don't seem to find anything regarding mirror transformation matrices. But here's an alternative modification to your code - at least for the TranslateObjectToWorld defun.
Comment by Barnard,Irne
Posted on 2011-03-06 08:37:21
Actually I just did a further test. It doesn't handle rotated blocks either (rotated other than 0.0 or 180.0 degrees). So unfortunately this is less than useful.