Hello
I do not understand why when I change the value by consulting a reactor, it does not work and I have an error message, whereas if I do it manually, it works correctly?
With the reactor
(defun reacteur_ajouter_cdc(rea data / ent pro)
(and (setq ent (vlax-ename->vla-object (cadr data)))
(eq (vla-get-objectname ent) "AcDbBlockReference")
(eq (vla-get-isdynamicblock ent) :vlax-true)
(member (strcase (vla-get-effectivename ent) T)
'( "0-lf-reseaux-cfa-casse"
"0-lf-reseaux-cfa-coude"
"0-lf-reseaux-cfa-droit1"
"0-lf-reseaux-cfa-droit2"
"0-lf-reseaux-cfa-reduc"
"0-lf-reseaux-cfa-te-croix"
)
)
Patrick_Taille_Cdc
(foreach pro (vlax-invoke ent 'getdynamicblockproperties)
(if (eq (vla-get-propertyname pro) "Consultation")
(if (member (itoa Patrick_Taille_Cdc) (vlax-get pro 'allowedvalues))
(vla-put-value pro (itoa Patrick_Taille_Cdc))
(princ "\nLa taille du Chemin de cābles ne correspond pas aux paramčtres de Consultation.")
)
)
)
)
(princ)
)
(defun c:cdc(/)
(initget 3)
(and (setq Patrick_Taille_Cdc (getint "\nIndiquez la taille du chemin de cābles : "))
(not Patrick_Ajouter_Cdc)
(setq Patrick_Ajouter_Cdc (vlr-acdb-reactor nil (list (cons :vlr-objectappended (function reacteur_ajouter_cdc)))))
)
(princ)
)
Manually
(setq ent (vlax-ename->vla-object (car (entsel))))
(setq pro (nth 6 (vlax-invoke ent 'getdynamicblockproperties)))
(vla-put-value pro (itoa Patrick_Taille_Cdc))
Thanks
@+