.NET

Reply
Mentor
BrentBurgess1980
Posts: 162
Registered: ‎06-16-2008
Message 1 of 2 (117 Views)

Import Layers from Filter

117 Views, 1 Replies
12-03-2012 12:02 AM

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

*Expert Elite*
_gile
Posts: 2,115
Registered: ‎04-29-2006
Message 2 of 2 (114 Views)

Re : Import Layers from Filter

12-03-2012 12:17 AM in reply to: BrentBurgess1980

Hi,

 

Look at the WblockCloneObjects() method.

Gilles Chanteau
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!