Jump to content

How to add multiple objects selection in the below code


Recommended Posts

(defun c:test(/ tab ent Obj pt tObj row col)


(if (and (setq tab (car (entsel "\nSelect Table: ")))

(eq "ACAD_TABLE" (cdr (assoc 0 (entget tab)))))




(setq ent (car (entsel "\nSelect Object: ")))


(setq Obj

(vlax-ename->vla-object ent)) 'Area))





(setq pt (getpoint "\nClick into Cell to place field: "))

(cond ((vl-consp pt)

(if (eq :vlax-true


(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




(vla-get-Objectid Obj))

">%).Area \\f \"%lu2%pr2%ps[, Sq m]\">%")))

(princ "\n** No Table Selected **"))


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...