Jump to content

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


jhadams82

Recommended Posts

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

http://www.cadtutor.net/forum/showthread.php?68095-LISP-for-If-layer-is-frozen-thaw-it-and-vice-versa

 

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

togglelayer.lsp

Layer States - DXR.lsp

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...