当前位置: 首页>>代码示例>>C#>>正文


C# ModelDoc2类代码示例

本文整理汇总了C#中ModelDoc2的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2类的具体用法?C# ModelDoc2怎么用?C# ModelDoc2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModelDoc2类属于命名空间,在下文中一共展示了ModelDoc2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddModelToList

 internal static void AddModelToList(SwAddin mSwAddin, ModelDoc2 newModel)
 {
     List<ModelDoc2> fM = null;
     string xNameOfAss = mSwAddin.GetXNameForAssembly(false, Path.GetFileNameWithoutExtension(mSwAddin.SwModel.GetPathName()));
     #region Проверка на наличие модели,которая была удалена
     var checkList = new List<ModelDoc2>();
     if (!DictionaryListMdb.ContainsKey(xNameOfAss))
         DictionaryListMdb.Add(xNameOfAss, new List<ModelDoc2>());
     foreach (var m in DictionaryListMdb[xNameOfAss])
     {
         try
         {
             m.GetPathName();
             checkList.Add(m);
         }
         catch (COMException)
         {
             continue;
         }
     }
     #endregion
     if (!checkList.Contains(newModel))
         CheckMdbForDecors(mSwAddin, newModel, checkList, null, fM);
     DictionaryListMdb[xNameOfAss] = checkList;
 }
开发者ID:digger1985,项目名称:MyCode,代码行数:25,代码来源:Decors.cs

示例2: JointAxis

        public JointAxis(SldWorks swApp, AssemblyDoc asm, StorageModel swData, string path, Joint current, int index, RobotModel robot)
        {
            this.swApp = swApp;
            this.asmDoc = asm;
            this.modelDoc = (ModelDoc2)asm;
            this.swData = swData;
            this.path = path;
            this.owner = current;
            this.robot = robot;

            this.AxisIndex = index;

            if (EffortLimit == 0)
            {
                this.EffortLimit = 1;
            }
            if (this.VelocityLimit == 0)
            {
                this.VelocityLimit = 1;
            }

            if (Axis != null)
            {
                CalcAxisVectors();
                //CalcLimits(null);
            }
            if (index == 2)
            {
                IsContinuous = true;
            }
        }
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:31,代码来源:JointAxis.cs

示例3: DocumentEventHandler

 public DocumentEventHandler(ModelDoc2 modDoc, SwAddin addin)
 {
     document = modDoc;
     userAddin = addin;
     iSwApp = (ISldWorks)userAddin.SwApp;
     openModelViews = new Hashtable();
 }
开发者ID:drt-ftl,项目名称:VAMEsolidworksPlugin,代码行数:7,代码来源:EventHandling.cs

示例4: frmFullPrice

        public frmFullPrice(ModelDoc2 model)
        {
            InitializeComponent();

            CurrentState = State.ErrorsHide;
            this.model = model;
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:7,代码来源:frmFullPrice.cs.cs

示例5: setRobot

        /// <summary>
        /// Sets the current robot that is linked to this page
        /// </summary>
        /// <param name="robot">robot to be used</param>
        /// <param name="model">model to be used</param>
        public void setRobot(RobotModel robot, ModelDoc2 model)
        {
            this.robot = robot;
            robotName.Text = robot.Name;

            string[] configurations = model.GetConfigurationNames();

            IncludeFRCfieldBox.Visible = PluginSettings.UseFRCsim;
            if (PluginSettings.UseFRCsim)
            {
                switch (robot.FRCfield)
                {
                    case 2014:
                        FRC2014FieldButton.Checked = true;
                        break;
                    case 2015:
                        FRC2015FieldButton.Checked = true;
                        break;
                    default:
                        NoFieldButton.Checked = true;
                        break;
                }
            }
            if (robot.ExportType == 0)
                SDFExportTypeButton.Checked = true;
            else
                URDFExportTypeButton.Checked = true;
        }
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:33,代码来源:RobotProperties.cs

示例6: AssemblyEventHandler

 public AssemblyEventHandler(ModelDoc2 modDoc, SwAddin addin)
     : base(modDoc, addin)
 {
     doc = (AssemblyDoc)document;
     swModel = modDoc;
     swAddin = addin;
 }
开发者ID:Compac-Michael,项目名称:CustomProperty,代码行数:7,代码来源:EventHandling.cs

示例7: DocumentEventHandler

 public DocumentEventHandler(ModelDoc2 modDoc, SwAddin addin)
 {
     Document = modDoc;
     UserAddin = addin;
     SwApp = UserAddin.SwApp;
     OpenModelViews = new Hashtable();
 }
开发者ID:digger1985,项目名称:MyCode,代码行数:7,代码来源:EventHandling.cs

示例8: frmCopyProject

 public frmCopyProject(SwAddin swAdd,ISldWorks iswApp,ModelDoc2 rootModel,string openFile)
 {
     _swAdd = swAdd;
     _iswApp = iswApp;
     _swModelDoc = rootModel;
     _openFile = openFile;
     InitializeComponent();
     WarningLabel.Text = string.Empty;
 }
开发者ID:digger1985,项目名称:MyCode,代码行数:9,代码来源:frmCopyProject.cs

示例9: KitchenModule

 public KitchenModule(ModelDoc2 _rootModel, Component2 _swRootComponent, SwAddin _swAddin, ModelDoc2 _swModel)
 {
     RootModel = _rootModel;
     swRootComponent = _swRootComponent;
     measure = RootModel.Extension.CreateMeasure();
     swAddin = _swAddin;
     swModel = _swModel;
     rootName = Path.GetFileNameWithoutExtension(RootModel.GetPathName());
 }
开发者ID:digger1985,项目名称:MyCode,代码行数:9,代码来源:KitchenModule.cs

示例10: FrmReplaceComponents

        public FrmReplaceComponents(SwAddin swAddin, Component2[] selComps)
        {
            InitializeComponent();

            _mSwAddin = swAddin;
            _mSelComps = selComps;
            _swModel = (ModelDoc2)_mSwAddin.SwApp.ActiveDoc;

            Show();
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:10,代码来源:frmReplaceComponents.cs

示例11: showAllComponents

 //Except for an exclusionary list, this shows all the components
 public static void showAllComponents(ModelDoc2 model, List<string> hiddenComponents)
 {
     AssemblyDoc assyDoc = (AssemblyDoc)model;
     List<Component2> componentsToShow = new List<Component2>();
     object[] varComps = assyDoc.GetComponents(false);
     foreach (Component2 comp in varComps)
     {
         if (!hiddenComponents.Contains(comp.Name2))
         {
             componentsToShow.Add(comp);
         }
     }
     showComponents(model, componentsToShow);
 }
开发者ID:chlai,项目名称:sw2urdf,代码行数:15,代码来源:Common.cs

示例12: selectComponents

 //Selects components from a list.
 public static void selectComponents(ModelDoc2 model, List<Component2> components, bool clearSelection = true, int mark = -1)
 {
     if (clearSelection)
     {
         model.ClearSelection2(true);
     }
     SelectionMgr manager = model.SelectionManager;
     SelectData data = manager.CreateSelectData();
     data.Mark = mark;
     foreach (Component2 component in components)
     {
         component.Select4(true, data, false);
     }
 }
开发者ID:chlai,项目名称:sw2urdf,代码行数:15,代码来源:Common.cs

示例13: getSelectedComponents

 //Finds the selected components and returns them, used when pulling the items from the selection box because it would be too hard
 // for SolidWorks to allow you to access the selectionbox components directly.
 public static void getSelectedComponents(ModelDoc2 model, List<Component2> Components, int Mark = -1)
 {
     SelectionMgr selectionManager = model.SelectionManager;
     Components.Clear();
     for (int i = 0; i < selectionManager.GetSelectedObjectCount2(Mark); i++)
     {
         object obj = selectionManager.GetSelectedObject6(i + 1, Mark);
         Component2 comp = (Component2)obj;
         if (comp != null)
         {
             Components.Add(comp);
         }
     }
 }
开发者ID:chlai,项目名称:sw2urdf,代码行数:16,代码来源:Common.cs

示例14: Actualization

        public static void Actualization(ModelDoc2 model, SwAddin _mSwAddin)
        {
            Component2 _swSelectedComponent = model.ConfigurationManager.ActiveConfiguration.GetRootComponent3(true);
            OleDbCommand cm;
            OleDbDataReader rd;
            OleDbConnection oleDb;
            if (!_mSwAddin.OpenModelDatabase(model, out oleDb))
                return;
            cm = new OleDbCommand("SELECT * FROM faners ORDER BY FanerName ", oleDb);
            rd = cm.ExecuteReader();
            List<Faner> faners = new List<Faner>();
            while (rd.Read())
            {
                if (rd["FanerType"] as string != null)
                {
                    faners.Add(new Faner((string)rd["FanerName"], (string)rd["FanerType"], (string)rd["DecorGroup"]));
                }
                else
                {
                    faners.Add(new Faner((string)rd["FanerName"], string.Empty, (string)rd["DecorGroup"]));
                }
            }
            rd.Close();
            Feature feature;
            foreach (var faner in faners)
            {
                string suffix = faner.FanerName.Substring(faner.FanerName.Length - 2, 2);

                feature = FindEdge(_swSelectedComponent, faner.AxFanerName);
                if (feature != null)
                {
                    if (feature.IsSuppressed())
                    {
                        _mSwAddin.SetModelProperty(model, "Faner" + suffix, "", swCustomInfoType_e.swCustomInfoText, string.Empty, true);
                        _mSwAddin.SetModelProperty(model, "colorFaner" + suffix, "", swCustomInfoType_e.swCustomInfoText, string.Empty, true);
                    }
                    else
                    {
                        string fieldValue = model.GetCustomInfoValue(string.Empty, "Faner" + suffix);
                        if (fieldValue == string.Empty)
                        {
                            string msgText = "Для данной детали: " + model.GetPathName() + " кромка Faner" + suffix + " в модели не соответствует свойствам файла сборки. Данная кромка не будет импортирована в программу Покупки! Чтобы исправить эту ошибку используйте опцию \"MrDoors - Отделка кромки\"";
                            MessageBox.Show(msgText, @"MrDoors", MessageBoxButtons.OK);
                        }
                    }
                }
            }
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:48,代码来源:frmEdge.cs

示例15: FrmEdge

        public FrmEdge(SwAddin swAddin)
        {
            InitializeComponent();
            _mSwAddin = swAddin;
            _swModel = (ModelDoc2)_mSwAddin.SwApp.ActiveDoc;
            _swSelMgr = (SelectionMgr)_swModel.SelectionManager;
            _swAsmDoc = (AssemblyDoc)_swModel;
            _swAsmDoc.NewSelectionNotify += NewSelection;

            pbEdge11.Image = null;
            pbEdge12.Image = null;
            pbEdge21.Image = null;
            pbEdge22.Image = null;
            NewSelection();

            Show();
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:17,代码来源:frmEdge.cs


注:本文中的ModelDoc2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。