Automatic block attribute update in 1000's of drawings

Automatic block attribute update in 1000's of drawings

Anonymous
Not applicable
2,589 Views
14 Replies
Message 1 of 15

Automatic block attribute update in 1000's of drawings

Anonymous
Not applicable

Hello,

 

I am new to this forum and this is my first post, hopefully there is someone here that could help.

 

Our drawings are 99% made up of dynamic blocks and we have an archive of at least 800 drawn blocks all of which are made up of attributes e.g.. Code, description, length (variable) and dynamic grips like move, flip, rotate, visibility states, lengthen etc.

 

These blocks are used in about 1500 active customer drawings.

 

The problem we are trying to find a solution to is, when we change any feature on a block we then have to manually change all the customer drawings which contain the newly changed block, one at a time. As you can imagine this is inefficient and time consuming.

 

Does anyone know of a way of automatically updating all our customer drawings with the updated block even if the block has been manipulated differently in each customer drawing?

 

Thanks.

 

0 Likes
2,590 Views
14 Replies
Replies (14)
Message 2 of 15

dbroad
Mentor
Mentor

Make the changes to one drawing. Record the commands needed to make the changes and put them into a script file.  Download and install scriptpro from Autodesk.  Use the wizard to select the drawings or folders and start the process.  Start with a few drawings to test the process.  Save your scriptpro settings and reuse as necessary by reopening.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 3 of 15

pbejse
Mentor
Mentor

@Anonymous wrote:

 

 Does anyone know of a way of automatically updating all our customer drawings with the updated block even if the block has been manipulated differently in each customer drawing?

 

Thanks.

 


Sounds easy enough. Tell us more, are you using Xrefs? On the pdf  the dynamic blocks appears to have Flip/Rotate/Visibility values. when you say "change any feature of the block" does it deal mostly with flip/rotate or visibility?

 

 

0 Likes
Message 4 of 15

Anonymous
Not applicable

Hi Thank you very much for your response.

 

Firstly I am not sure if everyone creates a block the same way so I will explain how my company trained me. When I receive a component on my desk I would then open a new DWG and draw the component as accurately as possible. I then open BEDIT and add all the features which are required and save the DWG on the Z drive (drive for AutoCAD only). when we create a customer drawing I would then use the insert tab and search for the saved component and insert this into the customer drawing as a block. We also use tool palettes to insert blocks.

 

I know other people would draw the component within the customer drawing and covert this to a block to only be used in this drawing.

 

Anyhow back to our problem. I would say the main point we need to address would be a feature to be used in CAD which is similar to the "Find and Replace" tool in Excel. Lets say a component 080121 becomes obsolete from supplier and we replace this with component 080200. Can AutoCAD find all 80121 blocks in every customer drawing and automatically replace with 080200? And would all the dynamic values be maintained within each drawing?

 

A different change might be the code of a component might slightly change from AF125X to now be 1ZZAF125X. The code is saved in the block as a constant attribute (see attachment). When I make this change the block code, how do I automatically change the other instances across maybe 500 customer drawings?

 

The same scenario would probably apply if we was to change the geometry of a component in the block or if extra information was added. 

 

Thank you for taking the time to look at our problem.

 

0 Likes
Message 5 of 15

Anonymous
Not applicable

Hello Thank you very much for your reply.

 

After reading your response it is clear that I will need to do some research on script files, what they are and how they are used. Once I am more familiar with this I would be able to respond to you in more detail as I am sure I will have more questions. 

 

"Use the wizard to select the drawings or folders and start the process." If script files are as simple as selecting the drawings to update then this possibility would be very appealing to us. Therefore I will be investigating this straight away.

 

Thanks again for your help.

0 Likes
Message 6 of 15

pbejse
Mentor
Mentor

 


LEe.churchill wrote:

 

When I make this change the block code, how do I automatically change the other instances across maybe 500 customer drawings?

 

 


Tell me, where are 500 customer drawings located? Do you access to these files all the time? Is it not possible to use XREF instead? Although a lisp program can do find and replace across 500 drawings, External Reference is still the fastest way to update drawings.

 


.... when we create a customer drawing I would then use the insert tab and search for the saved component and insert this into the customer drawing as a block. We also use tool palettes to insert blocks. 


By the look of things, it appears that you do have access to the files. Maybe we can go ahead with Search & Replace approach. 


 I know other people would draw the component within the customer drawing and covert this to a block to only be used in this drawing.


But in your case ,  a dynamic block with parameters. Got it. How complex is your Dynamic Block?

 

 

 

0 Likes
Message 7 of 15

dbroad
Mentor
Mentor

You  can do everything you want to do with ScriptPro.  If you need to change dynamic block properties automatically, however, you will also need to use a programming language (LISP or .NET) to make the changes. This means that you will either need to develop the programming skills necessary, hire a programmer, or be completely dependent on volunteer help on this newsgroup.  A business shouldn't depend on newsgroups IMO.  

 

If you have a minimal understanding of AutoLISP, then these dynamic block functions by Lee Mac might help.

 

To change a block's definition, or its "attribute" values, you could just use commands.  A script to change dynamic block properties would need to use a program created for that use.

 

Xrefs, BTW, do not have dynamic block properties accessible in the target drawing, so if you need adaptable components, your dynamic block approach and dynamic block library are a sound approach.

 

