PDA

View Full Version : Surface Measurement to Calculator


John Scheffel
05-01-2003, 04:40 PM
Someone in Agilent asked if there was a way to use the "Point to Surface" and "Surface to Surface" measurements and send the result to the Calculator. I could not find a standard command to do this. My LISP skills are pretty weak, but since I had access to some source code for sending measurements to the calculator I thought I would try to create a custom command to do it. This is my first attempt.
(sd-defdialog 'measure_point_to_surf_calc
:dialog-type :interrupt
:dialog-control :sequential-loop
:delay-menu-attachment t
:variables
'((THE_POINT
:selection (*sd-vertex-3d-seltype* *sd-vertex-2d-seltype*)
:prompt-text "Click a point"
)
(THE_SURFACE
:selection (*sd-face-seltype*)
:prompt-text "Identify surface"
:after-input (progn
(sd-call-cmds
(measure_dist :point_surface the_point the_surface)
:success
(when (numberp *sd-action-result*)
(ui::m-calc-set-x-register (sd-sys-to-user-units
:length *sd-action-result*)))
)
)
)
)
:ok-action nil)
When I try to use this command, I get the error:

You have specified an incorrect option or data string. (Error 139)

I suspect it has something to do with picking a face rather than a surface, but I could not find any :selection or :value-type options for selecting a surface. I searched the integration kit documentation pretty thoroughly. So I thought I would post it here to see if anyone had any suggestions. I'm not sure that this is the best method to accomplish the goal, so if anyone has better ideas I would like to hear them.

dorothea
05-04-2003, 10:59 PM
Hi,

The measure commands requires a point instead of a vertex. The command allows to enter any point or position and is not limited to the vertices. This means that you have to replace the :selection for THE_POINT by:
:value-type :point-3d

I think the command works fine with this change.


Dorothea

John Scheffel
05-05-2003, 10:55 AM
Originally posted by dorothea
This means that you have to replace the :selection for THE_POINT by:
:value-type :point-3d

Thanks very much Dorothea. That did fix the problem.