TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on July 10, 2017, 02:46:31 PM

Title: filed string
Post by: Andrea on July 10, 2017, 02:46:31 PM
Hi all,..

i'm trying to know why this string do not work as field.

Code: [Select]
(setq AttText (strcat "%<\\AcObjProp Object(%<\\_ObjId 506077156672>%).TextString \\f \"%tc1\">%"))
this string work great if I cut&paste to any text without double backslashes..
it capture de valur of an block attribute.

any idea ?
Title: Re: filed string
Post by: ChrisCarlson on July 10, 2017, 03:14:34 PM
I believe you need to pass the ObjectId differently.

Code - Auto/Visual Lisp: [Select]
  1. (itoa (vla-get-ObjectId (vlax-ename->vla-object (car attrib))))
  2.  
Title: Re: filed string
Post by: Andrea on July 10, 2017, 03:20:36 PM
ok,...found it...

Code: [Select]
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acActiveViewport)

ppfftt  :)  Thank you.
Title: Re: filed string
Post by: Lee Mac on July 10, 2017, 06:33:56 PM
You can also use the UPDATEFIELD command (quicker than REGEN for large drawings) - this is typically required when populating an attribute with a field expression.
Title: Re: filed string
Post by: Andrea on July 11, 2017, 10:00:51 AM
You can also use the UPDATEFIELD command (quicker than REGEN for large drawings) - this is typically required when populating an attribute with a field expression.

Thanks Lee
 :uglystupid2: