Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

hardikyp
508 Vistas, 2 Respuestas

selecting objects from commands and through scripts

I am trying to write a script which generates a set of spline curves in 3D space passing through a set of points. Once these splines are generated, I want to select two curves at a time and create a lofted surface between these two curves.

 

I can select these curves with the help of mouse. However, I want to automate the whole process and do it using scripts. Can anyone help me understand how to select a particular object in my autocad drawing simply through commands and without the use of mouse at all?

 

Thanks in advance!

Etiquetas (2)
Kent1Cooper
en respuesta a: hardikyp

I imagine it would involve saving each Spline as a variable after it is drawn:

....

  {whatever draws a Spline}

  (setq spline1 (entlast))

  {whatever draws the next Spline}

  (setq spline2 (entlast))

....

 

Then you would have a distinct variable name for each Spline, which you could use in LOFT commands.

 

If you always need to Loft between adjacent Splines in the sequence of generating them, you could have one such variable:

....

  {whatever draws a Spline}

  (setq spline1 (entlast))

  {whatever draws the next Spline}

  (command "_.loft"  ... use the spline1 variable and (entlast) ...)

....

and repeat.

Kent Cooper, AIA
hardikyp
en respuesta a: Kent1Cooper

Thank you very much! That solved my problem