getpoint, number, 2.78461e+06

getpoint, number, 2.78461e+06

jbarringer
Participant Participant
103 Views
4 Replies
Message 1 of 5

getpoint, number, 2.78461e+06

jbarringer
Participant
Participant

I'm using getpoint to pick a point sometime it returns a number like 2.78461e+06 sometimes it works in the code below and sometimes it does not. 

(vlax-invoke-method align 'StationOffset (car pt) (cadr pt) 'sta 'off)

 

I would like to know why and how to fix this.

(rtos (car pt)) = "2784605.88"

 

Thanks

0 Likes
104 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

 The result of (rtos) depends on current UNIT setting - especially LUNITS and LUPREC sysvars

 

You can override the current setting by specifying them in (rtos)

(rtos number [mode [precision]])

 

So in your example, use

(rtos (car pt) 2 2) = "2784605.88"

 

Look into HELP  for more details.

0 Likes
Message 3 of 5

jbarringer
Participant
Participant

Sorry for the confusion my question is not with the "RTOS"  it is:

 

I'm using getpoint to pick a point sometime it returns a number like 2.78461e+06 (car pt) sometimes it works in the code below and sometimes it does not. 

(vlax-invoke-method align 'StationOffset (car pt) (cadr pt) 'sta 'off)

 

I would like to know why and how to fix this.

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant

Well, then it's more C3D related issue, better post it HERE 

0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

@jbarringer wrote:

.... sometime it returns a number like 2.78461e+06 ....

I would like to know why and how to fix this.

(rtos (car pt)) = "2784605.88"


 

Those are equivalent [to different rounding levels].  The first is scientific notation -- the e is for exponent -- and means "2.78461 x 10 to the 6th power."  Why it sometimes "reports" in that format I don't know, but either is the same information, and should not need fixing.

Kent Cooper, AIA
0 Likes