PDA

View Full Version : Regarding C double error


vemanamar
02-12-2005, 11:10 PM
hai cocreaters,


Can any body explain what this error is about:

LISP error:
14.889640796097559,52.629599894240762,37.909421460477311 cannot be coerce to a C double.

I came across this error when i am trying to get the position of a face selected. The code i have been using is


(in-package :training)
(use-package :oli)

(sd-defdialog 'Example
:dialog-title "Trail Dialog"
:variables
'( (A_FACE
:value-type :face
:incl-position :3d
:after-input
(if (listp A_FACE)
(progn
(setf position1 "true")

(setf x (cadr A_FACE))
)
(setf position1 "false")
)



)

(POSITION1 :value-type :string)
(X :value-type :length)


)
)




with regards,

vemenamar

clausb
02-13-2005, 01:33 AM
Well, the error message tells you that the code is trying to squeeze a position value into a variable of type double. And indeed, this is what you're trying to do in (setf x (cadr A_FACE)). (cadr A_FACE) returns a position, and x is a simple scalar variable; this cannot work.

To extract the x component from a 3D position, use gpnt3d_x; see also the section "Arithmetical and Vector Utilities" in the Developer's Kit documentation.

Claus