Author Topic: Absolute and Relative Coordinates in Lisp Function  (Read 1098 times)

0 Members and 1 Guest are viewing this topic.

jtm2020hyo

  • Newt
  • Posts: 198
Absolute and Relative Coordinates in Lisp Function
« on: October 28, 2022, 12:03:56 AM »
How can I use the prefix "*", "@", "#" in autolisp functions?

I mean, for "*" should I use something like this?

Command: (trans '(*1.0 2.0 3.0) 0 1)
*error*

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Re: Absolute and Relative Coordinates in Lisp Function
« Reply #1 on: October 28, 2022, 07:04:35 AM »
Just modify the COORDS (System Variable) in the lisp and reset it in your local *error* function.
https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-91D3C93C-9C89-4397-B855-92AFD5228422
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

danAllen

  • Newt
  • Posts: 133
Re: Absolute and Relative Coordinates in Lisp Function
« Reply #2 on: October 29, 2022, 01:02:36 PM »
My non-expert summary. For coordinates in lisp, using command calls such as (command "line" "1,2,3" "3,4,5" ""), the coordinates are local UCS, unless you prefix with asterix  (command "line" "*1,2,3" "*3,4,5" ""), When using entget data, the coordinates are world UCS. You only need to trans the coordinates when taking data from enget and using in in a command, unless you prefix with the asterisk. The trans function does not use the asterix. You can translate a world ucs entget coordinate to local ucs/command usage via (trans '(1.0 2.0 3.0) 0 1), the 0=world, 1=current UCS, (trans pt from to)

See http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-1A316343-0B68-4DBE-8F49-B4D601CB8FCC.htm,topicNumber=d30e633480