Turn Layers On and Off?

  • Jared Davis

    Jared Davis - 2003-06-11

    Can you give me a hint or some sample code to turn off a layer on the current drawing?

    • Ed Karlo

      Ed Karlo - 2003-06-12

      This really needs some new methods to turn layers on and off in a simple manner.  However, you have access to all the sections, tables and entities of a loaded drawing and you can modify anything directly.  To turn layers on and off you can do something like this:

      Yxxf D; // loaded drawing
      YxxfTblLayer layer =
      if (layer != null) // layer found
          layer.aci = -Math.abs(layer.aci); // negative color means layer is off

      Take a look at the Javadoc for Yxxf (the drawing), YxxfSecTables (the tables section) and YxxfTblLayer (the layer table) for more info and other methods that might be useful.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks