Updating blocks without opening every drawing

Updating blocks without opening every drawing

Johnny.Goodson
Explorer Explorer
1,187 Views
6 Replies
Message 1 of 7

Updating blocks without opening every drawing

Johnny.Goodson
Explorer
Explorer

Hello, 

 

At our facility, we have over 4k P&ID's. A majority of them have equipment data blocks. I've been asked if we can create a "program" that could remove certain data or update the block without having to open every drawing. In the photo attached, I either need to remove the SAP# attribute or remove that section of the block all together. Removal of the attribute would suffice at this time. 

Any ideas on what the best path forward would be?

0 Likes
1,188 Views
6 Replies
Replies (6)
Message 2 of 7

Ed__Jobe
Mentor
Mentor

Yes, you could certainly use VBA, but it sounds like you don't have any/much programming experience. If that's true, I would recommend using a script and then running the script with ScriptPro. You can schedule it to run at night.

For tips on how to schedule the job at night, see this thread.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 7

Ed__Jobe
Mentor
Mentor

@Johnny.Goodson Did the reply answer your question? Are you able to write a script? It's just what you would type at the command line. With ScriptPro, you just have to figure out how to process one dwg. ScriptPro takes care of the batch processing.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 4 of 7

Johnny.Goodson
Explorer
Explorer

It makes sense. I'm not sure how to write a code to select the block attribute and erase it. I will be researching it

0 Likes
Message 5 of 7

Ed__Jobe
Mentor
Mentor

In a script (its just an ascii text file, e.g. Notepad, with a scr extension), you just record what you can type at the command line. You can't use commands that use dialogs because you can't control the mouse. You can also do your work in vba, and in the script, run the vba with the VBARUN command.

 

Search this forum for selecting and editing blocks. It's not that hard to do what you are asking. If I have more time later, I can help further. If it were me, I would do what I want in VBA and then execute it in the script.

 

Edit: You might also want to post a dwg with the blocks in them.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 6 of 7

grobnik
Collaborator
Collaborator

@Ed__Jobe I don't know in deep script pro software, is there the script recoding option?

If @Johnny.Goodson start recording for one drawing I guess he can apply the same to the others.

0 Likes
Message 7 of 7

Ed__Jobe
Mentor
Mentor

ScriptPro is easy to use. You just select the script file to run and select the files to run it on. You can also save this as a job file to run again. It also has some special commands that you can use in your script, like for saving the file to a previous version. The script only needs to process one file. You do need to have it account for variations in the files you might open.

 

No, there is no script recording option, but you can copy the text you enter at the command line. Hit F2, rt+click, Copy History. Pretty simple stuff.

 

Attached is an old script I used to import page setups. IZit has a txt ext because you can't upload scr files..

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes