Dynamic block visibility into individual block

Dynamic block visibility into individual block

sergio.corredorEZQQT
Participant Participant
6,026 Views
27 Replies
Message 1 of 28

Dynamic block visibility into individual block

sergio.corredorEZQQT
Participant
Participant

Hi everyone, first time posting in the forum.

 

I have a dynamic block that has been distributed around an area using its different visibility options. Now, I need to transform the dynamic blocks into individual blocks keeping their visibility (not sure if this is clear). 

 

For example, the dynamic block has visibility A, B and C. I used each visibility on points 1, 2 and 3 respectively. Now, I need to transform the dynamic block in point 1 to an individual block called A, the dynamic block in point 2 to an individual block called B and the dynamic block in point 3 to an individual block called C.

 

I know I can EXPLODE the dynamic blocks but then I would need to go 1 by one to make then blocks again. If I have 100 blocks it may take a long time.

 

I also have a lisp to split a dynamic block into its different visibility options. It may be helpful at the start of the project before locating all the blocks, but in my case all the blocks are already in place. Also, not sure if I can share the code here (I found it on the internet), I believe it just need to be modified to make it work as I need but I am not an expert on coding.

 

Thanks in advance for any comments.

0 Likes
Accepted solutions (1)
6,027 Views
27 Replies
Replies (27)
Message 21 of 28

sergio.corredorEZQQT
Participant
Participant

Sorry, 2010 version attached.

0 Likes
Message 22 of 28

dlanorh
Advisor
Advisor
Will see what I can do over the next couple of days, I have something that is almost what you want.

I am not one of the robots you're looking for

0 Likes
Message 23 of 28

dlanorh
Advisor
Advisor
Accepted solution

@sergio.corredorEZQQT 

 

Please find lisp attached. 

 

Points to note. There is a bit of a lag/hang  (on my system at least) between selecting a block and all blocks being processed. I cannot pinpoint what is causing this, but it is probably the conversion to a static block.

 

I have tested this on your original lightpost drawing, but please ensure you test it yourself on an example drawing. The lisp will not convert blocks on locked layers and will purge the drawing of unused blocks before exiting.

 

 

I am not one of the robots you're looking for

Message 24 of 28

sergio.corredorEZQQT
Participant
Participant

This is just perfect! Thanks a lot @dlanorh 

0 Likes
Message 25 of 28

mikeshick
Collaborator
Collaborator

i have a drawing with 12 or so dynamic blocks with visibility states.  Together, all the dynamic blocks consume around 16-18MB of space on a file. This is larger than most files I work with, which are generally under 10mb each.  I love the idea of the DB, but they seem to be problematic for my situation, and was looking for a solution to convert each of the visibility states into a single CAD block.  Does your lisp accomplish this.  I've tried, but get errors, like, nothing found, etc.  Do you have any recommendations?

Mike Shick
www.medesigns.us
0 Likes
Message 26 of 28

cem_acikada
Participant
Participant

I get an error saying not a dynamic block!

 

Autocad 2024

0 Likes
Message 27 of 28

yann26L6EPT
Explorer
Explorer

hi  @dlanorh 

I want to use your undynamic script but something is wrong on version 2023 in autocad, it says "Nothing Found" but you can see there a visibility state and I need to be explose in block name visibility.

yann26L6EPT_0-1718364707649.png

 

Please if you can look your code and why it's not work, it will be fantastic.
(I will provide my block I need to convert to static and after I will create a code to replace by another static bloc)

Thanks in advance
Sincerly

0 Likes
Message 28 of 28

yann26L6EPT
Explorer
Explorer

a priori from what I was able to understand it is because my blocks do not have an attribute, it's block on insert line : (setq ss (ssget "_A" '((0 . "INSERT") (66 . 1) (410 . "Model"))))

May be i'm wrong

0 Likes