Giuseppe Beatrice
Guest
hi guys, I've got a question about multiline attributes, which I've just found out about quality.
the problem I have is that the extraction made with autolisp provides the value of the attribute as a normal text string, without any difference to normal attributes.
Moreover, the changes in the value of the attributes made with the normal routines, of which I eventually attach the relative function, do not change at all the value of the attribute, which remains the previous one.
By reading from autocad in attribute properties, I see characters (\w0.6000; ...\p...), but obviously the only possibility to change the value is to directly edit the new text as any multiline text.
Is there any possibility to edit attribute values directly as multiline text from autolisp?
thanks to all for the interest.
I attach the internal function that I normally use for changing attributes values:
[Bleep] [Bleep]
;;;; receives from function calling entity name and list containing pairs with the label and the new associated value, to be inserted in the block
;;; for the moment no verification of congruity on the type of entity (if different from block) or on the eventual lack of attributes, giving everything to check
(defun modif_attrib (objent lst_val / noment element attrib label val_attr)
(setq noment objent)
(setq element (entget noment))
(while (/= (cdr) "seqend")
(setq noment (entnext noment)
(setq element (entget noment))
(forach attrib lst_val)
(setq label (car attrib)
val_attr (cdr attrib)
(if (equal (assoc 2 element) (cons 2 label))
(progn (setq element (subst (cons 1 val_attr) (assoc 1 element))))) (incl. element)))
(entupd noment)
the problem I have is that the extraction made with autolisp provides the value of the attribute as a normal text string, without any difference to normal attributes.
Moreover, the changes in the value of the attributes made with the normal routines, of which I eventually attach the relative function, do not change at all the value of the attribute, which remains the previous one.
By reading from autocad in attribute properties, I see characters (\w0.6000; ...\p...), but obviously the only possibility to change the value is to directly edit the new text as any multiline text.
Is there any possibility to edit attribute values directly as multiline text from autolisp?
thanks to all for the interest.
I attach the internal function that I normally use for changing attributes values:
[Bleep] [Bleep]
;;;; receives from function calling entity name and list containing pairs with the label and the new associated value, to be inserted in the block
;;; for the moment no verification of congruity on the type of entity (if different from block) or on the eventual lack of attributes, giving everything to check
(defun modif_attrib (objent lst_val / noment element attrib label val_attr)
(setq noment objent)
(setq element (entget noment))
(while (/= (cdr) "seqend")
(setq noment (entnext noment)
(setq element (entget noment))
(forach attrib lst_val)
(setq label (car attrib)
val_attr (cdr attrib)
(if (equal (assoc 2 element) (cons 2 label))
(progn (setq element (subst (cons 1 val_attr) (assoc 1 element))))) (incl. element)))
(entupd noment)