Author Topic: Connect an object's text/property field to other objects  (Read 1325 times)

0 Members and 1 Guest are viewing this topic.

georgecorbett

  • Mosquito
  • Posts: 1
Connect an object's text/property field to other objects
« on: October 03, 2021, 10:22:42 PM »
REMOVED


EDIT (John): removed spam.
« Last Edit: July 15, 2022, 08:03:05 AM by JohnK »

mhupp

  • Bull Frog
  • Posts: 250
Re: Connect an object's text/property field to other objects
« Reply #1 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)
)




BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Connect an object's text/property field to other objects
« Reply #2 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.
A man who never made a mistake never made anything

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Connect an object's text/property field to other objects
« Reply #3 on: October 06, 2021, 11:52:01 AM »
Perhaps one of these will help you:

Copy Field
Match Field Formatting