Author Topic: Re.Attempt at easier vector paste..  (Read 1322 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 193
Re.Attempt at easier vector paste..
« on: August 02, 2023, 05:03:58 PM »
Tried some but just don't have it.
 if manually I take a coord/vector set and add the word " list with a single space
    that is accepted within a command.

;;  how do I get the coords of list [trans acquired] to be used..
;;  and, as a trans?
;;  chances are, this might not be the way to start.

(defun c:vl ()
  (setq cvx (getstring "enter list:  "))
(prompt (vl-string-subst "(list " "(" cvx))

)

Command: LINE
Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]: 'vl
enter list:  (33.0759 88.1952 0.0)

Can't reenter LISP.
(list 33.0759 88.1952 0.0)nil

Point or option keyword required.
.
.

« Last Edit: August 02, 2023, 05:09:04 PM by ScottMC »

BIGAL

  • Swamp Rat
  • Posts: 1433
  • 40 + years of using Autocad
Re: Re.Attempt at easier vector paste..
« Reply #1 on: August 02, 2023, 08:14:17 PM »
Line command has that inbuilt ?

Line pickstartpoint 300.35,345.67 next point etc pick or type in values.

If you want trans etc I would look more at get all your points do the trans save points in a list then Line pt1 pt2 pt3 etc.
A man who never made a mistake never made anything

danAllen

  • Newt
  • Posts: 134
Re: Re.Attempt at easier vector paste..
« Reply #2 on: August 03, 2023, 12:00:07 PM »
Simple method

;; save point, converting any user coordinates to world\
;; has benefit of preserving all point precision that might not print to command line
(setq t1 (trans (getpoint) 1 0))

;; start command
;; enter lisp (trans t1 0 1) converting world point to current user coordinates
;; won't work in lisp routines
line
ENTER to use last point/Follow/<Start of line>: (trans t1 0 1)

ScottMC

  • Newt
  • Posts: 193
Re: Re.Attempt at easier vector paste..
« Reply #3 on: August 03, 2023, 07:04:00 PM »
Here's an attempt to re-explain..
  1. Run a lisp.cmd that pastes to cmd.line
       a vector coord like: (33.0759 88.1952 0.0)
2. Copy that to 'clipbrd'..
3. Begin desired.cmd and call this trans.cmd which changes
       this vector coord into the usable format which is paste.able
       onto cmd.line where needed in this running desired.cmd.
;;// -----------------------------------------------------------------------------------------------------------
    manually, to do this, I must
           change the lisp.cmd posted coord: (33.0759 88.1952 0.0)
       into one of two usable formats:        1. 33.0759,88.1952,0.0          or,
          certainly easier manually ->          2. (list 33.0759 88.1952 0.0)

 really thought 2. would be a lisp do.able..
My hope is someone will find the best way to work the transparent conversion so, in the event this coord can be easily used.
 I know y'all can figure this out. Thanks.
« Last Edit: August 03, 2023, 08:56:51 PM by ScottMC »

danAllen

  • Newt
  • Posts: 134
Re: Re.Attempt at easier vector paste..
« Reply #4 on: August 03, 2023, 11:56:37 PM »
Isn't this a continuation of this thread?
http://www.theswamp.org/index.php?topic=58190.15

My comments would be similar. To me it is nonsensical to copy command history text output of points, it loses the precision that CAD maintains in true point lists, which usually is not printed due to luprec variable.

Example comparing output of (getpoint) and ID'ing same point with LUPREC set to 8.
Code: [Select]
: (getpoint)
(78.8709091273266 9.97817549544391 0.0)
ID
Select point to identify coordinates:
 X=78.87090913  Y=9.97817550  Z=0.00000000

Also the beauty of CAD is you can just draw a point, line, etc. to save the point and repick.

If you have specific questions about trans and how to use in a lisp, please post the code.
« Last Edit: August 04, 2023, 12:03:18 AM by danAllen »

ScottMC

  • Newt
  • Posts: 193
Re: Re.Attempt at easier vector paste..
« Reply #5 on: August 04, 2023, 09:50:53 AM »
Thanks dan for the reminder. It will work.