IDesignTable Interface

Solidworks学习笔记-链接Solidworks

NameDescription备注
AutoAddNewConfigsGets or sets whether to automatically add rows or columns to the design table when new configurations are added to the model.  获取或设置在将新配置添加到模型时是否自动向系列零件设计表添加行或列。
AutoAddNewParamsGets or sets whether or not to automatically add rows or columns to the design table when new parameters are added to the model.  获取或设置在将新参数添加到模型时是否自动向系列零件设计表添加行或列。
ColumnHiddenGets the visibility state of the specified column.  获取指定列的可见性状态。
EnableCellDropdownListsGets or sets whether to enable cell drop-down lists in the design table.  获取或设置是否启用系列零件设计表中的单元格下拉列表。
FileNameGets or sets the Microsoft Excel file for this design table.  获取或设置此系列零件设计表的 Microsoft Excel 文件。
LastErrorGets or sets the last error that occurred in this design table.  获取或设置此设计表中发生的最后一个错误。
LinkToFileGets or sets whether to link the design table to the model.  获取或设置是否将系列零件设计表链接到模型。
RowHiddenGets the visibility state of the specified row.  获取指定行的可见性状态。
SourceTypeGets or sets the type of source file for this design table.  获取或设置此系列零件设计表的源文件类型。
UpdatableGets or sets whether edits to the model update the design table.  获取或设置对模型的编辑是否更新系列零件设计表。
WarnGets or sets whether to display a warning when invalid information is encountered in the design table when updating the design table.  获取或设置更新设计表时,在设计表中遇到无效信息时是否显示警告。
WorksheetGets the Microsoft Excel worksheet for this design table.  获取此系列零件设计表的 Microsoft Excel 工作表。
This example shows how to disable drop-down lists for cells in a design table.

//----------------------------------------------------------
// Preconditions:
// 1. Open a part that has a design table.
// 2. In the SolidWorks Visual Studio for Applications Tools 
//    IDE, click Project > Add Reference > .NET > 
//    Microsoft.Office.Interop.Excel > OK.
// 3. Open the Immediate window.
//
// Postconditions:
// 1. Gets and edits the design table.
// 2. Disables drop-down lists for cells in the design table.
// 3. Updates and closes the design table.
// 4. Examine the Immediate window.
//
// NOTE: You can also expand Tables on the ConfigurationManager
// tab, right-click Design Table, and click Edit Feature to
// verify that Enable cell drop-down lists (may be slower)
// is not selected.
//------------------------------------------------------------
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
using System;
using System.Diagnostics;
 
namespace Macro1CSharp.csproj
{
    public partial class SolidWorksMacro
    {
  
        public void Main()
        {
            ModelDoc2 swModel = default(ModelDoc2);
            DesignTable swDesignTable = default(DesignTable);
            bool status = false;
            Microsoft.Office.Interop.Excel.Worksheet myWorksheet = default(Microsoft.Office.Interop.Excel.Worksheet);
 
            swModel = (ModelDoc2)swApp.ActiveDoc;
 
            //Get and edit design table
            swDesignTable = (DesignTable)swModel.GetDesignTable();
            myWorksheet = (Microsoft.Office.Interop.Excel.Worksheet)swDesignTable.EditTable2(false); 
            //Allow changes to characteristics of design table
            swDesignTable.EditFeature();

            //Disable cell drop-down lists
            status = swDesignTable.EnableCellDropdownLists;
            Debug.Print("Current \"Enable cell drop-down lists (may be slower)\" setting: " + status);
            swDesignTable.EnableCellDropdownLists = false;
            status = swDesignTable.EnableCellDropdownLists;
            Debug.Print("Modified \"Enable cell drop-down lists (may be slower)\" setting: " + status);
 
            status = swDesignTable.UpdateFeature();
            Debug.Print("Design table feature updated? " + status);
 
            //Update and close design table
            swDesignTable.UpdateTable((int)swDesignTableUpdateOptions_e.swUpdateDesignTableAll, true);
 
        }
 
        /// <summary>
        ///  The SldWorks swApp variable is pre-assigned for you.
        /// </summary>
        public SldWorks swApp;
    }
}

NameDescription备注
AddRowAdds a row to the design table.  在系列零件设计表中添加一行。
AttachActivates the design table within the part or assembly document.  激活零件或装配体文档中的系列零件设计表。
DetachDetaches the design table from the Microsoft Excel sheet.  从 Microsoft Excel 工作表中分离系列零件设计表。
EditFeatureLets you change the characteristics of the design table.  允许您更改系列零件设计表的特征。
EditTable2Lets you edit the design table.  允许您编辑系列零件设计表。
GetColumnCountGets the number of columns in the design table that are currently visible in the model view.  获取设计表中当前在模型视图中可见的列数。
GetEntryTextGets the contents of the specified cell as a string regardless of the cell's data type.  无论单元格的数据类型如何,都以字符串形式获取指定单元格的内容。
GetEntryValueGets the contents of the specified cell.  获取指定单元格的内容。
GetHeaderTextGets the header text for the specified column.  获取指定列的标题文本。
GetRowCountGets the number of rows in the design table that are currently visible in the model view.  获取设计表中当前在模型视图中可见的行数。
GetStartColumnNumberGets the number of the first column in which a dimension is displayed.  获取显示维度的第一列的编号。
GetStartRowNumberGets the number of the first row in which dimensions are displayed.  获取显示维度的第一行的编号。
GetTitleGets the design table title.  获取系列零件设计表标题。
GetTotalColumnCountGets the number of columns in the design table.  获取系列零件设计表中的列数。
GetTotalRowCountGets the number of rows in the design table.  获取系列零件设计表中的行数。
GetVisibleColumnCountGets the number of columns visible in this design table.  获取此系列零件设计表中可见的列数。
GetVisibleLeftColumnNumberGets the number of the leftmost visible column.  获取最左侧可见列的编号。
GetVisibleRowCountGets the number of rows visible in the design table.  获取系列零件设计表中可见的行数。
GetVisibleTopRowNumberGets the number of the topmost visible row.  获取最顶部可见行的编号。
IsActiveGets whether the design table is currently being edited.  获取当前是否正在编辑系列零件设计表。
SaveAsExcelFileSaves the design table to a Microsoft Excel file.  将系列零件设计表保存到 Microsoft Excel 文件。
SetEntryTextSets the text value of the specified entry.  设置指定条目的文本值。
SetEntryValueSets the data type and value in the specified cell.  设置指定单元格中的数据类型和值。
SetRowChangedSets the number of the row that was changed.  设置更改的行号。
UpdateFeatureUpdates the characteristics of the design table.  更新系列零件设计表的特征。
UpdateModelApplies the edits to the design table to the model.  将设计表的编辑应用到模型。
UpdateTableApplies the changes made to the design table to the model.  将对系列零件设计表所做的更改应用于模型。
This example shows how to get a design table and its contents.

