So what I'm trying to say is that the code in the 1st post should be used.
Only thing that should be added in the code is that you select the items you want to undynamic instead of all the blocks.
It is not about 'more sense'. I expect that (vlax-get-acad-object) will fail if the VL extensions have not been loaded. I am using the word 'expect' because I am using BricsCAD where (vl-load-com) is a dummy function and VL functions are available by default.
Yes, I mean that I haven't noticed that instead of checking for such function, I'm instead running it with the possibility of triggering an error, such as:
Testing the (vla-ConvertToStaticBlock) function I have noticed something strange (note: as previously mentioned I use BricsCAD).
My test:
1. Insert the same dynamic block twice.
2. Make identical changes to one or more dynamic properties for each insert.
3. The inserts now look the same but reference different anonymous definitions.
4. Copy one of the inserts.
5. The copy references the same anonymous definition as its original.
6. Only convert the copy to a static block.
7. Result: The original of the copy has also become a static block (probably due to what was mentioned under #5).
If AutoCAD has the same behavior, converting only selected inserts to static blocks would require a more complex solution than the code posted in this thread.
This differs in AutoCAD: inserting two references of the same dynamic block and modifying their dynamic parameters to use the same values results in the two blocks referencing the same anonymous definition.
AutoCAD has the same behaviour (as to be expected, based on the above observation).
This is not the case in AutoCAD: converting one of the dynamic block references has no effect on the others.