rutina lisp mover texto "MTEXT" a punto de insercion "block reference"

rutina lisp mover texto "MTEXT" a punto de insercion "block reference"

martin_orozcoB84Y3
Explorer Explorer
440 Views
1 Reply
Message 1 of 2

rutina lisp mover texto "MTEXT" a punto de insercion "block reference"

martin_orozcoB84Y3
Explorer
Explorer

Buenos dias comunidad estoy desarrollando un comando lisp que me permita mover un texto mtext al punto de insercion de un bloque, tengo este codigo que para ejecutarlo lo tengo que cargar n numero de veces qusiera de su apoyo para modificar el codigo y para que se cargue al autocad y se ejecute en la linea de comandos sin necesidad de cargarlos nuevamente.

 

se adjunta rutina slip

se adjunta cad con mtext a mover en punto de insercion block referenfe

0 Likes
Accepted solutions (1)
441 Views
1 Reply
Reply (1)
Message 2 of 2

Kent1Cooper
Consultant
Consultant
Accepted solution

Your usage example at the end of the file should also be commented out with an initial semicolon. If you do that, then you still need to make entries with the function name and the two arguments in parentheses to use it, but you don't need to load it every time.  Is that what you want?

 

But I don't understand the text arguments for the prompts.  They don't limit the Mtext you can select, nor restrict the Block name you can select.  Would it not work to leave those out?  Then you can simply load the routine once, and [if you keep the command name I chose] use the IC command:

(defun C:IC (/ mtextObj blockObj); = Igualar Coordenadas
  (setq mtextObj (vlax-ename->vla-object (car (entsel "\nSelecciona el MText: "))))
  (setq blockObj (vlax-ename->vla-object (car (entsel "\nSelecciona el bloque: "))))
  (setq insertPoint (vlax-get-property blockObj 'insertionpoint))
  (vlax-put-property mtextObj 'insertionpoint insertPoint)
)

BUT since you still need to select the Mtext and the Block at each location, you can achieve it almost as easily with no custom command or function definition.  Just set INSertion as the only running Object Snap mode, and pick an Mtext object, grab its insertion-point grip and drag it to the insertion point of the Block.

Kent Cooper, AIA
0 Likes