+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Newbie
    Discipline
    Architectural
    Using
    AutoCAD 2018
    Join Date
    Aug 2018
    Posts
    2

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

    Registered forum members do not see this ad.

    I wrote a short lisp to toggle a layer between frozen/thawed based on this post by Lee Mac:
    http://www.cadtutor.net/forum/showth...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.
    Attached Files

  2. #2
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    700

    Default

    You have posted (almost) the same question here:
    https://www.theswamp.org/index.php?topic=54364.0

    The solution to your problem: you have to regenerate after thawing layers. See kpblc's answer.
    The undo/redo sequence triggers an automatic regeneration.
    BricsCAD 18

  3. #3
    Forum Newbie
    Discipline
    Architectural
    Using
    AutoCAD 2018
    Join Date
    Aug 2018
    Posts
    2

    Default

    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. 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

  4. #4
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    700

    Default

    Registered forum members do not see this ad.

    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.
    BricsCAD 18

Similar Threads

  1. Pls Help :) Lisp that detects if Polylines (Layer 1, 2, 3) is inside PL (Layer 1)
    By digitalmapper in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 8th Dec 2016, 04:52 am
  2. Trim Lines Even If Line Is Inside A Block
    By kArThIcK hAcKeR in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 8th Aug 2014, 09:12 am
  3. Command History/Redo an Undo two Undoes ago!
    By toberino in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 23rd Jul 2014, 12:50 pm
  4. Lisp for pulling intersection data from two lines inside a block
    By Darksaber501st in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 22nd Feb 2014, 01:16 pm
  5. Undo/redo
    By Organic in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 5th Mar 2009, 10:45 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts