×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Visual Lisp / Coordinate Transform

Visual Lisp / Coordinate Transform

Visual Lisp / Coordinate Transform

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources