Author Topic: Making a Block Annotative via Lisp  (Read 2940 times)

0 Members and 1 Guest are viewing this topic.

SLJOHNSON

  • Guest
Making a Block Annotative via Lisp
« on: March 04, 2009, 12:49:08 PM »
Hello all,

I've been scouring the web searching for a way to make a block annotative with a lisp routine. I've seen the vlax-put-property command and I've seen the that an isdynamicblock value of -1 signifies that a block is annotative. But I also see that isdynamicblock has (RO) behind it. I presume that means 'read only', so I'd be limited to testing if it was or not annotative through the isdynamicblock property.

Yet the block dialog window has a check box that can alter that. So there is a mechanism to change the isdynamicblock value. So, is there a way to alter that property via lisp? or should I look to another language?

I'm inserting blocks via lisp for out surveyors and I'd like an alternative to changing annotativedwg setting in each block dwg.

We are in Civil 3D 2009.

Thanks,
Shannon

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Making a Block Annotative via Lisp
« Reply #1 on: March 04, 2009, 12:57:00 PM »
To see if an item is annotative, you have to look into the entities extension dictionary.  This should show you the something about it.  I wrote it awhile ago to help someone out, but I don't use it, as I don't use annotative entities.

Code: [Select]
(defun c:Test ()

    (foreach lst
             (entget
                 (cdr
                     (assoc
                         340
                         (entget
                             (cdr
                                 (assoc
                                     360
                                     (entget
                                        (cdr
                                            (assoc
                                                 360
                                                 (entget (car (entsel "\n Select viewport: ")))
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
         (print lst)
     )
     (princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.