Area into table Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Area into table Field
How to add multiple objects in this code below?
(defun c:test(/ tab ent Obj pt tObj row col)
(vl-load-com)
(if (and (setq tab (car (entsel "\nSelect Table: ")))
(eq "ACAD_TABLE" (cdr (assoc 0 (entget tab)))))
(while
(and
(setq ent (car (entsel "\nSelect Object: ")))
(vlax-property-available-p
(setq Obj
(vlax-ename->vla-object ent)) 'Area))
(while
(progn
(setq pt (getpoint "\nClick into Cell to place field: "))
(cond ((vl-consp pt)
(if (eq :vlax-true
(vla-hittest
(setq tObj
(vlax-ename->vla-object tab))
(vlax-3D-point pt)
(vlax-3D-point (trans '(0 0 1) 0 1)) 'row 'col)) nil
(princ "\n** No Cell Selected **")))
(t (princ "\n** No Point Selected **")))))
(vla-setText tObj row col
(strcat
"%<\\AcObjProp Object(%<\\_ObjId "
(vl-princ-to-string
(vla-get-Objectid Obj))
">%).Area \\f \"%lu2%pr2%ps[, Sq m]\">%")))
(princ "\n** No Table Selected **"))
(princ))