PDA

View Full Version : How to convert splines in Annotation


jkramer
03-10-2004, 11:58 PM
Hi,

We want to our MI-files (made in Annotation) to be imported directly in the Radan CAM-program. This works fine, except for splines, which do not show up in Radan....
I learned that there's a function in ME10 to convert splines to radii and/or straight lines (convert_spline), and in ME10 this works fine. However, I'd like to have a Lisp routine that enables me to select a flat view, after which all splines in the flat would be converted (Radan only needs the flat view).
It was easy to write a Lisp test-routine that changes the color of all splines in a flat view to red (see attached file). But how do I "insert" the ME10 function convert-spline in a Lisp routine?? I must confess that I find the help docs about this subject very confusing...
I guess I should use sd-execute-annotator-command or sd-execute-annotator-function????!!!!
Thanks,
Regards,
Jaap

John Scheffel
03-23-2004, 03:28 PM
I'm no expert on this, but I would recommend that you first write a macro that does exactly what you want in Drafting. The macro should be able to complete it's task without any user interaction. Once you have tested and debugged it in Drafting, save it to a file. You can load the macro file into Annotation with a command such as:

(sd-execute-annotator-command :cmd "input 'my_macro_file.m' ")

Note the use of double and single quotes.

If your macro doesn't require any input parameters, you can run it with a command such as:

(sd-execute-annotator-command :cmd "my_macro_name")

If the macro needs input parameters, then you can pass your LISP variables by using a format statement:

(sd-execute-annotator-command :cmd (format nil "my_macro_name ~A" my-variable))

You only use sd-execute-annotator-fuction when you must return values from the macro to the LISP code, but this is more complicated. From your description it doesn't sound like this is necessary.