Hi. Hope someone can help me with this. I'm currently using Revit Structure to produce my drawing sheets, which are then exported to .dwg. All well and good so far. However, the client's document management software 'reads' attribute values from issued .dwgs but not the plain old MTEXT that the Revit exports contain. I need to find a way to copy the text from the MTEXT and paste it into the value field of a corresponding attribute.
I've already created the attributes file which exactly reflects the positions/text styles/insertion points etc of all the text, and through a combination of a script and the action recorder got as far as automating insertion, selection of text, copying contents of text, erasing same text. This is where I get stuck. The next bit should be to select the right attribute to edit and paste the text copied from the MTEXT. The attribute needs to be selected as if I double-clicked on it so as to get straight to the right one to paste the text from the clipboard rather than the first in the list if you do DDATTE, DDEDIT etc. I've tried everything I can think of but the action recorder doesn't seem to like a double-click as it keeps reporting back that nothing was selected, and this obviously causes the routine to fail.
Once I get the routine sorted once, I will need to re-do it for all the other text positions that are required to be attributes in the title block, and then hopefully the whole thing can be applied to every drawing I subsequently export from Revit
Is there a LISP routine in existence that can do all of this for me? Is LISP the right way to go? Or should I persist with scripts and/or the action recorder? Is there anyone out there who has had a similar problem and found a solution? I've tried searching Google, this forum, AUGI etc. but no joy so far...
Have a look at attupd.lsp
This function can be used in scripts or other autolisp functions to set the value of any attribute.
If you have captured the text you want, just invoke:
(attupd [blockname] [attribname] [newvalue])