Sidebar: Your alternative is to continue making the changes by using the toolpalette's redefine option but then you would need a program to find which drawings contain your blocks. On that subject, I am very disappointed to disclose that the contentexplorer, which could have helped you with this process, has been broken by Windows 10 Creator Update. It has been abandoned as a command in AutoCAD 2017 and later, since it uses features no longer supported by Microsoft to mine the contents of drawing files.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 8 of 15

Anonymous
Not applicable

Hi,

Thanks again for your continued support.

 

All our blocks and customer drawings are located on the Z drive (autoCAD drive) in separate files. I have attached a screen shot for you to see the file path. We have constant access to anything on this AutoCAD drive.

The only time I have used Xref is to insert an image into a drawing. therefor I will investigate further how this can be used for blocks.

For LISP I think we may this already for a different operation in Cad but we got a consultant to implement this so Its another aspect we nee dot learn.

 

The complexity of our blocks vary some just have a move attribute associated to it but some have a lot more I have shown an example in the attachment. I have never seen dynamic blocks from another company so I am not sure if ours are complicated or not?

 

I will start learning Xref commands straight away if this is the way forward.

0 Likes
Message 9 of 15

Anonymous
Not applicable

Hi Dbroad,

 

Thank you for your explanation.

 

I looked at the link you attached and this indeed does look similar to what we already use for calculating volume, therefor I am sure our company would give us the resources to learn this side of AutoCAD to be able to be self sufficient as this way of working has now doubled in demand.

 

Could you tell me is LISP for hardened CAD experts or is this programme writing accessible for the lighter CAD users?

0 Likes
Message 10 of 15

pbejse
Mentor
Mentor

@Anonymous wrote:

 

...Xrefs, BTW, do not have dynamic block properties accessible in the target drawing,...


True but Xref approach would work in this case if you play it right. the attributes are constant anyways. We did something like this on a commercial kitchen project way back. Updating the drawings with a new models  still works til this day. 

 

Message 11 of 15

dbroad
Mentor
Mentor

There a some good tutorials, texts, and websites to get you started on AutoLISP.  It does take time and practice to learn and it helps to have some programming training.  There is a good internal AutoLISP editor(VLIDE) where you can experiment, load, and test simple lisp expressions.  For a basic understanding, it might take 20 hours.  For a complete understanding, it might take 60 to 80 hours.  Of course, being able to apply knowledge to a programming task is a talent that might vary greatly from individual to individual.

 

You could start by Googling "autolisp tutorial".  Many of the links on the first page of results are worth viewing.  Afralisp is probably the best training website.  Another good search is Visual Lisp tutorial.

 

NOTE:  Concerning batch processing, be careful to avoid processing customer files where the customers have already bought and installed the old models.  If models involve size changes outside the range of the original blocks or if the dynamic block parameters use fundamentally different names and settings, then only manual editing will be appropriate.

 

@pbejse

Xrefs could be a good approach but only by making the dynamic block changes in the library and saving numerous copies of the original block with the settings preset.  Answers to your questions concerning exactly how dynamic blocks are implemented might reveal the appropriateness.

 

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 12 of 15

pbejse
Mentor
Mentor

@Anonymous wrote:

.  Answers to your questions concerning exactly how dynamic blocks are implemented might reveal the appropriateness.

 


Fair enough thumbsup.gif

0 Likes
Message 13 of 15

Anonymous
Not applicable

I use AcCoreConsole to process drawings all the time

Finding and replacing blocks while maintaining block attributes is easy enough to do, but haven't tried this with dynamic block settings.

If you can perform all commands to fix a drawing using basic AutoCAD commands or AutoLISP without ActiveX, then this can be done.

 

Here is an simple example of changing the base original and purging drawings -

 

 

Create a .BAT file that will process each drawing (with text between '----')

-------------------------------------------

echo off
echo Starting AcCoreConsole
c:
cd C:\Program Files\Autodesk\AutoCAD 2018
echo Enter Block Sub-Folder name [F:\Blocks\...]
SET /P dname=Enter F:\Block Sub-Folder name ? 
FOR %%f in ("F:\Blocks\%dname%\*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2018\AcCoreConsole.exe" /i "%%f" /s "C:\Blocks\_FixBase.scr" /l en-US
echo Done!
pause

-------------------------------------------

Note -

This defaults to 'F:\Blocks' folder and allows user to input a subfolder.

You can remove the pause at end if you want.

 

 

Here is an example of '_FixBase.scr' script file to change base point of drawing to 0,0,0, zoom extent and purge 3 times

-------------------------------------------

BASE
0,0,0
ZOOM
E
ZOOM
.95X
PURGE
ALL
*
N
PURGE
ALL
*
N
PURGE
ALL
*
N
UPDATETHUMBNAIL
31
UPDATETHUMBSNOW
SAVE

Y

 

-------------------------------------------

Message 14 of 15

dbroad
Mentor
Mentor

I've used both the ACCoreconsole and ScriptPro. Since ScriptPro can access the core console directly or can run any version of autocad installed, its wizard is much easier to use than using a batch file to call it directly IMO and can take advantage of the coreconsole's ability to work in the background and to invoke multiple processes.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 15 of 15

dennis
Advisor
Advisor

Try browsing the Autodesk App Store.  A quick search on "block attribute" gave a page of possible apps.

https://apps.autodesk.com/

 

0 Likes