.NET

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

Import Layers from Filter

100 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*
Posts: 1,981
Registered: ‎04-29-2006
Message 2 of 2 (97 Views)

Re : Import Layers from Filter

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

Hi,

 

Look at the WblockCloneObjects() method.

Gilles Chanteau

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community