2 Replies Latest reply on Jul 11, 2018 6:53 AM by Veit Wollinger

    api layer dxf

    Veit Wollinger

      Hello,

      search for ideas, code snippets to unify layer_a and layer_b in SW-drawing on layer_ab in dxf

        • Re: api layer dxf
          Artem Taturevych

          One of the possible approaches you can take is:

           

          • Create new temp layer (ab)
          • Traverse all elements and temporarily change their layer via ::Layer property for the ones in layer a or b. Then save dxf and revert the changes. This would require traversing of every entity which could have layer (may be quite a lot of code)

           

          Another approach is to layer-by-layer hide all layers except of the ones required to be merged (i.e. a and b) using ILayer::Visible property. So only those entities are visible. Then select all entities (you can use IModelDocExtension::SelectAll method). Now use the following example: Change Layer For Selected Objects In Drawing to change the layer for all selected entities to the merged one (ab). Now save dxf and undo changes.