Jump to content

Lisp to toggle layer only works for lines inside a block, unless I undo/redo it

Recommended Posts

I wrote a short lisp to toggle a layer between frozen/thawed based on this post by Lee Mac:



It works as expected for the most part, but something about our company's layer states is messing it up. If I start from a layer state where everything is thawed, the lisp works. But if I start from a layer state where my target layer is frozen then I use the lisp to toggle it to thawed, freestanding polylines do not show up, but polylines of that layer that are inside a block do show up. What's even weirder is that if I undo the command then redo it, then everything shows up.


I'm completely baffled, so if anyone has any advice or suggestions I'd greatly appreciate it.

toggle test.dwg


Layer States - DXR.lsp

Share this post

Link to post
Share on other sites

Actually, that wasn't it. Of course when I saw it wasn't working as I expected, RE and REA were the very first things I tried. So I just now went back to the original thread to see if I missed something and, sure enough, I had. :oops::facepalm: The drawing didn't need to be regenerated, the entities needed to be updated after entmod. I still don't understand why or even what updating an entity even means, lol. Ultimately, it's working now and that's what I care about. But if anybody can shed some light on what's going on here, I'd love to hear about it. Especially why plines inside blocks were updated after entmod but free standing ones weren't. Thaaaanks :D

Share this post

Link to post
Share on other sites

Well, BricsCAD shows a different, the expected?, behavior here. After thawing a layer with togglelayer.lsp‎ both nested and non-nested entities on that layer remain invisible until the viewport is regenerated.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now