MODIFICAR ATRIBUTOS CON VARIAS PROGRAMACIONES

xavier
11 de Diciembre del 2003
Hola buenos d铆as.
Tema:
MODIFICAR ATRIBUTOS CON VARIAS PROGRAMACIONES

Tengo un bloque llamado 聯Pto聰 con 3 entidades: 2 l铆neas que forman una cruz - | - y un atributo
tag = 聯primero聰
prompt = 聯uno聰
value = 聯1聰

Mi intenci贸n es cambiar el valor de 聯value聰
Programaci贸n con AUTOLISP

(defun cambia->atrib(/ entBL entAt lstAt enAtNew)
(setq entBL (ssname (ssget) 0))
(setq entAt (entnext entBl)
lstAt (entget entAt))
(setq entAtNew (subst (cons 1 "2") (assoc 1 lstAt) lstAt))
(entmod entAtNew)
(entmod (entget entBl))
)
;; creo que tendr铆a que utilizar la funci贸n (entupd entAtNew)
;; pero bueno as铆 funciona.

Programaci贸n con VISUAL LISP

(vl-load-com)

(defun cambia->atrib-VL()
(setq entBL (ssname (ssget) 0))
(setq bloque (vlax-ename->vla-object entBL))
(setq atributos (vlax-variant-value
(vla-getattributes bloque)))
(if (>= (vlax-safearray-get-u-bound atributos 1) 0)
(foreach atrib (vlax-safearray->list atributos)
(vlax-put-property atrib "TextString" "2"))))

;; no har铆a falta la funci贸n foreach para un solo atributo, pero tambi茅n funciona

Programaci贸n con VISUAL BASIC.
He aqu铆 mi problema, tengo poca idea de Visual Basic, he conseguido recorrer el bloque ver el valor que tienen el 聯tag聰 y el 聯value聰.
He modificado el valor de 聯value聰, lo veo cuando depuro el programa, pero no consigo la modificaci贸n en el bloque 聯pto聰 del dibujo.
¿Visual Basic tiene alguna funci贸n para que se regeneren las entidades compuestas, como la que tiene autolisp (entupd)?

¿gracias por adelantado?
Un saludo.
Xavier.