Jump to content

Automatically filling out the Drawing Property from Titleblock Information


kam1967

Recommended Posts

Hi!

I try to use this code:

;; Returns list of the Anonymous names taken by a Dynamic Block (if any)  -  Lee Mac 2011  -  www.lee-mac.com
;; Arguments:  block  - name of Dynamic Block.

(defun AnonymousInstancesof ( block / def rec nme ref lst )
 (while (setq def (tblnext "BLOCK" (null def)))
   (if (= 1 (logand 1 (cdr (assoc 70 def))))
     (progn
       (setq rec
         (entget
           (cdr
             (assoc 330
               (entget
                 (tblobjname "BLOCK" (setq nme (cdr (assoc 2 def))))
               )
             )
           )
         )
       )
       (while (setq ref (assoc 331 rec))
         (if
           (and
             (eq block (vla-get-effectivename (vlax-ename->vla-object (cdr ref))))
             (not (member nme lst))
           )
           (setq lst (cons nme lst))
         )
         (setq rec (cdr (member (assoc 331 rec) rec)))
       )
     )
   )
 )
 (reverse lst)
)

(print (AnonymousInstancesof "blockname"))

But if file has a table I have an error:

"error: ActiveX Server returned the error: unknown name: EffectiveName".

If I delete a table everything is good.

What is wrong with this code?

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    7

  • kam1967

    5

  • pBe

    5

  • eyde

    2

Top Posters In This Topic

Posted Images

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.

Guest
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...