- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Looking to Change Specific Dynamic Blocks to "Regular" Blocks
Referencing the thread started by Burniksapwet 11-18-2016
whose post referenced a thread at theswamp
http://www.theswamp.org/index.php?topic=32681.msg382548#msg382548
where it looks like MP originated the code
Which Pbejse solved with an "undynamic.lsp" that works wonderfully on every dynamic block in a drawing. I love how it appends the effective names for the resulting "regular" blocks!
My posts to that thread were back in Feb 2017, where I was trying to make Pbejse's lisp work only on dynamic blocks in model space. But since then, I've come up with perhaps a better scenario if it could be made to work.
Now this may be asking the impossible, but here goes:
A list of block names to be acted upon, either within the "undynamic" lisp itself, or possibly a separate file? (which may actually be easier and less risky for users to update the list and not mess up the actual code)
A command that checks the drawing for any dynamic blocks listed in the block list file, and if it encounters any of them, runs the "undynamic" action.
So i guess there could be 3 separate files. "Undynamic.lsp" "Checker.lsp", and "BlockList" (not sure if blocklist would be a .txt or .lsp)
This is how I envision it working...
User loads the "Checker" lisp and initiates the "Checker"
A Counter is set to zero, and the "Checker" checks the drawing for dynamic blocks listed in the "BlockList" file.
if counter remains zero, checker simply exits.
If counter hits 1, checker stops checking, runs "Undynamic".
"Undynamic" lisp reads the same "BlockList" file and converts all the dynamic blocks in the drawing that are in the list.
I think the "Undynamic.lsp" pbejse posted overwrites the dynamics with the corresponding static blocks, but if not of course purge the DB's that are on the list
Maybe "undynamic.lsp" gives a report at the end something like "(# of) Dynamic Blocks converted to Standard Blocks"? (guess that's not really necessary but would give the user some assurance that something did in fact happen). Possibly, if "Checker.lsp" finds no match, reports something like "No matching Dynamic Blocks Found" ?
Attached is the "undynamic.lsp" posted by pbejse Nov 2016 for reference.
Anyone wants to take a crack at this please do, and please also share your results!
Thanks!
Solved! Go to Solution.