Insert block based on field content

Insert block based on field content

tevansERD
Advocate Advocate
805 Views
2 Replies
Message 1 of 3

Insert block based on field content

tevansERD
Advocate
Advocate

I am trying to write a lisp routine that will insert a block based on the content of a filed. I have done this with attributes but not fields. I want to insert a block if the City field = Arlington. here is what I have so far

 

(setq BLKPATH "S:/CAD/Projects/AutoCAD/Configuration/Common/Notes/")
(setq CITY (strcase (substr CITY (-(strlen CITY) 1) 2)))
;(setq do_both 0)
(setq BLKNAME (strcat BLKPATH "Arlington_Note")) ; sets the PATH
(if (= CITY "ARLINGTON") (command "-INSERT" BLKNAME "0,0" "" "" ""))

 

Another question, can a lisp routine be run from a Batch file instead of a script?

 

I am thinking the code will be different since it is looking at a Field and not an Attribute

Any suggestions would be appreciated.

0 Likes
806 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Post a dwg sample of an object with the field...
0 Likes
Message 3 of 3

tevansERD
Advocate
Advocate

here is our title block, City is in the text string in the upper right corner

0 Likes