zoukankan      html  css  js  c++  java
  • AutoCAD.Net/C#.Net QQ群:193522571 从已有cuix中导入工作经典空间

    [CommandMethod("cloneWS")]
    public void cloneWorkSpace()
    {
        try
        {
            string sourceCuiFileName = @"C:TEST.CUIX";
            if (!File.Exists(sourceCuiFileName)) return;
    
            string curCuiFileName = Application.GetSystemVariable("MENUNAME").ToString() + ".cuix";
            CustomizationSection curCui = new CustomizationSection(curCuiFileName);
            CustomizationSection sourceCui = new CustomizationSection(sourceCuiFileName);
    
            string workspaceName = "test1";
    
            WorkspaceCollection curWorkspaces = curCui.Workspaces;
            int curWsIdx = curWorkspaces.IndexOfWorkspaceName(workspaceName);
    
            // test1 already exists, so just return
            // cloning overwrites the existing Workspace
            if (curWsIdx != -1) return;
    
            Workspace newWs = sourceCui.getWorkspace(workspaceName);
    
            ContainerCloneAction containerClnAction = new ContainerCloneAction();
            Workspace ws = curWorkspaces[0];
            curWorkspaces.Clone(newWs, ws, ref containerClnAction);
    
            if (curCui.IsModified)
            {
                curCui.Save();
            }
        }
        catch (Autodesk.AutoCAD.Runtime.Exception e)
        {
            Application.ShowAlertDialog("AutoCAD exception:
    " + e.Message);
            return;
        }
    }
  • 相关阅读:
    Java--笔记(4)
    Java--笔记(3)
    Java--笔记(2)
    Java--笔记(1)
    Java--剑指offer(10)
    Java--剑指offer(9)
    网络基础面试常考知识点
    Java--剑指offer(8)
    Keil C51 的printf
    C语言中以十六进制输出字符型变量会出现'ffffff"的问题
  • 原文地址:https://www.cnblogs.com/swtool/p/11669773.html
Copyright © 2011-2022 走看看