TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: georgecorbett on October 03, 2021, 10:22:42 PM

Title: Connect an object's text/property field to other objects
Post by: georgecorbett on October 03, 2021, 10:22:42 PM
REMOVED


EDIT (John): removed spam.
Title: Re: Connect an object's text/property field to other objects
Post by: mhupp on October 04, 2021, 11:25:40 AM
Made this real quick to insert the area of an object. should give you a starting point.

Code: [Select]
(defun C:Obj_Area (/ ent objid pt hgt str)
  (vl-load-com)
  (setq ent (entsel "\nSelect Object"))
  (setq objid (vla-get-ObjectId (vlax-ename->vla-object (car ent))))
  (setq pt (getpoint "\nSelect Point"))
  (setq hgt 0.250)
  (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).Area>%"))
  (entmake (list (cons 0 "TEXT")
                 (cons 10 pt)
                 (cons 40 hgt)
                 (cons 1 str)
           )
  )
  (princ)
)



Title: Re: Connect an object's text/property field to other objects
Post by: BIGAL on October 05, 2021, 11:11:07 PM
If you pick say a existing text as destination you make a new STR as per mhupp then use vla-put-textstring obj to update it.
Title: Re: Connect an object's text/property field to other objects
Post by: Lee Mac on October 06, 2021, 11:52:01 AM
Perhaps one of these will help you:

Copy Field (http://lee-mac.com/copyfield.html)
Match Field Formatting (http://www.lee-mac.com/matchfieldformatting.html)