Performance issue, Civil3d, insertion of dynamic blocks

Hi,
I was wondering if anybody has encountered and solved this type of issue.
I have a script that among other things inserts a lot of dynamic blocks (around 1000 when unfiltered or limited) and sets the properties (both parameters and attributes) of said blocks.
My issue is that when I freeze the part of the script that does the block insertion the script runs fairly quickly through. When I include the block insertion part MANY (or most, of the other nodes upstream from the block insertion part) that previously finished in a matter of milliseconds now take almost 7s to complete. Due to the script being long an additional 7s for each node leads to unacceptable total script running times.

I’m using the add-in “TuneUp” to monitor excecution times of different nodes.

What I’ve done so far:

  1. Tried purging the anonymous blocks after each rerun of the script.
  2. Tried inserting regular blocks and later replacing them with the dynamic block (I did some testing with another script and this seemed to be a significantly faster way to insert dynamic blocks)

What I’m asking:
A: Is this a known issue? If so are there workarounds?
B: Does anybody know are my issues related with dynamic block insertion?
C: … or with parameter modification?
D: something else?
E: Is it likely that the script would run quicker If i insert the dynamic blocks and edit the parameters of my dynamic blocks with a python script?

EDIT: I am using c3d 2022. I’m now trying C3D2024 to check if there’s a difference.

I’m not sure
Try to work through

AeccLaunchDynamoPlayer
1

Before I try this I would like to now why @hosneyalaa you suggest this? Is dynamoplayer faster than using dynamo itself? To my experience it is more cumbersome to use dynamoplayer when debugging…?

Hola Amigo @Buzz0m buenas, can you upload some screen shots of your script? it would be easier to understand where the problem is, so quickly I would advise to reduce the number of nodes, start grouping data and work with levels instead of many same nodes for different lists although I’m not sure how you are working, cheers! :wink:

2 Likes

Hi @Buzz0m

And also if possible to drop here sample dwg file which includes dynamic blocks with parameters and attributes. It will help others who’s trying to help you.

As mentioned @mzjensen
dynamo Holds the internal memory A lot of information
if the size The work is great

Working with dynamic blocks is significantly slower. I experience the same with my Civil 3D plugins.

1 Like

Here is a dwg-file with the dynamic block and a corresponding script which inserts the blocks. The script has one input for dynamo player which is essentially how many blocks to insert. Please feel free to comment anything! =)
DynamoForum_DynBlockDemo.dwg (2.0 MB)
dynblokInsertTEST.dyn (310.5 KB)
I am aware that the dynamic block is unnecessarily complicated, but I don’t think that that should affect the performance this much(?)!

Thanks for the clarification! I’ll post back when I’ve tried this with the original script and respective drawing.

Did anybody have the chance to check this out? At least confirm my issues with performance? Perhaps the part of the script where the properties are manipulated could be made more elegant with a different structuring of the data and the dynamo nodes?

Amigo @Buzz0m buenas.
I have already checked your files and it looks like you are doing everything correctly; your post made me remember when I was learning Revit my first instinct was to create dynamic blocks in autocad and reproduce the operation of revit parametric families (Cable Tray) I realized that autocad loses performance very quickly with this type of dynamic blocks particularly with stretch type parameters the larger the value of the parameter the longer it takes to execute the instruction and if there are several elements it is simply worse performance, maybe it is a good idea to consider using Alignments instead of Dynamic Blocks.

1 Like

Thanks for confirming my thoughts!

1 Like

@Anton_Huizinga (and others ofc as well), have you experimented with python code when it comes to manipulating dynamic blocks? I’m considering venturing into python in Dynamo to solve my problem.

It is so frustrating watch 99.5% of the script work flawlessly in less than 20s and then waiting for the last 0.5% of dynamic block property updates take hours and hours. Could python solve this issue or is this kind of “built into” the way autocad handles dynamic blocks?

Thanks for any help!

Working with dynamic blocks is much slower in general. I assume doing things with Python will speed up the process in Dynamo, but still it takes more time compared to static blocks.

1 Like