I have this lisp routine that our engineers use. I have tweaked it in the past but I cannot identify why it fails now. I would be grateful if someone with more skill than I have help me to identify the issue and how to correct it. The routine should allow a selection of a polyline and then placement of mtext field that shows the square footage. it fails after the selection point for the placement of the field. It doesn't error but it doesn't show the text either.
(defun c:arl64 ()
(vl-load-com)
;;get a reference to model space
(setvar "textsize" 0.09375)
(setvar "luprec" 0)
(setq *model-space*
(vla-get-ModelSpace
(vla-get-ActiveDocument (vlax-get-acad-object))
)
)
;;pass this function an entity and a point
(defun LinkedArea (ent pt / obj objID ip width str)
;;convert the entity to an object
(setq ar2 (car (entsel "\nSelect Area Boundary: ")))
(setq objID (vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))) "GetObjectIdString" (vlax-ename->vla-object ar2) :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
(setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " objID ">%).Area \\f \"%pr0%lu2%ct4%qf1 SQ. FT.\">%"))
;;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 Text Insertion Point: "))
;;Call the function
(linkedarea a b)
(princ)
)s
Thanks,
Sean