Jump to content

VINCULAR IMAGEN DE EXCEL EN AUTOCAD


miguel angel

Recommended Posts

Me gustaría saber si hay algún autolisp que pueda vincular una casilla de excel que contiene una imagen y vincularla a una tabla de autocad.

Gracias.

Link to comment
Share on other sites

Not sure about images, if you wait till later a couple of members here are quite good with excel and LISPs

Link to comment
Share on other sites

Hola

No entiendo mucho de tablas pero a falta de alguien más experto, voy a ver si alcanzó a ayudarte un poco:

Vincularla para qué? 

Para que se muestre la imagen en la tabla de AutoCAD?

para que se muestre el path del archivo? 

 

Link to comment
Share on other sites

The images in a excel are stored as shapes

 

(setq shapes (vlax-get-property sheetcur "Shapes"))

 

Trying to dig deeper into shapes. The image may not have a file name only found Name = "Picture 2".

 

But you can Ctrl+c a cell so can then paste into CAD, Ctrl+v. Don't have any idea where to start. 

Edited by BIGAL
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Tengo unos QR en un excel y estos se van actualizando, lo que quiero es insertar esos QR en una tabla de autocad y que esté vinculada al excel para cuando se actualiza el excel se actualice la tabla, por eso no puedo copiar y pegar, por que no se actualizaría, pero si está vinculada si se actualiza, el problema es que cuando vinculo las celdas de la tabla de excel en autocad no se ve la imagen del QR, por eso mi pregunta es si hay alguna forma de vincular una imagen de excel con una tabla de autodad con algún autolisp???

Gracias.

Link to comment
Share on other sites

Posted (edited)

He intentado crear este autolisp, pero no me funciona:

 

 

 

(defun _$ (defun conectar-excel()
(setq RutaArch "D:\\Temp\\prueba.xlsx"
apl-excel (vlax-get-or-create-object "excel.application")
col-libros (vlax-get-property apl-excel "workbooks")
libro (vlax-invoke-method col-libros "open" RutaArch)
col-hojas (vlax-get-property libro "sheets")
hoja-1 (vlax-get-property col-hojas "item" 1)
col-celdas (vlax-get-property hoja-1 "cells")
) )
;(vla-put-visible apl-excel :vlax-true)
(vla-put-visible apl-excel :vlax-false); Esconder excel
)

(defun c:nh()
(conectar-excel)
(setq TextoNombreHoja (vlax-get-property hoja-1 "name"))
(alert (strcat "Se leerá la hoja " TextoNombreHoja))
(ObtenerValores 1) ; Empezar de la fila 1
(desconectar-excel)
(princ)
)

(defun ObtenerValores (FilaDeInicio)
(while (/= (setq varx (vlax-variant-value (vlax-variant-change-type (vlax-get-property col-celdas "item" FilaDeInicio 1) vlax-vbstring))) "")
(setq vary (vlax-variant-value-(vlax-variant-change-type (vlax-get-property col-celdas "item" FilaDeInicio 2) vlax-vbstring)))
(princ (strcat "(Fila: " (itoa filaDeInicio) ") Valor columna 1= " varx " | Valor columna 2= " vary "\n"))
(setq filaDeInicio (+ filaDeInicio 1))
)
)

(defun desconectar-excel()
(vlax-release-object col-celdas)
(vlax-release-object hoja-1)
(vlax-release-object col-hojas)
(vlax-release-object col-libros)
(vlax-invoke-method apl-excel 'QUIT)
(vlax-release-object apl-excel)
(gc)
)
_$ ()
(setq RutaArch "D:\\Temp\\prueba.xlsx"
apl-excel (vlax-get-or-create-object "excel.application")
col-libros (vlax-get-property apl-excel "workbooks")
libro (vlax-invoke-method col-libros "open" RutaArch)
col-hojas (vlax-get-property libro "sheets")
hoja-1 (vlax-get-property col-hojas "item" 1)
col-celdas (vlax-get-property hoja-1 "cells")
)
;(vla-put-visible apl-excel :vlax-true)
(vla-put-visible apl-excel :vlax-false); Esconder excel
)

(defun c:nh()
(conectar-excel)
(setq TextoNombreHoja (vlax-get-property hoja-1 "name"))
(alert (strcat "Se leerá la hoja " TextoNombreHoja))
(ObtenerValores 1) ; Empezar de la fila 1
(desconectar-excel)
(princ)
)

(defun ObtenerValores (FilaDeInicio)
(while (/= (setq varx (vlax-variant-value (vlax-variant-change-type (vlax-get-property col-celdas "item" FilaDeInicio 1) vlax-vbstring))) "")
(setq vary (vlax-variant-value-(vlax-variant-change-type (vlax-get-property col-celdas "item" FilaDeInicio 2) vlax-vbstring)))
(princ (strcat "(Fila: " (itoa filaDeInicio) ") Valor columna 1= " varx " | Valor columna 2= " vary "\n"))
(setq filaDeInicio (+ filaDeInicio 1))
)
)

(defun desconectar-excel()
(vlax-release-object col-celdas)
(vlax-release-object hoja-1)
(vlax-release-object col-hojas)
(vlax-release-object col-libros)
(vlax-invoke-method apl-excel 'QUIT)
(vlax-release-object apl-excel)
(gc)
)

 

Edited by SLW210
Added Code Tags!!
Link to comment
Share on other sites

Just select the cells of the excel may need a bit bigger to enclose an image, then just "Paste Special" and use "Link" worked for me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...