RESOLUTION IN GETPOINT FUNCTION

RESOLUTION IN GETPOINT FUNCTION

arpansark0544TCX
Advocate Advocate
731 Views
8 Replies
Message 1 of 9

RESOLUTION IN GETPOINT FUNCTION

arpansark0544TCX
Advocate
Advocate

Hello everyone,

Hope you are doing good.

Is there any way to increase the resolution of Getpoint (decimal points) and a way to make z axis 0.

 

Please help me edit this

 

(defun c:COOM nil (setq m (getpoint "\nSelect destination point >"))
) ;end defun

 

Output :


Command: ID
Specify point: X = 344849.3922 Y = 167702.1946 Z = 0.0000
Command: *Cancel*
Command: *Cancel*
Command: COOM
Select destination point >(344849.0 167702.0 -1.99306e-06)

Command: !M
(344849.0 167702.0 -1.9828e-06)

 

Can the function store the same coordinates as getting by id command.

Thank you in advance.

 

 

0 Likes
Accepted solutions (2)
732 Views
8 Replies
Replies (8)
Message 2 of 9

pbejse
Mentor
Mentor

@arpansark0544TCX wrote:

...

Can the function store the same coordinates as getting by id command.

...


It doesn't look the same but it is @arpansark0544TCX. What are you planning to use the point data for?

 

Message 3 of 9

hak_vz
Advisor
Advisor
Accepted solution

Internal precision is 2 * 10-14, display precision is set to 2 decimal places.

To receive more decimals you can use:

Command: (setq a (getpoint))
(2936.97 1024.77 0.0)
Command: (defun decp (p) (rtos p 2 10))
DECP
Command: (mapcar 'decp a)
("2936.9721898964" "1024.7654693919" "0")

Convert string to real number with desired number of decimal places.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 4 of 9

Kent1Cooper
Consultant
Consultant

@arpansark0544TCX wrote:

Specify point: X = 344849.3922 Y = 167702.1946 Z = 0.0000
....

Select destination point >(344849.0 167702.0 -1.99306e-06)

....


What is meant by the red line above?  It's clearly [from the formatting of it] not the return from a (getpoint) function, as the blue line apparently is.  The differences in the X and Y coordinates between them are not just a matter of how many decimal places are displayed [or the blue X & Y would not end in .0], so where is the red coming from, that is, how do you know it's supposed to be that, differing from the blue?

 

I assume you are getting the blue from a cursor pick, presumably Object-snapping to something that has a not-quite-exactly-zero Z coordinate [it's very close].  If you want that to come back with 0.0 for the Z coordinate, read about the OSNAPZ System Variable.

Kent Cooper, AIA
Message 5 of 9

arpansark0544TCX
Advocate
Advocate
I am getting from ID command on the specific point with only CENTRE osnap on. On the other hand I am getting blue from the stored value of getpoint . I used only CENTRE osnap in this too. I have made sure that my OSNAPZ System Variable is set to 1 with elevation to 0.00.
0 Likes
Message 6 of 9

arpansark0544TCX
Advocate
Advocate
Ok, I get it Internal precision is 2 * 10-14, and display precision is set to 2 decimal places.
So no matter what it is showing !M will paste the object in its exact location.
0 Likes
Message 7 of 9

arpansark0544TCX
Advocate
Advocate
To move heavy blocks
0 Likes
Message 8 of 9

calderg1000
Mentor
Mentor
Accepted solution

Regards @arpansark0544TCX 

To move blocks the "MOVE" command is enough, but if you need to customize it here you have some options

;Move block by selecting points arbitrarily
(defun c:mb (/ ss en)
  (setq ss (ssget '((0 . "insert")))
        en (ssname ss 0)
  )
  (vl-cmdf "_move" en "" pause pause)
)

;Move block by selecting previously known points
(defun c:mb1 (/ ss en p1 p2)
  (setq ss (ssget '((0 . "insert")))
        en (ssname ss 0)
        p1(getpoint"\np1: ")
        p2(getpoint p1 "\np2: ")
  )
  (vl-cmdf "_move" en "" "none" p1 "none" p2)
)

;Move block automatically selecting its insertion point
(defun c:mb2 (/ ss en pins)
  (setq ss   (ssget '((0 . "insert")))
        en   (ssname ss 0)
        pins (cdr (assoc 10 (entget en)))
  )
  (vl-cmdf "_move" en "" "none" pins pause)
)

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 9 of 9

arpansark0544TCX
Advocate
Advocate
Thank you very much