Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Lisp / Coordinate Transform

Status
Not open for further replies.

Loxo

Civil/Environmental
Apr 13, 2001
1
Hello Vlisp gurus!

The Players (liberally scattered around the Dwg):
+ A dozen Block Insertions:
All from the same Block Definition containing:
1 rectangle (LwPolyline)
They are scaled and rotated.
+ Some 3000 points

The Game:
Which points are contained in which Block Insertion?

So...
I wish to transform ea. point (ie, its coordinates)
from WCS to the OCS of a Block Insertion.
(From there, a simple Contained-In-Rectangle routine
would take care of the rest).

For (most!) Coordinate Transforms,
Vlisp 2000 provides the Trans function,
with the rather ominous comment:
"For some objects, the OCS is equivalent to the WCS;
for these objects, conversion between OCS and WCS
is a null operation."

Sure enough, my Block Insertion is one of those objects.
Iow, the Trans Function returns me the SAME coordinates
when used like this:
'From' argument = 0 (WCS)
'To' argument = Block Insertion's entity name

One way around this is to code a Coordinate System change
(feeding the Ucs Command the entity name of the Block Insertion),
*then* using Trans function thus:
'From' argument = 0 (WCS)
'To' argument = 1 (Current UCS);
such current UCS being equivalent to our Block Insertion OCS.

Problem is, our scenario is a part of a large application
so 3000 UCS changes is out of the question!

Am I misusing the Trans function?
Or is it such a -nasty emoticons here-?

Thanks.

P.S.:
VBA provides Utility Object / Translate Coordinates Method.
Same deal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor