Import selective layers from DXF

Hi,

I am trying to import selective layers from an input DXF using the API. I was able to import all the layers from the DXF using the code below :

            ImportDxfDwgData importData = (ImportDxfDwgData)swApp.GetImportFileData(sDwgFileName);

            //Unit

            importData.set_LengthUnit("", (int)swLengthUnit_e.swMM);

            //Position

            bool bRet = importData.SetPosition("", (int)swDwgImportEntitiesPositioning_e.swDwgEntitiesCentered, 0, 0);

            //Sheet scale

            bRet = importData.SetSheetScale("", 1.0, 2.0);

            //Paper size

            bRet = importData.SetPaperSize("", (int)swDwgPaperSizes_e.swDwgPaperAsize, 0.0, 0.0);

            //Import method

            importData.set_ImportMethod("", (int)swImportDxfDwg_ImportMethod_e.swImportDxfDwg_ImportToExistingPart);           

            Feature swFeat = swFeatMgr.InsertDwgOrDxfFile2(sDwgFileName, importData);


I am not able to select the layers in the DXF for import. The GUI allows this but the macro does not record that action. Please advise.

Thanks,

Hersh

SolidworksApi macros