miguel angel Posted July 11 Posted July 11 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. Quote
Steven P Posted July 11 Posted July 11 Not sure about images, if you wait till later a couple of members here are quite good with excel and LISPs Quote
GLAVCVS Posted July 11 Posted July 11 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? Quote
BIGAL Posted July 11 Posted July 11 (edited) 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 July 11 by BIGAL 1 Quote
miguel angel Posted July 30 Author Posted July 30 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. Quote
miguel angel Posted July 30 Author Posted July 30 (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 July 30 by SLW210 Added Code Tags!! Quote
SLW210 Posted July 30 Posted July 30 Please use Code Tags in the future. (<> in the editor toolbar) Quote
BIGAL Posted July 31 Posted July 31 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. Quote
Recommended Posts
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.