0 Members and 1 Guest are viewing this topic.
A LISP program could certainly be written to create the fields for you following selection of the source object and object to house the field. Here is one such example.
(ssget '((0 . "ARC,CIRCLE,ELLIPSE,HATCH,*POLYLINE,REGION,SPLINE")))
(ssget '((0 . "3DSOLID")))
">%).Area>% + "
">%).Volume>% + "
(defun c:VOL ()(vl-load-com);;get a reference to model space(setvar "textsize" 0.09375)(setvar "luprec" 8)(setq *model-space* (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object)) ));;pass this function an entity and a point(defun Linkedvol (ent pt / obj objID ip width str) ;;convert the entity to an object;;; (setq obj (vlax-ename->vla-object ent);;; ;;get the object ID;;; objID (vla-get-objectid obj) (setq vl1 (car (entsel "\nSelect Volume Entity: "))) (setq objID (vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))) "GetObjectIdString" (vlax-ename->vla-object vl1) :vlax-False)) (setq ;;convert the point ip (vlax-3D-Point pt) ;;set the width for the MTEXT width 0.0 ) ;;set the string - this creates the field;;; str (strcat;;; "%<\\AcObjProp Object(%<\\_ObjId "(rtos objID 2 0)">%).Volume \\f \"%lu2%ct6%qcu yd\">%";;; ) (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " objID ">%).Volume \\f \"%lu2%ct6%qf1%pr2 CU YD\">%")) ;;Create the MTEXT entity containing the field. (vla-addMText *model-space* ip width str));; Set A = the entity and set B = Point for text(setq a (car (entsel)) b (getpoint "\n Select Point To Locate Field: "));;Call the function(linkedvol a b)(princ) )