Example #1
0
        /// <summary>
        /// Initialize the variables
        /// </summary>
        private void Initialize()
        {
            //ColorMode
            m_colorMode     = new List <String>();
            m_enumColorMode = new List <Autodesk.Revit.DB.ImportColorMode>();
            m_colorMode.Add("Black and white");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.BlackAndWhite);
            m_colorMode.Add("Preserve colors");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.Preserved);
            m_colorMode.Add("Invert colors");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.Inverted);

            //Placement
            m_placement     = new List <String>();
            m_enumPlacement = new List <Autodesk.Revit.DB.ImportPlacement>();
            m_placement.Add("Center-to-center");
            m_enumPlacement.Add(Autodesk.Revit.DB.ImportPlacement.Centered);
            m_placement.Add("Origin-to-origin");
            m_enumPlacement.Add(Autodesk.Revit.DB.ImportPlacement.Origin);

            //Unit
            m_unit     = new List <String>();
            m_enumUnit = new List <Autodesk.Revit.DB.ImportUnit>();
            m_unit.Add("Auto-Detect");
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Default);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Foot.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Foot);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Inch.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Inch);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Meter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Meter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Decimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Decimeter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Centimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Centimeter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Millimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Millimeter);
            m_unit.Add("Custom");
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Default);

            //VisibleLayersOnly
            m_visibleLayersOnly     = new List <String>();
            m_enumVisibleLayersOnly = new List <bool>();
            m_visibleLayersOnly.Add("All");
            m_enumVisibleLayersOnly.Add(false);
            m_visibleLayersOnly.Add("Visible");
            m_enumVisibleLayersOnly.Add(true);

            //Whether active view is 3D
            m_is3DView = false;
            if (m_activeDoc.ActiveView.ViewType == Autodesk.Revit.DB.ViewType.ThreeD)
            {
                m_is3DView = true;
            }

            //Views
            m_views = new ViewSet();
            GetViews();

            m_importCustomScale       = 0.0;
            m_importOrientToView      = true;
            m_importUnit              = Autodesk.Revit.DB.ImportUnit.Default;
            m_importThisViewOnly      = false;
            m_importView              = m_activeDoc.ActiveView;
            m_importColorMode         = Autodesk.Revit.DB.ImportColorMode.Inverted;
            m_importPlacement         = Autodesk.Revit.DB.ImportPlacement.Centered;
            m_importVisibleLayersOnly = false;

            m_filter = "DWG Files (*.dwg)|*.dwg";
            m_title  = "Import DWG";
        }
Example #2
0
        /// <summary>
        /// Initialize the variables
        /// </summary>
        private void Initialize()
        {
            //ColorMode
            m_colorMode = new List<String>();
            m_enumColorMode = new List<Autodesk.Revit.DB.ImportColorMode>();
            m_colorMode.Add("Black and white");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.BlackAndWhite);
            m_colorMode.Add("Preserve colors");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.Preserved);
            m_colorMode.Add("Invert colors");
            m_enumColorMode.Add(Autodesk.Revit.DB.ImportColorMode.Inverted);

            //Placement
            m_placement = new List<String>();
            m_enumPlacement = new List<Autodesk.Revit.DB.ImportPlacement>();
            m_placement.Add("Center-to-center");
            m_enumPlacement.Add(Autodesk.Revit.DB.ImportPlacement.Centered);
            m_placement.Add("Origin-to-origin");
            m_enumPlacement.Add(Autodesk.Revit.DB.ImportPlacement.Origin);

            //Unit
            m_unit = new List<String>();
            m_enumUnit = new List<Autodesk.Revit.DB.ImportUnit>();
            m_unit.Add("Auto-Detect");
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Default);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Foot.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Foot);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Inch.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Inch);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Meter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Meter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Decimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Decimeter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Centimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Centimeter);
            m_unit.Add(Autodesk.Revit.DB.ImportUnit.Millimeter.ToString());
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Millimeter);
            m_unit.Add("Custom");
            m_enumUnit.Add(Autodesk.Revit.DB.ImportUnit.Default);

            //VisibleLayersOnly
            m_visibleLayersOnly = new List<String>();
            m_enumVisibleLayersOnly = new List<bool>();
            m_visibleLayersOnly.Add("All");
            m_enumVisibleLayersOnly.Add(false);
            m_visibleLayersOnly.Add("Visible");
            m_enumVisibleLayersOnly.Add(true);

            //Whether active view is 3D
            m_is3DView = false;
            if (m_activeDoc.ActiveView.ViewType == Autodesk.Revit.DB.ViewType.ThreeD)
            {
                m_is3DView = true;
            }

            //Views
            m_views = new ViewSet();
            GetViews();

            m_importCustomScale = 0.0;
            m_importOrientToView = true;
            m_importUnit = Autodesk.Revit.DB.ImportUnit.Default;
            m_importThisViewOnly = false;
            m_importView = m_activeDoc.ActiveView;
            m_importColorMode = Autodesk.Revit.DB.ImportColorMode.Inverted;
            m_importPlacement = Autodesk.Revit.DB.ImportPlacement.Centered;
            m_importVisibleLayersOnly = false;

            m_filter = "DWG Files (*.dwg)|*.dwg";
            m_title = "Import DWG";
        }