i want to replace the old template with the new one as mentioned in attached drawing

i want to replace the old template with the new one as mentioned in attached drawing

nilesh.bhosale
Advocate Advocate
609 Views
8 Replies
Message 1 of 9

i want to replace the old template with the new one as mentioned in attached drawing

nilesh.bhosale
Advocate
Advocate

Dear Sir,

I have to replace new drawing template with old drawing template in almost 3000 drawings.

but i need to copy from old template attribute texts ( i.e. drawing number, drawing title etc.)  and paste to new template attribute texts.

 

can anyone create a lisp to do the same

 

i am attached sample drawing

0 Likes
610 Views
8 Replies
Replies (8)
Message 2 of 9

Sea-Haven
Mentor
Mentor

You would make a script that opens the dwg's read the title block attributes slect the ones you want and make a list in correct order including blanks.

 

Then erase title block, insert new title block and populate atts.

 

If you do a little homework its a pretty straight forward task google "get-attributes" and "-insert". You did not say which attribute equals what other attribute.

0 Likes
Message 3 of 9

pbejse
Mentor
Mentor

@nilesh.bhosale wrote:

I have to replace new drawing template with old drawing template in almost 3000 drawings.

i am attached sample drawing


 

That would be the existing block "Std_A1"  with the the block "TKII_A1" which incidentally doesn't have any attribute except when you explode it [ as shown on your attached sample drawing ] ,  then I assumed "TKII_MHE_SYSTEM"  is now the target block. Do you need the "Std_A1" to stay intact and not exploded but update the "TKII_MHE_SYSTEM" information?

 

 

0 Likes
Message 4 of 9

nilesh.bhosale
Advocate
Advocate

we just wants to replace new templates with old one

and import selected attributes from old templates

 

this whole process will be done manually, because the old template name is different in different drawings so we have to delete the old template manually by opeing the drawing and then insert the new template on the same place. BUT just required some of attribute text to be imported in new template.

 

 

0 Likes
Message 5 of 9

nilesh.bhosale
Advocate
Advocate

there are almost 3000 drawings and i just wants to save my time to replace all the templates

the old templates in different drawings has different names so cant recognize them.

so i need to open each drawing and do it manually.

and that why i am expecting the solution

0 Likes
Message 6 of 9

pbejse
Mentor
Mentor

@nilesh.bhosale wrote:

this whole process will be done manually, because the old template name is different in different drawings so we have to delete the old template manually by opeing the drawing and then insert the new template on the same place. BUT just required some of attribute text to be imported in new template.


That will be fine IF the TAG name remains the same. if not, the user may have to select the attribute one after the other to "get" and "set" the attribute the values, which means the new block will need to be inserted first so the user can manually select what attribute values goes to where and what especially if the TAG name does not match.

 

(defun c:ctxt (/ source target)	
  (while
    (and (setq source (car (nentsel "\nSelect Source: ")))
	 (setq target (car (nentsel "\nSelect target ")))
	 )
    (vla-put-textstring (vlax-ename->vla-object target)      
    	(vla-get-textstring
    		(vlax-ename->vla-object source)))
    )
  (princ)
  )

 

 

May require a regen if the "TKII_MHE_SYSTEM" block or any attribute will remain as nested object.

 

If its the former then we can automate the process. It would help if you identify what attribute value(s) you want to copy, otherwise you may need a list of tag names which shows the "From" and "To".  And what of the issue of exploding the block "TKII_A1" as it does not have the target attributes on the parent block. 

 

HTH

 

0 Likes
Message 7 of 9

nilesh.bhosale
Advocate
Advocate

let us keep it simple....

 

can we simply replace the templates?? by selecting list of drawings in folder?

is there any possibility to make a routine lisp file to replace all the old templates with new one without opening the drawings.JUST TO SELECT THE ALL THE DRAWINGS IN WHICH OLD TEMPLATES ARE THERE AND BY RUNNING ROUTINE IT WOULD AUTOMATICALLY REPLACE TEMPLATES??

 

 

0 Likes
Message 8 of 9

pbejse
Mentor
Mentor

@nilesh.bhosale wrote:

JUST TO SELECT THE ALL THE DRAWINGS IN WHICH OLD TEMPLATES ARE THERE AND BY RUNNING ROUTINE IT WOULD AUTOMATICALLY REPLACE TEMPLATES??


Really? All caps?  Believe me I understand the KISS principle. Replacing the templates is easy, but my questions are all about this:

 


@nilesh.bhosale wrote:

... and import selected attributes from old templates


Thank you anyway

 

0 Likes
Message 9 of 9

Kent1Cooper
Consultant
Consultant

[The language here is somewhat confusing -- the word "template" has a specific meaning in AutoCAD, and this isn't about that.  You're talking about what most in English would call a Title Block.]

 

For the future, this is an argument for using XREF's.  Then updating the Xref source drawing will cause it to be updated automatically in all drawings that refer to it.  But that has the complication that Xref's cannot include Attributes.  So the collection of Attributes would need to be in a Block, not part of the Xref.  If they're not all in the same positions in the new Block as in the old, that would involve all the complications already discussed about transferring Attribute values.  But if you can manage to have the Attribute locations remain the same, as in the case of updating a Title Block Xref just to change the company address or logo or something, you would not need to update the Block containing the Attributes at all.

Kent Cooper, AIA
0 Likes