//---------------------------------------
// Preconditions:
// 1. Open a part or assembly document that
//    contains a design table.
// 2. Verify that a design table exists by 
//    expanding Tables in the ConfigurationManager.
// 3. Open the Immediate window.
//
// Postconditions:
// 1. Prints the design table contents to the 
//    Immediate window.
// 2. Examine the Immediate window.
//----------------------------------------
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
using System;
using System.Diagnostics;
 
namespace GetTitleDesignTableCSharp.csproj
{
 
    partial class SolidWorksMacro
    {
 
        public void Main()
        {
            ModelDoc2 swModel = default(ModelDoc2);
            DesignTable swDesTable = default(DesignTable);
            int nTotRow = 0;
            int nTotCol = 0;
            string sRowStr = null;
            int i = 0;
            int j = 0;
            bool bRet = false;
 
            swModel = (ModelDoc2)swApp.ActiveDoc;
 
            swDesTable = (DesignTable)swModel.GetDesignTable();
            bRet = swDesTable.Attach();
 
            nTotRow = swDesTable.GetTotalRowCount();
            nTotCol = swDesTable.GetTotalColumnCount();
            Debug.Print("File = " + swModel.GetPathName());
            Debug.Print("  Title        = " + swDesTable.GetTitle());
            Debug.Print("  Row          = " + swDesTable.GetRowCount());
            Debug.Print("  Col          = " + swDesTable.GetColumnCount());
            Debug.Print("  TotRow       = " + nTotRow);
            Debug.Print("  TotCol       = " + nTotCol);
            Debug.Print("  VisRow       = " + swDesTable.GetVisibleRowCount());
            Debug.Print("  VisCol       = " + swDesTable.GetVisibleColumnCount());
            Debug.Print("");
 
            for (i = 0; i <= nTotRow; i++)
            {
                sRowStr = "  |";
                for (j = 0; j <= nTotCol; j++)
                {
                    sRowStr = sRowStr + swDesTable.GetEntryText(i, j) + "|";
                }
                Debug.Print(sRowStr);
            }
            swDesTable.Detach();
        }
 
        /// <summary>
        /// The SldWorks swApp variable is pre-assigned for you.
        /// </summary>
 
        public SldWorks swApp;
 
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 智慧社区背景与挑战 随着城市化的快速发展,社区面临健康、安全、邻里关系和服务质量等多方面的挑战。华为技术有限公司提出智慧社区解决方案,旨在通过先进的数字化技术应对这些问题,提升城市社区的生活质量。 2. 技术推动智慧社区发展 技术进步,特别是数字化、无线化、移动化和物联化,为城市社区的智慧化提供了可能。这些技术的应用不仅提高了社区的运行效率,也增强了居民的便利性和安全性。 3. 智慧社区的核心价值 智慧社区承载了智慧城市的核心价值,通过全面信息化处理,实现对城市各个方面的数字网络化管理、服务与决策功能,从而提升社会服务效率,整合社会服务资源。 4. 多层次、全方位的智慧社区服务 智慧社区通过构建和谐、温情、平安和健康四大社区模块,满足社区居民的多层次需求。这些服务模块包括社区医疗、安全监控、情感沟通和健康监测等。 5. 智慧社区技术框架 智慧社区技术框架强调统一平台的建设,设立数据中心,构建基础网络,并通过分层建设,实现平台能力及应用的可持续成长和扩展。 6. 感知统一平台与服务方案 感知统一平台是智慧社区的关键组成部分,通过统一的RFID身份识别和信息管理,实现社区服务的智能化和便捷化。同时,提供社区内外监控、紧急救助服务和便民服务等。 7. 健康社区的构建 健康社区模块专注于为居民提供健康管理服务,通过整合医疗资源和居民接入,实现远程医疗、慢性病管理和紧急救助等功能,推动医疗模式从治疗向预防转变。 8. 平安社区的安全保障 平安社区通过闭路电视监控、防盗报警和紧急求助等技术,保障社区居民的人身和财产安全,实现社区环境的实时监控和智能分析。 9. 温情社区的情感沟通 温情社区着重于建立社区居民间的情感联系,通过组织社区活动、一键呼叫服务和互帮互助平台,增强邻里间的交流和互助。 10. 和谐社区的资源整合 和谐社区作为社会资源的整合协调者,通过统一接入和身份识别,实现社区信息和服务的便捷获取,提升居民生活质量,促进社区和谐。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值