.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Import Layers from Filter

1 REPLY 1
Reply
Message 1 of 2
BrentBurgess1980
333 Views, 1 Reply

Import Layers from Filter

Hey All,

 

How would you go about importing layers from a layer filter in a dws file??

public void MyCommand() // This method can have any name
            {
            string standardsFile = @"C:\Temp\Layers.dws";

            using (Database db = new Database(false, false))
                {
                db.ReadDwgFile(standardsFile, FileShare.Read, true, "");
                LayerFilterTree lft = db.LayerFilters;

                LayerFilterCollection lfc = db.LayerFilters.Root.NestedFilters;

                foreach (LayerFilter lf in lfc)
                    {
                        Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(lf.Name + "\n");

                    }
                }

            }

 This is where I am stuck. Any one have any pointers?

 

Cheers

 

Brent

1 REPLY 1
Message 2 of 2
_gile
in reply to: BrentBurgess1980

Hi,

 

Look at the WblockCloneObjects() method.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost