PDA

View Full Version : Entity of the title block



alanhuro
12th May 2005, 04:49 pm
Hi

I need your help. I tried to automate the process of changing the title block but now I stuck with modify the variable. I was able to use the command -attedit to to change the file name but everytime I have to provide the exact value before to change to different value. Since each drawing has a different file name so I can not write an lsp script to do it for every page. I look for an althernative that is to change the entity of that block. The script is use is this

(setq mysset (ssget)) ;Grap the object from draw
(setq ObjPropertyList (entget (ssname mysset 0))) ;assign the object list to variable

REsult:

((-1 . <Entity name: 18144c8>) (0 . "INSERT") (330 . <Entity name: 18134f8>) (5 . "C21") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "0") (100 . "AcDbBlockReference") (66 . 1) (2 . "FORMAT") (10 0.0 0.0 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50
. 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))

The problem is I can not find any group code that storing a string of a file name. I try to explorer deeper for group code 330 to see if the string is store in there or not

(setq TextEntity (cdr (assoc 330 ObjPropertyList))) ;pull the entity 330 from an object list

(setq ObjPropertyList2 (entget TextEntity)) ; check what inside

But still I only receive crap from that. I check all the entity name from 330 but still have not found a string that I can manipulate.


Can you help me find a way to pull out the string store in an object. thank a lot for your help.

Alan

hendie
13th May 2005, 08:21 am
if you're looking to get the file name you can use

&#40;setq Fname &#40;fnsplitl &#40;getvar "dwgname"&#41;&#41;&#41;

but it appears that you are actually looking for the block name which is code 2

&#40;2 . "FORMAT"&#41;
your block name is Format

I'm not sure what you are trying to do ~ can you explain a bit further please ?

alanhuro
13th May 2005, 04:13 pm
Thank a lot for your reply Hendie. I type

(setq Fname (fnsplitl (getvar "dwgname")))

and got the file name like this

("" "1234006" ".dwg")

when I type

(2. "FORMAT")

It does not work

I just wonder how can I change the filename "1234006" to different name and put back to that block.

thank

hendie
13th May 2005, 06:02 pm
to get the "FORMAT" from the block you woudl have to use the ASSOC function

I even less clear about what you want to do now... do you want to change the block name or the file name or both ?