C# SolidWorks 二次开发 API — 2018版 中文翻译 ModelDoc 方法

ActivateSelectedFeature Method (IModelDoc2) 激活选定的要素进行编辑。
AddConfiguration3 Method (IModelDoc2) 将新配置添加到此模型文档。
AddDiameterDimension2 Method (IModelDoc2) 在选定项的指定位置添加直径标注。
AddDimension2 Method (IModelDoc2) 在选定实体的指定位置创建显示维度。
AddFeatureMgrView3 Method (IModelDoc2) 将指定的选项卡添加到FeatureManager设计树视图中。
AddHorizontalDimension2 Method (IModelDoc2) 在指定位置为当前选定的实体创建水平尺寸标注。
AddIns Method (IModelDoc2) 显示“加载项管理器”对话框。
AddLightSource Method (IModelDoc2) 使用指定的名称将光源类型添加到场景中。
AddLightSourceExtProperty Method (IModelDoc2) 存储光源的浮点、字符串或整数值。
AddLightToScene Method (IModelDoc2) 将光源添加到场景中。
AddLoftSection Method (IModelDoc2) 将放样截面添加到混合特征。
AddPropertyExtension Method (IModelDoc2) 将属性扩展添加到此模型。
AddRadialDimension2 Method (IModelDoc2) 在选定项的指定位置添加径向尺寸。
AddSceneExtProperty Method (IModelDoc2) 存储场景的浮点、字符串或整数值。
AddVerticalDimension2 Method (IModelDoc2) 在指定位置为当前选定的实体创建垂直尺寸标注。
AlignOrdinate Method (IModelDoc2) 对齐选定的一组坐标标注。
AlignParallelDimensions Method (IModelDoc2) 以平行方式对齐选定的线性标注。
BlankRefGeom Method (IModelDoc2) 在图形窗口中隐藏选定的参考几何图形。
BlankSketch Method (IModelDoc2) 隐藏选定的草图。
BreakDimensionAlignment Method (IModelDoc2) 断开属于对齐组(平行或共线)的任何选定标注的关联。
ClearSelection2 Method (IModelDoc2) 清除选择列表。
ClearUndoList Method (IModelDoc2) 清除此模型文档的撤消列表。
Close Method (IModelDoc2) 未实施。使用isldworks::closedoc。
CloseFamilyTable Method (IModelDoc2) 关闭当前正在编辑的设计表。
ClosePrintPreview Method (IModelDoc2) 关闭此文档当前显示的打印预览页。
ClosestDistance Method (IModelDoc2) 计算两个几何对象之间的距离和最近点。
CreateArcByCenter Method (IModelDoc2) 在此模型文档中按中心创建圆弧。
CreateCenterLineVB Method (IModelDoc2) 创建从p1到p2的中心线,可用于visualbasicforapplications(vba)和其他不支持safearray的basic格式。
CreateClippedSplines Method (IModelDoc2) 创建一个或多个草图样条线线段,这些线段被剪裁到给定的(x1,y1),(x2,y2)矩形上。此矩形位于活动二维草图的空间中。
CreateGroup Method (IModelDoc2) 从当前选定的批注创建批注组。
DeActivateFeatureMgrView Method (IModelDoc2) 停用FeatureManager设计树状图中的选项卡。
DebugCheckIgesGeom Method (IModelDoc2) 转储IGES几何体检查。
DeleteAllRelations Method (IModelDoc2) 删除所有现有关系。
DeleteBendTable Method (IModelDoc2) 删除折弯表。
DeleteBkgImage Method (IModelDoc2) 删除任何背景图像。
DeleteConfiguration2 Method (IModelDoc2) 删除配置。
DeleteDesignTable Method (IModelDoc2) 删除此文档的设计表(如果存在)。
DeleteFeatureMgrView Method (IModelDoc2) 删除FeatureManager设计树中的指定选项卡。
DeleteLightSource Method (IModelDoc2) 删除光源。
DeleteNamedView Method (IModelDoc2) 删除指定的模型视图。
DeriveSketch Method (IModelDoc2) 创建衍生草图。
DeSelectByID Method (IModelDoc2) 从选择列表中删除选定对象。
DimPreferences Method (IModelDoc2) 设置维度首选项。
DissolveLibraryFeature Method (IModelDoc2) 溶解选定的库功能。
DissolveSketchText Method (IModelDoc2) 分解草图文本。
DragTo Method (IModelDoc2) 拖动指定的端点。
DrawLightIcons Method (IModelDoc2) 绘制任何可见光图标。
EditConfiguration3 Method (IModelDoc2) 编辑指定的配置。
EditCopy Method (IModelDoc2) 复制当前选定的项目并将其放置在剪贴板中。
EditCut Method (IModelDoc2) 剪切当前选定的项目并将其放在Microsoft Windows剪贴板上。
EditDatumTargetSymbol Method (IModelDoc2) 编辑基准目标符号。
EditDelete Method (IModelDoc2) 删除所选项目。
EditOrdinate Method (IModelDoc2) 将当前选定的坐标标注置于编辑模式,以便可以向该组添加更多坐标标注。
EditRebuild3 Method (IModelDoc2) 仅重建模型中活动配置中需要重建的功能。
EditRedo2 Method (IModelDoc2) 在此solidworks会话中重复指定数量的操作。
EditRoute Method (IModelDoc2) 使最后选定的路由成为活动路由。
EditSeedFeat Method (IModelDoc2) 获取基于选定面的图案种子特征,并显示该特征的“编辑定义”对话框。
EditSketch Method (IModelDoc2) 允许编辑当前选定的草图。
EditSketchOrSingleSketchFeature Method (IModelDoc2) 编辑草图或草图特征。
EditSuppress2 Method (IModelDoc2) 抑制选定面的选定特征、选定组件或所属特征。
EditUndo2 Method (IModelDoc2) 撤消活动SolidWorks会话中指定数量的操作。
EditUnsuppress2 Method (IModelDoc2) 取消抑制选定的特征或零部件。
EditUnsuppressDependent2 Method (IModelDoc2) 取消抑制选定的特征或零部件及其从属项。
EntityProperties Method (IModelDoc2) 显示选定边或面的“特性”对话框。
EnumModelViews Method (IModelDoc2) 获取此文档中的模型视图枚举。
FeatEdit Method (IModelDoc2) 将当前要素置于编辑模式。
FeatEditDef Method (IModelDoc2) 显示“要素定义”对话框并允许用户编辑值。
FeatureByPositionReverse Method (IModelDoc2) 获取文档中最后一个功能的第n个。
FeatureChamfer Method (IModelDoc2) 创建倒角特征。
FeatureCurvePattern Method (IModelDoc2) 创建曲线驱动的填充图案特征。
FeatureReferenceCurve Method (IModelDoc2) 从曲线阵列创建参考曲线特征。
FileSummaryInfo Method (IModelDoc2) 显示此文件的“文件摘要信息”对话框。
FirstFeature Method (IModelDoc2) 获取文档中的第一个功能。
FontBold Method (IModelDoc2) 在选定的便笺、维度和形位公差s中启用或禁用粗体字体样式。
FontFace Method (IModelDoc2) 更改所选便笺、维度和形位公差s中的字体。
FontItalic Method (IModelDoc2) 启用或禁用选定便笺、维度和形位公差s中的斜体字体样式。
FontPoints Method (IModelDoc2) 更改所选便笺、维度和形位公差s中的字体高度(以磅为单位指定)。
FontUnderline Method (IModelDoc2) 启用或禁用对选定笔记、维度和形位公差加下划线。
FontUnits Method (IModelDoc2) 更改所选便笺、维度和形位公差s中的字体高度(以当前系统单位指定)。
ForceRebuild3 Method (IModelDoc2) 强制重新生成模型中活动配置中的所有要素。
ForceReleaseLocks Method (IModelDoc2) 释放文件系统在文件打开时对其放置的锁,并从文件系统分离该文件。
GetAddToDB Method (IModelDoc2) 获取实体是否直接添加到SolidWorks数据库。
GetAmbientLightProperties Method (IModelDoc2) 获取此模型文档的环境光属性。
GetAngularUnits Method (IModelDoc2) 获取当前角度单位设置。
GetArcCentersDisplayed Method (IModelDoc2) 获取是否显示圆弧中心。
GetBendState Method (IModelDoc2) 获取钣金零件的当前折弯状态。
GetBlockingState Method (IModelDoc2) 获取SolidWorks阻塞状态的当前值,该值在IModelDoc2::SetBlockingState可访问的值范围内。
GetConfigurationByName Method (IModelDoc2) 获取指定的配置。
GetConfigurationCount Method (IModelDoc2) 获取配置数。
GetConfigurationNames Method (IModelDoc2) 获取此文档中配置的名称。
GetConsiderLeadersAsLines Method (IModelDoc2) 获取从该文档中的视图或批注检索行时,是否将引线的显示数据包含为行。
GetCurrentCoordinateSystemName Method (IModelDoc2) 获取当前坐标系的名称或默认坐标系的空字符串。
GetDefaultTextHeight Method (IModelDoc2) 获取此文档使用的默认文本高度。
GetDesignTable Method (IModelDoc2) 获取与此部件或程序集文档关联的设计表。
GetDirectionLightProperties Method (IModelDoc2) 获取平行光属性。
GetDisplayWhenAdded Method (IModelDoc2) 获取创建时是否显示新的草图实体。
GetEntityName Method (IModelDoc2) 获取指定面、边或顶点的名称。
GetEquationMgr Method (IModelDoc2) 获取公式管理器。
GetExternalReferenceName Method (IModelDoc2) 获取外部引用文档的名称(对于联接或镜像部分)。
GetFeatureCount Method (IModelDoc2) 获取此文档中的功能数。
GetFeatureManagerWidth Method (IModelDoc2) 获取FeatureManager设计树的宽度。
GetFirstAnnotation2 Method (IModelDoc2) 获取模型中的第一个批注。
GetFirstModelView Method (IModelDoc2) 获取模型文档中的第一个视图。
GetGridSettings Method (IModelDoc2) 获取当前网格设置。
GetLayerManager Method (IModelDoc2) 获取当前图形文档的图层管理器。
GetLightSourceCount Method (IModelDoc2) 获取光源的数目。
GetLightSourceExtProperty Method (IModelDoc2) 获取为光源存储的浮点、字符串或整数值。
GetLightSourceIdFromName Method (IModelDoc2) 获取指定光源的ID。
GetLightSourceName Method (IModelDoc2) 获取SolidWorks应用程序内部使用的光源的名称。
GetLineCount Method (IModelDoc2) 获取当前草图中的行数。
GetLines Method (IModelDoc2) 获取当前草图中的所有行。
GetModelViewNames Method (IModelDoc2) 获取包含此文档中每个模型视图的名称的列表。
GetNext Method (IModelDoc2) 获取当前solidworks会话中的下一个文档。
GetNumDependencies Method (IModelDoc2) 获取IModelDoc2::GetDependencies2返回的字符串数。
GetPathName Method (IModelDoc2) 获取此文档的完整路径名,包括文件名。
GetPointLightProperties Method (IModelDoc2) 获取点光源属性。
GetPopupMenuMode Method (IModelDoc2) 获取当前弹出菜单模式。
GetPropertyExtension Method (IModelDoc2) 获取此模型上指定的属性扩展名。
GetRayIntersectionsPoints Method (IModelDoc2) 获取由IModelDoc2::RayIntersections生成的交点信息。
GetRayIntersectionsTopology Method (IModelDoc2) 获取由IModelDoc2::RayIntersections生成的拓扑交集。
GetSaveFlag Method (IModelDoc2) 获取文档当前是否脏并且需要保存。
GetSceneBkgDIB Method (IModelDoc2) 获取作为lpdibsection的背景图像。
GetSceneExtProperty Method (IModelDoc2) 获取为场景存储的浮点、字符串或整数值。
GetSpotlightProperties Method (IModelDoc2) 获取聚光灯属性。
GetStandardViewRotation Method (IModelDoc2) 获取相对于前视图的指定视图方向矩阵。
GetTessellationQuality Method (IModelDoc2) 获取当前文档的着色显示图像质量编号。
GetTitle Method (IModelDoc2) 获取显示在活动窗口标题栏中的文档的标题。
GetToolbarVisibility Method (IModelDoc2) 获取工具栏的可见性。
GetType Method (IModelDoc2) 获取文档的类型。
GetUnits Method (IModelDoc2) 获取当前单位设置以及分数基、分数值和使用的有效数字。
GetUpdateStamp Method (IModelDoc2) 获取此文档的当前更新戳。
GetUserUnit Method (IModelDoc2) 获取此文档的单位设置。
GetVisibilityOfConstructPlanes Method (IModelDoc2) 获取构造(引用)平面当前是否可见。
GetZebraStripeData Method (IModelDoc2) 获取斑马线数据。
HideComponent2 Method (IModelDoc2) 隐藏选定的组件。
HideCosmeticThread Method (IModelDoc2) 隐藏选定的装饰线。
HideDimension Method (IModelDoc2) 隐藏此文档中选定的维度。
HideShowBodies Method (IModelDoc2) 设置是隐藏还是显示模型中的实体。
HideSolidBody Method (IModelDoc2) 隐藏当前选定的实体。
IAddConfiguration3 Method (IModelDoc2) 将新配置添加到此模型文档。
IAddDiameterDimension2 Method (IModelDoc2) 在选定项的指定位置添加直径标注。
IAddHorizontalDimension2 Method (IModelDoc2) 在指定位置为当前选定实体创建水平尺寸标注。
IAddRadialDimension2 Method (IModelDoc2) 在选定项的指定位置添加径向尺寸。
IAddVerticalDimension2 Method (IModelDoc2) 在指定位置为当前选定的实体创建垂直尺寸标注。
IClosestDistance Method (IModelDoc2) 计算两个几何对象之间的距离和最近点。
ICreateArc2 Method (IModelDoc2) 基于中心点、起点、终点和方向创建圆弧。
ICreateCenterLine Method (IModelDoc2) 创建从p1到p2的中心线。
ICreateCircle2 Method (IModelDoc2) 基于圆心和圆上的点创建圆。
ICreateCircleByRadius2 Method (IModelDoc2) 基于中心点和指定半径创建圆。
ICreateClippedSplines Method (IModelDoc2) 创建一个或多个草图样条线线段,这些线段被剪裁到给定的(x1,y1),(x2,y2)矩形上。此矩形位于活动二维草图的空间中。
ICreateEllipse2 Method (IModelDoc2) 使用指定的中心点和点创建椭圆。
ICreateEllipticalArc2 Method (IModelDoc2) 创建一个部分椭圆,给出一个中心点,指定主次轴的两点,以及定义椭圆起始点和结束点的两点。
ICreateEllipticalArcByCenter Method (IModelDoc2) 在两点之间创建修剪的椭圆弧。
ICreateLine2 Method (IModelDoc2) 在当前激活的二维或三维草图中创建绘制线。
ICreatePlaneFixed Method (IModelDoc2) 过时。被imodeldoc2替代:icreateplanefixed2。
IFeatureByPositionReverse Method (IModelDoc2) 获取文档中最后一个功能的第n个。
IFeatureReferenceCurve Method (IModelDoc2) 从曲线阵列创建参考曲线特征。
IFirstFeature Method (IModelDoc2) 获取文档中的第一个功能。
IGet3rdPartyStorage Method (IModelDoc2) 获取用于存储在SolidWorks文档中的IStream接口。
IGetActiveSketch2 Method (IModelDoc2) 获取活动草图。
IGetAngularUnits Method (IModelDoc2) 获取当前角度单位设置。
IGetConfigurationByName Method (IModelDoc2) 获取指定的配置。
IGetConfigurationNames Method (IModelDoc2) 获取此文档中配置的名称。
IGetDependencies2 Method (IModelDoc2) 获取模型的所有依赖项。
IGetDesignTable Method (IModelDoc2) 获取与此部件或程序集文档关联的设计表。
IGetEntityName Method (IModelDoc2) 获取指定面、边或顶点的名称。
IGetFirstAnnotation2 Method (IModelDoc2) 获取模型中的第一个批注。
IGetFirstModelView Method (IModelDoc2) 获取模型文档中的第一个视图。
IGetLayerManager Method (IModelDoc2) 获取当前绘图文档的图层管理器。
IGetLines Method (IModelDoc2) 获取当前草图中的所有行。
IGetModelViewNames Method (IModelDoc2) 获取包含此文档中每个模型视图的名称的列表。
IGetNext Method (IModelDoc2) 获取当前solidworks会话中的下一个文档。
IGetNumDependencies2 Method (IModelDoc2) 获取imodeldoc2::igetdependencies2返回的字符串数。
IGetRayIntersectionsPoints Method (IModelDoc2) 获取由imodeldoc2::irayintersections生成的交点信息。
IGetRayIntersectionsTopology Method (IModelDoc2) 获取由imodeldoc2::irayintersections生成的拓扑交集。
IGetStandardViewRotation Method (IModelDoc2) 获取相对于前视图的指定视图方向矩阵。
IGetUnits Method (IModelDoc2) 获取当前单位设置以及分数基、分数值和使用的有效数字。
IGetUserUnit Method (IModelDoc2) 获取此文档的单位设置。
IGetVersionHistoryCount Method (IModelDoc2) 获取保存imodledoc2::iversionhistory返回的数据所需的数组大小。
IInsertDatumTag2 Method (IModelDoc2) 在选定位置插入基准标记符号。
IInsertGtol Method (IModelDoc2) 在此文档中创建新的形位公差符号(gtol)。
IInsertNote Method (IModelDoc2) 在此文档中插入注释。
IInsertProjectedSketch2 Method (IModelDoc2) 将当前草图中选定的草图项投影到选定曲面上。
IInsertSketchForEdgeFlange Method (IModelDoc2) 在此钣金零件中插入iFeatureManager::InsertSheetMetalEdgeFlange2的草图。
IInsertSketchText Method (IModelDoc2) 插入草图文本。
IInsertWeldSymbol3 Method (IModelDoc2) 在模型中插入焊接符号。
IListAuxiliaryExternalFileReferences Method (IModelDoc2) 获取此模型的辅助外部文件引用的名称。
IMultiSelectByRay Method (IModelDoc2) 选择指定类型的多个对象,这些对象在距离半径内的方向向量(x,y,z)中的点(x,y,z,以米为单位)与光线相交。
Insert3DSplineCurve Method (IModelDoc2) 通过选定的参照点插入三维样条曲线。
InsertAxis2 Method (IModelDoc2) 根据当前选定的项目插入参考轴,并自动选择轴的大小。
InsertBendTableEdit Method (IModelDoc2) 插入折弯表并将折弯表置于其编辑状态。
InsertBendTableNew Method (IModelDoc2) 在模型文档中插入新的折弯表。
InsertBendTableOpen Method (IModelDoc2) 将现有的弯曲表从文件插入到该模型文档中。
InsertBkgImage Method (IModelDoc2) 插入场景背景图像。
InsertCompositeCurve Method (IModelDoc2) 根据选择插入合成曲线。
InsertConnectionPoint Method (IModelDoc2) 基于选定的点和选定的平面项添加连接点。
InsertCurveFile Method (IModelDoc2) 创建曲线。
InsertCurveFileBegin Method (IModelDoc2) 创建曲线。
InsertCurveFileEnd Method (IModelDoc2) 创建曲线。
InsertCurveFilePoint Method (IModelDoc2) 为曲线创建点。
InsertDatumTag2 Method (IModelDoc2) 在选定位置插入基准标记符号。
InsertDeleteHole Method (IModelDoc2) 删除曲面的选定孔。
InsertDome Method (IModelDoc2) 插入圆顶。
InsertExtendSurface Method (IModelDoc2) 沿选定的面或边延伸曲面。
InsertFamilyTableEdit Method (IModelDoc2) 从Microsoft Excel编辑打开的设计表。
InsertFamilyTableNew Method (IModelDoc2) 将现有的设计表从模型插入到选定的绘图视图中。
InsertFamilyTableOpen Method (IModelDoc2) 插入指定的Microsoft Excel设计表。
InsertFeatureReplaceFace Method (IModelDoc2) 创建替换面特征。
InsertFeatureShell Method (IModelDoc2) 创建壳特征。
InsertFeatureShellAddThickness Method (IModelDoc2) 在多厚度壳特征中向面添加厚度。
InsertGtol Method (IModelDoc2) 在此文档中创建新的形位公差符号(gtol)。
InsertHatchedFace Method (IModelDoc2) 填充图形中选定的面或闭合的草图段。
InsertHelix Method (IModelDoc2) 创建恒定螺距的螺旋线或螺旋线。
InsertLoftRefSurface2 Method (IModelDoc2) 从选定的纵断面、中心线和导向曲线创建放样曲面。
InsertNewNote3 Method (IModelDoc2) 创建新便笺。
InsertNote Method (IModelDoc2) 在此文档中插入注释。
InsertObject Method (IModelDoc2) 激活“Microsoft插入对象”对话框。
InsertOffsetSurface Method (IModelDoc2) 插入偏移曲面。
InsertPlanarRefSurface Method (IModelDoc2) 插入平面参考曲面。
InsertPoint Method (IModelDoc2) 在此模型文档中插入点。
InsertProjectedSketch2 Method (IModelDoc2) 将选定的草图投影到选定的面或曲面上。
InsertRadiateSurface Method (IModelDoc2) 基于选择创建辐射曲面。
InsertRefPoint Method (IModelDoc2) 根据当前选择插入参考点。
InsertRip Method (IModelDoc2) 创建接缝特征。
InsertRoutePoint Method (IModelDoc2) 基于选定的点添加布线点。
InsertSheetMetalBreakCorner Method (IModelDoc2) 在钣金零件中插入折断角。
InsertSheetMetalClosedCorner Method (IModelDoc2) 在此模型文档中插入钣金闭合角。
InsertSheetMetalFold Method (IModelDoc2) 在选定对象处插入折叠特征。
InsertSheetMetalJog Method (IModelDoc2) 在当前模型文档中插入钣金折弯。
InsertSheetMetalUnfold Method (IModelDoc2) 在选定对象处插入展开特征。
InsertSketchForEdgeFlange Method (IModelDoc2) 在此钣金零件中插入iFeatureManager::InsertSheetMetalEdgeFlange2的草图。
InsertSketchPicture Method (IModelDoc2) 在当前草图中插入图片。
InsertSketchPictureData Method (IModelDoc2) 在当前草图中插入图片。
InsertSketchPictureDatax64 Method (IModelDoc2) 在64位应用程序中将图片插入当前草图。
InsertSketchText Method (IModelDoc2) 插入草图文本。
InsertSplinePoint Method (IModelDoc2) 插入样条曲线点。
InsertSplitLineProject Method (IModelDoc2) 通过将草图线投影到面上来拆分面。
InsertSplitLineSil Method (IModelDoc2) 通过沿选定面的轮廓创建分割线来分割面。
InsertWeldSymbol3 Method (IModelDoc2) 在模型中插入焊接符号。
InspectCurvature Method (IModelDoc2) 将曲率梳添加到选定草图段。
IParameter Method (IModelDoc2) 获取指定的参数。
IRelease3rdPartyStorage Method (IModelDoc2) 关闭指定的存储流。
IsActive Method (IModelDoc2) 获取指定的程序集组件是否在此模型文档中显示或隐藏。
IsEditingSelf Method (IModelDoc2) 获取是否正在另一个文档的上下文中编辑此模型。
ISetAngularUnits Method (IModelDoc2) 设置当前角度单位。
ISetNextSelectionGroupId Method (IModelDoc2) 设置所有剩余选择的组ID。
ISketchSplineByEqnParams Method (IModelDoc2) 使用指定的B曲线参数在激活的二维草图上创建样条曲线。
IsLightLockedToModel Method (IModelDoc2) 获取指定的灯光是否已修复。
IsOpenedReadOnly Method (IModelDoc2) 获取SolidWorks文档是否以只读模式打开。
IsOpenedViewOnly Method (IModelDoc2) 获取SolidWorks文档是否在仅查看模式下打开。
IsTessellationValid Method (IModelDoc2) 获取当前方面集是否有效。
IVersionHistory Method (IModelDoc2) 获取一个字符串数组,该数组指示保存此模型文档的版本,包括当前打开模型文档的SolidWorks版本,以及数组中返回的最后一个值。
LBDownAt Method (IModelDoc2) 生成鼠标左键按下(向下)事件。
LBUpAt Method (IModelDoc2) 生成鼠标左键释放(向上)事件。
ListAuxiliaryExternalFileReferences Method (IModelDoc2) 获取此模型的辅助外部文件引用的名称。
ListAuxiliaryExternalFileReferencesCount Method (IModelDoc2) 获取此模型的辅助外部文件引用数。
Lock Method (IModelDoc2) 阻止用户界面中的修改命令,从而有效地锁定应用程序。
LockAllExternalReferences Method (IModelDoc2) 锁定所有外部引用。
LockLightToModel Method (IModelDoc2) 锁定或解锁指定的灯光。
MoldDraftAnalysis Method (IModelDoc2) 执行模具拔模分析。
MultiSelectByRay Method (IModelDoc2) 选择指定类型的多个对象,这些对象在距离半径内的方向向量(x,y,z)中的点(x,y,z,以米为单位)与光线相交。
NameView Method (IModelDoc2) 使用当前视图创建命名视图。
ObjectDisplayAsIcon Method (IModelDoc2) 将当前OLE对象显示为图标。
ObjectDisplayContent Method (IModelDoc2) 显示当前OLE对象的内容。
ObjectResetsize Method (IModelDoc2) 将当前OLE对象的大小设置为默认值。
Parameter Method (IModelDoc2) 获取指定的参数。
ParentChildRelationship Method (IModelDoc2) 显示选定要素的“父/子关系”对话框。
Paste Method (IModelDoc2) 在当前插入点粘贴Microsoft Windows剪贴板的内容。
PrintDirect Method (IModelDoc2) 将当前文档打印到默认打印机。
PrintPreview Method (IModelDoc2) 显示当前文档的打印预览页。
PropertySheet Method (IModelDoc2) 显示选定对象的属性表。
Quit Method (IModelDoc2) 关闭活动文档而不保存更改(请参阅备注)。
ReattachOrdinate Method (IModelDoc2) 将坐标标注重新附着到其他实体。
ReloadOrReplace Method (IModelDoc2) 重新加载或替换当前模型文档。
RemoveGroups Method (IModelDoc2) 删除当前所选内容中的任何批注组。
RemoveInspectCurvature Method (IModelDoc2) 从选定的曲线草图段中删除曲率梳。
RemoveItemsFromGroup Method (IModelDoc2) 从批注组中删除选定批注。
ResetBlockingState Method (IModelDoc2) 重置solidworks菜单的阻塞状态。
ResetLightSourceExtProperty Method (IModelDoc2) 重置光源的属性。
ResetPropertyExtension Method (IModelDoc2) 清除存储在属性扩展名中的所有值。
ResetSceneExtProperty Method (IModelDoc2) 重置场景的扩展属性。
Save3 Method (IModelDoc2) 保存当前文档。
SaveBMP Method (IModelDoc2) 将当前视图保存为位图(BMP)文件。
Scale Method (IModelDoc2) 缩放零件。
ScreenRotate Method (IModelDoc2) 在模型和屏幕中心旋转之间切换。
SelectedEdgeProperties Method (IModelDoc2) 设置选定边的特性值。
SelectedFaceProperties Method (IModelDoc2) 设置选定面的材质特性值。
SelectedFeatureProperties Method (IModelDoc2) 设置选定要素的特性值。
SelectLoop Method (IModelDoc2) 选择与选定边相对应的循环。
SelectMidpoint Method (IModelDoc2) 将该边的中点(swselmidpoints)置于选择列表中,并在选择边时从选择列表中移除该边。
SelectTangency Method (IModelDoc2) 选择与选定面相切的所有面。
SetAmbientLightProperties Method (IModelDoc2) 设置环境光属性。
SetAngularUnits Method (IModelDoc2) 设置当前角度单位。
SetArcCentersDisplayed Method (IModelDoc2) 设置当前显示的弧中心设置。
SetBendState Method (IModelDoc2) 设置钣金零件的折弯状态。
SetBlockingState Method (IModelDoc2) 设置solidworks菜单的阻塞状态。
SetConsiderLeadersAsLines Method (IModelDoc2) 在文档上设置一个标志,指示当从该文档中的视图或批注检索行时,是否应将引线的显示数据包含为行。
SetDirectionLightProperties Method (IModelDoc2) 设置方向光属性。
SetFeatureManagerWidth Method (IModelDoc2) 设置FeatureManager设计树的宽度。
SetLightSourceName Method (IModelDoc2) 设置solidworks软件内部使用的光源名称。
SetLightSourcePropertyValuesVB Method (IModelDoc2) 设置光源特性值。
SetParamValue Method (IModelDoc2) 设置选定维度(或参数)的值。
SetPickMode Method (IModelDoc2) 将用户返回到默认选择模式。
SetPointLightProperties Method (IModelDoc2) 设置点光源特性。
SetPopupMenuMode Method (IModelDoc2) 设置弹出菜单模式。
SetReadOnlyState Method (IModelDoc2) 设置此文档是只读的还是读写的。
SetSaveAsFileName Method (IModelDoc2) 从filesaveasnotify2事件处理程序中设置另存为文件名,从而绕过“另存为”对话框。
SetSaveFlag Method (IModelDoc2) 将文档标记为脏。
SetSceneBkgDIB Method (IModelDoc2) 设置由dibsection数据描述的背景图像。
SetSpotlightProperties Method (IModelDoc2) 设置聚光灯属性。
SetTessellationQuality Method (IModelDoc2) 设置当前文档的着色显示图像质量编号。
SetTitle2 Method (IModelDoc2) 设置新文档的标题。
SetToolbarVisibility Method (IModelDoc2) 设置工具栏的可见性。
SetUnits Method (IModelDoc2) 设置最终用户用于模型的单位。
SetZebraStripeData Method (IModelDoc2) 设置斑马线数据。
ShowComponent2 Method (IModelDoc2) 显示选定的组件。
ShowConfiguration2 Method (IModelDoc2) 通过切换到该配置并使其成为活动配置来显示命名配置。
ShowCosmeticThread Method (IModelDoc2) 显示选定的示意线程。
ShowNamedView2 Method (IModelDoc2) 显示指定的视图。
ShowSolidBody Method (IModelDoc2) 显示选定的实体。
Sketch3DIntersections Method (IModelDoc2) 基于选定曲面创建新的草图段。
SketchAddConstraints Method (IModelDoc2) 将指定的约束添加到选定实体。
SketchAlign Method (IModelDoc2) 对齐选定的草图实体。
SketchArc Method (IModelDoc2) 在当前模型文档中创建圆弧。
SketchCenterline Method (IModelDoc2) 将中心线添加到当前模型文档。
SketchConstrainCoincident Method (IModelDoc2) 使选定的草图实体重合。
SketchConstrainConcentric Method (IModelDoc2) 使选定的草图实体同心。
SketchConstrainParallel Method (IModelDoc2) 使选定的草图实体平行。
SketchConstrainPerp Method (IModelDoc2) 使选定的草图实体垂直。
SketchConstrainTangent Method (IModelDoc2) 使选定实体相切。
SketchConstraintsDel Method (IModelDoc2) 删除当前选定草图项上的指定关系(约束)。
SketchConstraintsDelAll Method (IModelDoc2) 删除当前选定草图段上的所有约束。
SketchConvertIsoCurves Method (IModelDoc2) 将选定曲面上的等参曲线转换为草图实体。
SketchMirror Method (IModelDoc2) 创建作为选定实体的镜像的新实体。
SketchModifyFlip Method (IModelDoc2) 翻转关于指定坐标系轴的活动或选择草图。
SketchModifyRotate Method (IModelDoc2) 旋转激活或选定草图的坐标系。
SketchModifyScale Method (IModelDoc2) 缩放激活或选定的草图。
SketchModifyTranslate Method (IModelDoc2) 转换激活或选定草图的坐标系。
SketchOffsetEdges Method (IModelDoc2) 偏移选定实体的边。
SketchOffsetEntities2 Method (IModelDoc2) 通过将选定的几何图形偏移指定的量,在活动草图中生成实体。
SketchSpline Method (IModelDoc2) 使用指定点开始样条曲线,或继续一条曲线。
SketchTangentArc Method (IModelDoc2) 在当前模型文档中创建相切圆弧。
SketchUndo Method (IModelDoc2) 撤消上一个草图命令。
SketchUseEdgeCtrline Method (IModelDoc2) 在草图中使用此中心线。
SkToolsAutoConstr Method (IModelDoc2) 自动约束活动草图。
Toolbars Method (IModelDoc2) 打开和关闭指定的solidworks工具栏。
ToolsDistance Method (IModelDoc2) 计算距离。
ToolsGrid Method (IModelDoc2) 显示并隐藏此模型文档中的网格。
ToolsMacro Method (IModelDoc2) 未实施。
ToolsMassProps Method (IModelDoc2) 计算质量特性。
ToolsSketchScale Method (IModelDoc2) 缩放草图。
ToolsSketchTranslate Method (IModelDoc2) 翻译草图。
UnBlankRefGeom Method (IModelDoc2) 在图形窗口中显示选定的隐藏参考几何图形。
UnblankSketch Method (IModelDoc2) 显示隐藏的草图。
UnderiveSketch Method (IModelDoc2) 将草图更改为未激活。
UnLock Method (IModelDoc2) 反转imodeldoc2::lock并将状态栏消息更改为process complete。
UnlockAllExternalReferences Method (IModelDoc2) 解锁所有外部引用。
UserFavors Method (IModelDoc2) 指定添加草图实体时是否自动创建几何关系。
VersionHistory Method (IModelDoc2) 获取一个字符串数组,该数组指示保存此文档的版本,包括当前打开模型文档的SolidWorks版本,以及数组中返回的最后一个值。
ViewConstraint Method (IModelDoc2) 显示当前模型文档的约束。
ViewDispCoordinateSystems Method (IModelDoc2) 打开和关闭坐标系的显示。
ViewDisplayCurvature Method (IModelDoc2) 打开和关闭曲面曲率的显示。
ViewDisplayFaceted Method (IModelDoc2) 设置当前显示模式以显示构成stl输出的着色图片的面。
ViewDisplayHiddengreyed Method (IModelDoc2) 将当前显示模式设置为可见隐藏线。
ViewDisplayHiddenremoved Method (IModelDoc2) 将当前显示模式设置为“已删除隐藏线”。
ViewDisplayShaded Method (IModelDoc2) 将当前显示模式设置为着色。
ViewDisplayWireframe Method (IModelDoc2) 将当前显示模式设置为线框。
ViewDispOrigins Method (IModelDoc2) 关闭和打开原点的显示。
ViewDispRefaxes Method (IModelDoc2) 切换参考轴的显示打开和关闭。
ViewDispRefplanes Method (IModelDoc2) 打开和关闭参照平面的显示。
ViewDispRefPoints Method (IModelDoc2) 显示并隐藏当前模型文档的参考点。
ViewDispTempRefaxes Method (IModelDoc2) 打开和关闭临时参考轴的显示。
ViewOglShading Method (IModelDoc2) 将当前显示子系统设置为使用opengl。
ViewOrientationUndo Method (IModelDoc2) 撤消以前由用户交互进行的视图方向更改。
ViewRotate Method (IModelDoc2) 旋转当前模型的视图。
ViewRotateminusx Method (IModelDoc2) 以当前增量沿负方向围绕X动态旋转视图。
ViewRotateminusy Method (IModelDoc2) 以当前增量沿负方向围绕Y动态旋转视图。
ViewRotateminusz Method (IModelDoc2) 以当前增量沿负方向围绕Z动态旋转视图。
ViewRotateplusx Method (IModelDoc2) 以当前增量沿正方向围绕X旋转视图。
ViewRotateplusy Method (IModelDoc2) 以当前增量沿正方向围绕Y旋转视图。
ViewRotateplusz Method (IModelDoc2) 以当前增量沿正方向围绕Z旋转视图。
ViewRotXMinusNinety Method (IModelDoc2) 将视图围绕x动态旋转负90。
ViewRotXPlusNinety Method (IModelDoc2) 动态地将视图绕x旋转90。
ViewRotYMinusNinety Method (IModelDoc2) 将视图围绕Y动态旋转负90。
ViewRotYPlusNinety Method (IModelDoc2) 动态地将视图绕y旋转90。
ViewRwShading Method (IModelDoc2) 将当前显示子系统设置为使用renderware。
ViewTranslate Method (IModelDoc2) 转换视图。
ViewTranslateminusx Method (IModelDoc2) 动态向左移动视图。
ViewTranslateminusy Method (IModelDoc2) 动态地向下移动视图。
ViewTranslateplusx Method (IModelDoc2) 动态右移视图。
ViewTranslateplusy Method (IModelDoc2) 动态地向上移动视图。
ViewZoomin Method (IModelDoc2) 将当前视图放大20%。
ViewZoomout Method (IModelDoc2) 将当前视图缩小20%。
ViewZoomto Method (IModelDoc2) 将视图缩放到选定的框。
ViewZoomTo2 Method (IModelDoc2) 缩放到指定区域。
ViewZoomtofit2 Method (IModelDoc2) 缩放当前活动视图以适应屏幕。
ViewZoomToSelection Method (IModelDoc2) 将显示缩放到所选内容。
WindowRedraw Method (IModelDoc2) 重新绘制当前窗口。

C# SolidWorks 二次开发 API — 2018版 中文翻译 之事件

最近把api中所有的属性 事件 实例 汇总了一下,发现有好多东西没有接触过。

写了个程序,利用百度翻译api 来自动翻译的,由于某些原因,没法使用自定义词库来实现更精准的翻译。应该还是有很多翻译有些问题的,不过大概意思没什么问题了。

DAssemblyDocEvents_ActiveConfigChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户即将切换到其他配置时,预先通知用户程序。
DAssemblyDocEvents_ActiveConfigChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户切换到其他配置时通知用户程序。
DAssemblyDocEvents_ActiveDisplayStateChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在配置的显示状态更改或配置更改后激发。
DAssemblyDocEvents_ActiveDisplayStateChangePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在更改配置的显示状态或更改配置之前激发。
DAssemblyDocEvents_ActiveViewChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当活动视图更改时激发。
DAssemblyDocEvents_AddCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户添加自定义属性时通知用户程序。
DAssemblyDocEvents_AddItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将组件添加到FeatureManager设计树时通知用户。
DAssemblyDocEvents_AddMatePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在将配合添加到程序集后激发。
DAssemblyDocEvents_AssemblyElectricalDataUpdateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) solidworks软件更新电气数据时激发。
DAssemblyDocEvents_AutoSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 自动保存程序集文档时激发。
DAssemblyDocEvents_AutoSaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当程序集文档自动保存到第三方IStream存储时激发。
DAssemblyDocEvents_AutoSaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当程序集文档自动保存到第三方iStorage存储时激发。
DAssemblyDocEvents_BeginInContextEditNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序用户正开始在程序集上下文(在程序集文档窗口中)中编辑程序集组件。
DAssemblyDocEvents_BodyVisibleChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序用户正开始在程序集上下文(在程序集文档窗口中)中编辑程序集组件。
DAssemblyDocEvents_ChangeCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户更改自定义属性时通知用户程序。
DAssemblyDocEvents_ClearSelectionsNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 使用“清除选择”清除选择时通知用户程序。
DAssemblyDocEvents_CloseDesignTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知应用程序正在编辑的设计表即将关闭。
DAssemblyDocEvents_CommandManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知您solidworks commandmanager选项卡即将激活。
DAssemblyDocEvents_ComponentConfigurationChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集中更改引用组件的配置时激发。
DAssemblyDocEvents_ComponentDisplayModeChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集中更改引用组件的显示模式后激发。
DAssemblyDocEvents_ComponentDisplayModeChangePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集中更改引用组件的显示模式之前激发。
DAssemblyDocEvents_ComponentDisplayStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当组件的显示状态(如着色、线框等)更改时激发。
DAssemblyDocEvents_ComponentMoveNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当用户释放鼠标按钮时发送的后通知,指示组件已移动到所需的目标。
DAssemblyDocEvents_ComponentReferredDisplayStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当组件的引用显示状态更改时激发。
DAssemblyDocEvents_ComponentReorganizeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集或子程序集中重新组织一个或多个组件时激发。
DAssemblyDocEvents_ComponentStateChangeNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 每当此程序集中的组件状态更改时激发。
DAssemblyDocEvents_ComponentVisibleChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当组件更改为隐藏或显示时激发。
DAssemblyDocEvents_ComponentVisualPropertiesChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当组件的视觉属性(如颜色、透明度等)更改时激发。
DAssemblyDocEvents_ConfigurationChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 获取有关已更改其可配置参数之一的对象或功能的信息。
DAssemblyDocEvents_DeleteCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户删除自定义属性时通知用户程序。
DAssemblyDocEvents_DeleteItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从solidworks树结构(例如,featuremanager设计树或configurationmanager树)中删除项目时通知用户程序。
DAssemblyDocEvents_DeleteItemPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当一个项目即将从solidworks树结构(例如,featuremanager设计树或configurationmanager树)中删除时通知用户程序。
DAssemblyDocEvents_DeleteSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 删除选定内容时预先通知用户程序。
DAssemblyDocEvents_DestroyNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当程序集文档即将被销毁时,预先通知用户程序。
DAssemblyDocEvents_DimensionChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通过维度对话框更改维度时激发。
DAssemblyDocEvents_DragStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 启动或停止拖动Instant3D操纵器时激发。
DAssemblyDocEvents_DynamicHighlightNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当所选对象的动态高亮显示从“开”变为“关”时,POST会通知应用程序,反之亦然。
DAssemblyDocEvents_EndInContextEditNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序用户已在程序集上下文(在程序集文档窗口中)中完成对程序集组件的编辑。
DAssemblyDocEvents_EquationEditorPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序公式编辑器正在被销毁。
DAssemblyDocEvents_EquationEditorPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序已构造公式编辑器。
DAssemblyDocEvents_FeatureEditPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户编辑选定要素的定义时,预先通知用户程序。
DAssemblyDocEvents_FeatureManagerFilterStringChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在FeatureManager设计树筛选器中键入文本或调用IModelDocExtension::FeatureManagerFilterString时激发。
DAssemblyDocEvents_FeatureManagerTabActivatedNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当管理器窗格中的活动选项卡更改时激发。
DAssemblyDocEvents_FeatureManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在管理器窗格中的活动选项卡更改之前激发。
DAssemblyDocEvents_FeatureManagerTreeRebuildNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重建活动文档的featuremanager设计树时通知用户程序。
DAssemblyDocEvents_FeatureSketchEditPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户编辑草图定义时,预先通知用户程序。
DAssemblyDocEvents_FileDropNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当部件从Windows资源管理器拖放到程序集时激发。
DAssemblyDocEvents_FileDropPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当部件从Windows资源管理器拖放到程序集时,POST会通知用户应用程序。
DAssemblyDocEvents_FileDropPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在将部件从Windows资源管理器拖放到程序集文档中之前,预先通知用户应用程序。
DAssemblyDocEvents_FileReloadCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 如果取消iAssembly事件fileReloadNotify,则激发。
DAssemblyDocEvents_FileReloadNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重新加载程序集文档时通知用户程序。
DAssemblyDocEvents_FileReloadPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 重新加载程序集文档时预先通知用户程序。
DAssemblyDocEvents_FileSaveAsNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当文件即将以新名称保存并传递新文档名称时,预先通知用户程序。此事件在solidworks显示“文件保存”对话框之前发送。
DAssemblyDocEvents_FileSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当文件即将保存并传递当前文档名时,预先通知用户程序。
DAssemblyDocEvents_FileSavePostCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 如果未激发fileSavePostNotify,则激发。
DAssemblyDocEvents_FileSavePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在solidworks中保存文件时通知用户程序。
DAssemblyDocEvents_FlipLoopNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 循环翻转时通知程序。
DAssemblyDocEvents_InsertTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将表插入程序集中时通知程序。
DAssemblyDocEvents_InterferenceNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在“移动/旋转零部件”命令期间,通知程序部件中的零件之间存在干涉。
DAssemblyDocEvents_LightingDialogCreateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户打开照明对话框时激发。
DAssemblyDocEvents_LoadFromStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方IStream存储中安全加载数据时激发。
DAssemblyDocEvents_LoadFromStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方iStorage存储中安全加载数据时激发。
DAssemblyDocEvents_ModifyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 首次将文档标记为脏时激发。
DAssemblyDocEvents_ModifyTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集中修改表时通知程序。
DAssemblyDocEvents_NewSelectionNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在选择列表更改时通知用户程序。
DAssemblyDocEvents_OpenDesignTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) POST通知应用程序设计表已打开进行编辑。
DAssemblyDocEvents_PreRenameItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当程序集中的组件文档即将重命名时激发。
DAssemblyDocEvents_PromptBodiesToKeepNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当一个实体被切割成多个实体时生成。
DAssemblyDocEvents_PublishTo3DPDFNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将程序集文档发布到SolidWorks MBD 3D PDF时激发。
DAssemblyDocEvents_RedoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档中发生重做操作后激发。
DAssemblyDocEvents_RedoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档中发生重做操作之前激发。
DAssemblyDocEvents_RegenNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档即将重建时预先通知用户程序。
DAssemblyDocEvents_RegenPostNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在重新生成程序集文档时通知用户程序。
DAssemblyDocEvents_RenamedDocumentNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 保存程序集文档时激发,其中重命名的组件文件被其他程序集文档引用。
DAssemblyDocEvents_RenameItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在solidworks树结构(如featuremanager设计树或configurationmanager树)中重命名项时激发。
DAssemblyDocEvents_SaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方IStream存储时激发。
DAssemblyDocEvents_SaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方iStorage存储时激发。
DAssemblyDocEvents_SelectiveOpenPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当选择部件进行快速查看/选择打开时,POST通知用户程序。
DAssemblyDocEvents_SensorAlertPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在传感器的值偏离程序集文档中的限制之前触发。
DAssemblyDocEvents_SketchSolveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在解决草图时激发;例如,在拖动草图实体、添加或编辑关系、更改尺寸等时激发。
DAssemblyDocEvents_SuppressionStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当功能的抑制状态更改时激发。
DAssemblyDocEvents_UndoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档中发生撤消操作后激发。
DAssemblyDocEvents_UndoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档中发生撤消操作之前激发。
DAssemblyDocEvents_UnitsChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当文档单位更改时激发。
DAssemblyDocEvents_UserSelectionPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在程序集文档中选择实体后激发。
DAssemblyDocEvents_UserSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当交互用户将光标移到程序集文档中的模型视图上或单击该视图时激发。
DAssemblyDocEvents_ViewNewNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在创建新的视图模型窗口时通知用户程序。
DDrawingDocEvents_ActivateSheetPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 激活图纸后通知用户程序。
DDrawingDocEvents_ActivateSheetPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在激活图纸之前通知用户程序。
DDrawingDocEvents_ActiveConfigChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户即将切换到其他配置时,预先通知用户程序。
DDrawingDocEvents_ActiveConfigChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户切换到其他配置时通知用户程序。
DDrawingDocEvents_AddCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户添加自定义属性时通知用户程序。
DDrawingDocEvents_AddItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将项添加到solidworks树结构(例如,featuremanager设计树、configurationmanager树等)时通知用户程序。
DDrawingDocEvents_AutoSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 自动保存绘图文档时激发。
DDrawingDocEvents_AutoSaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当绘图文档自动保存到第三方IStream存储时激发。
DDrawingDocEvents_AutoSaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当绘图文档自动保存到第三方iStorage存储时激发。
DDrawingDocEvents_ChangeCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户更改自定义属性时通知用户程序。
DDrawingDocEvents_ClearSelectionsNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 使用“清除选择”清除选择时通知用户程序。
DDrawingDocEvents_CommandManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知您solidworks commandmanager选项卡即将激活。
DDrawingDocEvents_DeleteCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户删除自定义属性时通知用户程序。
DDrawingDocEvents_DeleteItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从solidworks树结构(例如,featuremanager设计树或configurationmanager树)中删除项目时通知用户程序。
DDrawingDocEvents_DeleteItemPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当一个项即将从solidworks树结构(例如,featuremanager设计树或configurationmanager树)中删除时通知用户程序。
DDrawingDocEvents_DeleteSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 删除选定内容时预先通知用户程序。
DDrawingDocEvents_DestroyNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当图形文档即将被销毁时,预先通知用户程序。
DDrawingDocEvents_DimensionChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通过维度对话框更改维度时激发。
DDrawingDocEvents_DynamicHighlightNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当所选对象的动态高亮显示从“开”变为“关”时,POST会通知应用程序,反之亦然。
DDrawingDocEvents_EquationEditorPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序公式编辑器正在被销毁。
DDrawingDocEvents_EquationEditorPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序已构造公式编辑器。
DDrawingDocEvents_FeatureManagerTabActivatedNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当管理器窗格中的活动选项卡更改时激发。
DDrawingDocEvents_FeatureManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在管理器窗格中的活动选项卡更改之前激发。
DDrawingDocEvents_FeatureManagerTreeRebuildNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重建活动文档的featuremanager设计树时通知用户程序。
DDrawingDocEvents_FileReloadPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 重新加载图形文档时预先通知用户应用程序。
DDrawingDocEvents_FileSaveAsNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 在显示文件保存对话框之前发送预先通知。
DDrawingDocEvents_FileSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当文件即将保存并传递当前文档名时,预先通知用户程序。
DDrawingDocEvents_FileSavePostCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 如果未激发fileSavePostNotify,则激发。
DDrawingDocEvents_FileSavePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在solidworks中保存图形时通知用户程序。
DDrawingDocEvents_InsertTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在图形中插入表时通知程序。
DDrawingDocEvents_LoadFromStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方IStream存储中安全加载数据时激发。
DDrawingDocEvents_LoadFromStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方iStorage存储中安全加载数据时激发。
DDrawingDocEvents_ModifyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 首次将文档标记为脏时激发。
DDrawingDocEvents_ModifyTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在图形中修改表时通知程序。
DDrawingDocEvents_NewSelectionNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在选择列表更改时通知用户程序。
DDrawingDocEvents_RedoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在绘图文档中发生重做操作后激发。
DDrawingDocEvents_RedoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在绘图文档中发生重做操作之前激发。
DDrawingDocEvents_RegenNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当要重新生成图形文档时,预先通知用户程序。
DDrawingDocEvents_RegenPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重新生成图形文档时通知用户程序。
DDrawingDocEvents_RenameItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在solidworks树结构(例如,featuremanager设计树或configurationmanager树)中重命名项时通知用户程序。
DDrawingDocEvents_SaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方IStream存储时激发。
DDrawingDocEvents_SaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方iStorage存储时激发。
DDrawingDocEvents_SketchSolveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在解决草图时激发;例如,在拖动草图实体、添加或编辑关系、更改尺寸等时激发。此事件返回要更新的草图特征的名称。
DDrawingDocEvents_UndoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在绘图文档中发生撤消操作后激发。
DDrawingDocEvents_UndoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在绘图文档中发生撤消操作之前激发。
DDrawingDocEvents_UnitsChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 文档单位更改时引发。
DDrawingDocEvents_UserSelectionPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在图形文档中选择实体后激发。
DDrawingDocEvents_UserSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当交互用户将光标移到绘图文档中的绘图视图上或单击该视图时激发。
DDrawingDocEvents_ViewCreatePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当要创建工程视图时,预先通知用户应用程序。
DDrawingDocEvents_ViewNewNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在创建新的视图窗口时通知用户程序。
DFeatMgrViewEvents_ActivateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 一旦激活FeatureManager设计树视图并返回视图句柄,POST就会通知用户程序。
DFeatMgrViewEvents_DeactivateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 一旦禁用FeatureManager设计树状图并返回视图句柄,POST就会通知用户程序。
DFeatMgrViewEvents_DestroyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当FeatureManager设计树状图即将被销毁时,预先通知用户程序并返回视图句柄。
DModelViewEvents_BufferSwapNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在opengl中渲染着色图形时,在交换缓冲区之前立即从模型视图激发。
DModelViewEvents_DestroyNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当模型视图即将被破坏时,预先通知用户程序。
DModelViewEvents_DisplayModeChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) POST在更改模型视图显示模式时通知用户程序。
DModelViewEvents_DisplayModeChangePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当模型视图显示模式即将更改时,预先通知用户程序。
DModelViewEvents_GraphicsRenderPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在绘制所有solidworks图形(包括solidworks模型、草图、尺寸和注释图形)后激发。
DModelViewEvents_PerspectiveViewNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在透视图更改时通知用户程序(例如,如果用户旋转透视图)。
DModelViewEvents_PrintNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 打印文档时通知用户程序。
DModelViewEvents_RenderLayer0NotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 每当solidworks渲染到layer0时激发。
DModelViewEvents_RepaintNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当视图要重新绘制时,预先通知用户程序并返回绘制类型。
DModelViewEvents_RepaintPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重新绘制视图时通知用户程序。
DModelViewEvents_UserClearSelectionsNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 用户时激发:当指针位于PropertyManager页上的选择框上时,单击鼠标右键。选择快捷菜单上的“清除选择”。
DModelViewEvents_ViewChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在视图更改时通知用户程序,并返回视图的新转换矩阵。
DMouseEvents_MouseLBtnDblClkNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 双击鼠标左键时激发。
DMouseEvents_MouseLBtnDownNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标左键时激发。
DMouseEvents_MouseLBtnUpNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标左键后释放时激发。
DMouseEvents_MouseMBtnDblClkNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 双击鼠标中键时激发。
DMouseEvents_MouseMBtnDownNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标中键时激发。
DMouseEvents_MouseMBtnUpNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标中键后释放时激发。
DMouseEvents_MouseMoveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 移动鼠标指针时激发。
DMouseEvents_MouseNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 每当鼠标事件发生时激发。
DMouseEvents_MouseRBtnDblClkNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 双击鼠标右键时激发。
DMouseEvents_MouseRBtnDownNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标右键时激发。
DMouseEvents_MouseRBtnUpNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 按下鼠标右键后释放时激发。
DMouseEvents_MouseSelectNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户使用鼠标在模型视图中进行选择时激发。
DPartDocEvents_ActiveConfigChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户即将切换到其他配置时,预先通知用户程序。
DPartDocEvents_ActiveConfigChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户切换到其他配置时通知用户程序。
DPartDocEvents_ActiveDisplayStateChangePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在配置的显示状态更改或配置更改后激发。
DPartDocEvents_ActiveDisplayStateChangePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在更改配置的显示状态或更改配置之前激发。
DPartDocEvents_ActiveViewChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当活动视图更改时激发。
DPartDocEvents_AddCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户添加自定义属性时通知用户程序。
DPartDocEvents_AddItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将项添加到某个SolidWorks树结构(如FeatureManager设计树和配置管理器)时激发。
DPartDocEvents_AutoSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 自动保存零件文档时激发。
DPartDocEvents_AutoSaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当部件文档自动保存到第三方IStream存储时激发。
DPartDocEvents_AutoSaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当部件文档自动保存到第三方iStorage存储时激发。
DPartDocEvents_BodyVisibleChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 每当此部分中的实体的可见状态更改时激发。
DPartDocEvents_ChangeCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户更改自定义属性时通知用户程序。
DPartDocEvents_ClearSelectionsNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 使用“清除选择”清除选择时通知用户程序。
DPartDocEvents_CloseDesignTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知应用程序已打开进行编辑的设计表即将关闭。
DPartDocEvents_CommandManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知您solidworks commandmanager选项卡即将激活。
DPartDocEvents_ConfigurationChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 获取有关某个对象或功能的信息,如果该对象或功能的可配置参数发生更改,则该对象或功能具有该对象或功能。
DPartDocEvents_ConvertToBodiesPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在“转换为实体”对话框关闭后激发。
DPartDocEvents_ConvertToBodiesPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在“转换为实体”对话框打开之前激发。
DPartDocEvents_DeleteCustomPropertyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在用户删除自定义属性时通知用户程序。
DPartDocEvents_DeleteItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从solidworks树结构(如featuremanager设计树和configurationmanager)中删除项目时通知用户程序。
DPartDocEvents_DeleteItemPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当一个项目即将从solidworks树结构(如featuremanager设计树和configurationmanager)中删除时通知用户程序。
DPartDocEvents_DeleteSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 删除选定内容时预先通知用户。
DPartDocEvents_DestroyNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 当部件文档即将被销毁时,预先通知用户程序。
DPartDocEvents_DimensionChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通过维度对话框更改维度时激发。
DPartDocEvents_DragStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 启动或停止拖动Instant3D操纵器时激发。
DPartDocEvents_DynamicHighlightNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当所选对象的动态高亮显示从“开”变为“关”时,POST会通知应用程序,反之亦然。
DPartDocEvents_EquationEditorPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序公式编辑器正在被销毁。
DPartDocEvents_EquationEditorPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 通知应用程序已构造公式编辑器。
DPartDocEvents_FeatureEditPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户编辑选定要素的定义时,预先通知用户程序。
DPartDocEvents_FeatureManagerFilterStringChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在FeatureManager设计树筛选器中键入文本或调用IModelDocExtension::FeatureManagerFilterString时激发。
DPartDocEvents_FeatureManagerTabActivatedNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当管理器窗格中的活动选项卡更改时激发。
DPartDocEvents_FeatureManagerTabActivatedPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在管理器窗格中的活动选项卡更改之前激发。
DPartDocEvents_FeatureManagerTreeRebuildNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重建活动文档的featuremanager设计树时通知用户程序。
DPartDocEvents_FeatureSketchEditPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户编辑草图定义时,预先通知用户程序。
DPartDocEvents_FileDropPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当部件从Windows资源管理器拖放到部件文档中时,POST会通知用户应用程序。
DPartDocEvents_FileDropPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在将部件从Windows资源管理器拖放到部件文档中之前,预先通知用户应用程序。
DPartDocEvents_FileReloadCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 如果取消了fileReloadNotify,则激发。
DPartDocEvents_FileReloadNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在重新加载零件文档时通知用户程序。
DPartDocEvents_FileReloadPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 重新加载零件文档时预先通知用户程序
DPartDocEvents_FileSaveAsNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) 在显示文件保存对话框之前发送预先通知。
DPartDocEvents_FileSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当文件即将保存并传递当前文档名时,预先通知用户程序。
DPartDocEvents_FileSavePostCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 如果未激发fileSavePostNotify,则激发。
DPartDocEvents_FileSavePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在保存零件文档时通知用户程序。
DPartDocEvents_FlipLoopNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当循环翻转时激发。
DPartDocEvents_InsertTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在将表插入零件时通知程序。
DPartDocEvents_LightingDialogCreateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当用户打开照明对话框时激发。
DPartDocEvents_LoadFromStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方IStream存储中安全加载数据时激发。
DPartDocEvents_LoadFromStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 从第三方iStorage存储中安全加载数据时激发。
DPartDocEvents_ModifyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当文档第一次被标记为脏时通知用户程序。
DPartDocEvents_ModifyTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在零件中修改表时通知程序。
DPartDocEvents_NewSelectionNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在选择列表更改时通知用户程序。
DPartDocEvents_OpenDesignTableNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) POST通知应用程序设计表已打开进行编辑。
DPartDocEvents_PreRenameItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当其他文档引用的零件文档即将重命名时激发。
DPartDocEvents_PromptBodiesToKeepNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当一个实体被切割成多个实体时生成。
DPartDocEvents_PublishTo3DPDFNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 将零件文档发布到SolidWorks MBD 3D PDF时激发。
DPartDocEvents_RedoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在部件文档中发生重做操作后激发。
DPartDocEvents_RedoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在部件文档中发生重做操作之前激发。
DPartDocEvents_RegenNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当零件文档即将重建时,预先通知用户程序。
DPartDocEvents_RegenPostNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在重建或回滚零件文档时通知用户程序。
DPartDocEvents_RenamedDocumentNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 保存其他文档引用重命名的零件文件的文档时激发。
DPartDocEvents_RenameItemNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在solidworks树结构(如featuremanager设计树或configurationmanager)中重命名项时激发。
DPartDocEvents_SaveToStorageNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方IStream存储时激发。
DPartDocEvents_SaveToStorageStoreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在安全地将数据保存到第三方iStorage存储时激发。
DPartDocEvents_SensorAlertPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在传感器值偏离零件文档中的限制之前触发。
DPartDocEvents_SketchSolveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在解决草图时激发;例如,在拖动草图实体、添加或编辑关系、更改尺寸等时激发。此事件返回要更新的草图特征的名称。
DPartDocEvents_SuppressionStateChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当功能的抑制状态更改时激发。
DPartDocEvents_UndoPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在部件文档中发生撤消操作后激发。
DPartDocEvents_UndoPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在部件文档中发生撤消操作之前激发。
DPartDocEvents_UnitsChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 文档单位更改时生成。
DPartDocEvents_UserSelectionPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在零件文档中选择实体后激发。
DPartDocEvents_UserSelectionPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当交互用户将光标移到零件文档中的模型视图上或单击该视图时激发。
DPartDocEvents_ViewNewNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在创建新的模型视图窗口时通知用户程序。例如,对于由窗口拆分栏创建的每个新模型视图,都会发送此事件。
DPartDocEvents_WeldmentCutListUpdatePostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 更新此零件中的焊接件切割列表时,POST将通知用户程序。
DSldWorksEvents_ActiveDocChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在活动窗口更改时通知用户程序。此更改可以在同一文档的窗口之间进行,也可以在不同文档的窗口之间进行。
DSldWorksEvents_ActiveModelDocChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在活动的imodeldoc2对象发生更改时通知用户程序。
DSldWorksEvents_BackgroundProcessingEndNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 后台处理结束时通知用户程序。
DSldWorksEvents_BackgroundProcessingStartNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 后台处理启动时通知用户程序。
DSldWorksEvents_BeginRecordNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 宏录制开始时通知用户程序。
DSldWorksEvents_BeginTranslationNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当solidworks应用程序开始导入或导出文件时通知用户程序。
DSldWorksEvents_CommandCloseNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当命令(包括属性管理器页)正常或被用户取消时激发。
DSldWorksEvents_CommandOpenPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在命令(包括属性管理器页)执行或打开之前激发。
DSldWorksEvents_DestroyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当solidworks即将被销毁时,发送到基于mfc或基于com的dll加载项。
DSldWorksEvents_DocumentConversionNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) POST通知用户程序在打开操作期间文件已从旧版本的SolidWorks转换。
DSldWorksEvents_DocumentLoadNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在加载solidworks文档时通知用户程序。
DSldWorksEvents_EndRecordNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 宏录制结束时通知用户程序,包括用户是否取消录制(即,用户从“另存为”对话框中取消并对solidworks“继续录制”说“否”?对话框)。
DSldWorksEvents_EndTranslationNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当solidworks应用程序完成导入或导出文件时通知用户程序。
DSldWorksEvents_FileCloseNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) solidworks关闭文件后通知用户程序。
DSldWorksEvents_FileNewNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) post在创建新文件时通知用户程序。
DSldWorksEvents_FileNewPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在使用solidworks api或solidworks用户界面创建新文档之前激发。
DSldWorksEvents_FileOpenNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) POST通知用户程序何时打开了现有文件。
DSldWorksEvents_FileOpenPostNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) post在文件打开时通知用户程序。
DSldWorksEvents_FileOpenPreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 预先通知用户程序fileopennotify2事件。
DSldWorksEvents_InterfaceBrightnessThemeChangeNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当solidworks背景更改时通知外接程序。
DSldWorksEvents_LightSheetCreateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 创建照明图纸时激发。
DSldWorksEvents_NonNativeFileOpenNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 打开非本机solidworks文件时激发。
DSldWorksEvents_OnIdleNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在处理完所有消息后激发,包括已发布的重绘;因此,无需调用imodeldoc2::graphicsredraw2。
DSldWorksEvents_PromptForFilenameNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在打开的文件中缺少依赖文档时激发。
DSldWorksEvents_PromptForMultipleFileNamesNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当打开的文件中缺少任何依赖文档时激发。
DSldWorksEvents_PropertySheetCreateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在创建导出的iswpropertysheet时通知用户程序,以便应用程序可以向其添加页。
DSldWorksEvents_ReferencedFilePreNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在solidworks开始搜索指定的引用文件之前通知用户程序。
DSldWorksEvents_ReferenceNotFoundNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在solidworks软件显示对话框提示最终用户浏览参考文件之前通知用户程序。
DSWPropertySheetEvents_CreateControlNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在属性页上创建ActiveX控件时激发。
DSWPropertySheetEvents_DestroyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在销毁属性表的过程中激发。
DSWPropertySheetEvents_HelpNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 在属性表上单击“帮助”按钮时激发。
DSWPropertySheetEvents_OnCancelNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 单击属性页上的“取消”按钮时激发。您的外接程序可以在此事件中执行清理活动。
DSWPropertySheetEvents_OnOKNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 单击属性页上的“确定”按钮时激发。
DTaskpaneViewEvents_TaskPaneActivateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当应用程序级任务窗格视图被激活时,POST通知用户程序。
DTaskpaneViewEvents_TaskPaneDeactivateNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当停用应用程序级任务窗格视图时,POST通知用户程序。
DTaskpaneViewEvents_TaskPaneDestroyNotifyEventHandler Delegate (SolidWorks.Interop.sldworks) 当应用程序级任务窗格视图即将被销毁时,预先通知用户程序。
DTaskpaneViewEvents_TaskPaneToolbarButtonClickedEventHandler Delegate (SolidWorks.Interop.sldworks) 单击任务窗格上的工具栏按钮时激发。

C# SolidWorks 二次开发 API — 打断关系

有时候我们需要把零件中特征之间的关系去掉,以便再产生新的关系。

例如把两个零件组合之后,不断开关系就不能再进行一些其它的操作。

因为打断之后无法再有关系,所以这个功能也不是经常用,就不单独做例子了

            //不显示特征树
            //swModel.Extension.HideFeatureManager(true);
            //禁用特征树
            //featureManager.EnableFeatureTree = false;

            // swModel.FeatureManager.EnableFeatureTreeWindow = false;

            swModel.BreakAllExternalReferences();

 

C# SolidWorks 二次开发 API — 实例:创建中心点位置

在实际生产需要中,有些情况 我们需要知道某个路径上整体的中心点,如水管,电阻丝这些,可能需要从路径的中点开始进行放置,这个实例我们来看如何进行中点的计算与标记。我们默认路径都是是直线和圆弧组成,均相切(辅助中心线不包含在路径长度内)。

  1. ,问题:如何找到下面路径的中心点在哪里?进行标识,方便加工。

2,思路:

  1. 先得到指定草图中的所有“线段”,把中心线排除掉之后,遍历并统计出它们的长度,从而得到总长L。并且还要得到一整串的“线段”顺序。可以考虑 链 相关的数据结构
  2. 从起点或者终点开始,对每一段进行遍历,去找到中点所在的“线段”, 直到找到中点之后,通过“线段” 的参考进行计算。
  3. 画出中点,或者能标识中点位置的辅助线。

3,代码:这里很久前写的,没有写什么注释,并且水平也很菜,估计很多人看不太懂。

      public void CreateHeaterCenter(string heaterPathName)
        {
            ISketchPoint startPoint = null;
            ISketchPoint endPoint = null;
            List<SegmentData> list = new List<SegmentData>();
            List<SegmentData> list2 = new List<SegmentData>();
            List<SegmentData> list3 = new List<SegmentData>();
            List<SegmentData> list4 = new List<SegmentData>();
            _swApp.ActivateDoc(_swPartModel.GetTitle());
            _swPartModel.ShowNamedView2("*Front", 1);

            ISketchArc arc;
            double length;
            list2.Clear();
            list.Clear();
            _swPartModel.Extension.SelectByID2(heaterPathName, "SKETCH", 0.0, 0.0, 0.0, true, 0, null, 0);
            _swPartModel.ViewZoomToSelection();
            ISelectionMgr iSelectionManager = _swPartModel.ISelectionManager;

            IFeature feature = iSelectionManager.GetSelectedObject6(1, 0);

            ISketch sketch = feature.GetSpecificFeature2();

            Array array = sketch.GetSketchSegments();

            Array array2 = sketch.GetSketchPoints2();
            foreach (ISketchSegment segment in array)
            {
                ISketchSegment segment2 = segment;
                segment2.Select(true);
                if (!segment2.ConstructionGeometry)
                {
                    if (segment2.GetType() == 0)
                    {
                        ISketchLine line = (ISketchLine)segment2;
                        startPoint = line.IGetStartPoint2();
                        endPoint = line.IGetEndPoint2();
                    }
                    if (segment2.GetType() == 1)
                    {
                        arc = (ISketchArc)segment2;
                        startPoint = arc.IGetStartPoint2();
                        endPoint = arc.IGetEndPoint2();
                    }
                    SegmentData item = new SegmentData(segment2, startPoint, endPoint);
                    list.Add(item);
                }
                _swPartModel.ClearSelection2(true);
            }
            for (int i = 0; i < list.Count; i++)
            {
                int num9 = 0;
                list2.Add(list[0]);
                list.Remove(list[0]);
                for (int m = 0; m < list.Count; m++)
                {
                    list2[0].Segment.Select(false);
                    list[m].Segment.Select(false);
                    if ((Math.Round(list2[0].StartPoint.X, 5) == Math.Round(list[m].StartPoint.X, 5)) && (Math.Round(list2[0].StartPoint.Y, 5) == Math.Round(list[m].StartPoint.Y, 5)))
                    {
                        num9++;
                    }
                    if ((Math.Round(list2[0].EndPoint.X, 5) == Math.Round(list[m].EndPoint.X, 5)) && (Math.Round(list2[0].EndPoint.Y, 5) == Math.Round(list[m].EndPoint.Y, 5)))
                    {
                        num9++;
                    }
                    if ((Math.Round(list2[0].EndPoint.X, 5) == Math.Round(list[m].StartPoint.X, 5)) && (Math.Round(list2[0].EndPoint.Y, 5) == Math.Round(list[m].StartPoint.Y, 5)))
                    {
                        num9++;
                    }
                    if ((Math.Round(list2[0].StartPoint.X, 5) == Math.Round(list[m].EndPoint.X, 5)) && (Math.Round(list2[0].StartPoint.Y, 5) == Math.Round(list[m].EndPoint.Y, 5)))
                    {
                        num9++;
                    }
                    _swPartModel.ClearSelection2(true);
                    if (num9 == 2)
                    {
                        list.Add(list2[0]);
                        list2.Remove(list2[0]);
                        break;
                    }
                }
                if (num9 == 1)
                {
                    list2[0].Segment.Select(true);
                    break;
                }
            }
            int num = 0;
            for (int j = 0; j < list.Count; j++)
            {
                list2[num].Segment.Select(true);
                list[j].Segment.Select(false);
                if ((Math.Round(list2[num].StartPoint.X, 5) == Math.Round(list[j].StartPoint.X, 5)) && (Math.Round(list2[num].StartPoint.Y, 5) == Math.Round(list[j].StartPoint.Y, 5)))
                {
                    list2.Add(list[j]);
                    list.Remove(list[j]);
                    num++;
                    j = -1;
                }
                else if ((Math.Round(list2[num].EndPoint.X, 5) == Math.Round(list[j].EndPoint.X, 5)) && (Math.Round(list2[num].EndPoint.Y, 5) == Math.Round(list[j].EndPoint.Y, 5)))
                {
                    list2.Add(list[j]);
                    list.Remove(list[j]);
                    num++;
                    j = -1;
                }
                else if ((Math.Round(list2[num].EndPoint.X, 5) == Math.Round(list[j].StartPoint.X, 5)) && (Math.Round(list2[num].EndPoint.Y, 5) == Math.Round(list[j].StartPoint.Y, 5)))
                {
                    list2.Add(list[j]);
                    list.Remove(list[j]);
                    num++;
                    j = -1;
                }
                else if ((Math.Round(list2[num].StartPoint.X, 5) == Math.Round(list[j].EndPoint.X, 5)) && (Math.Round(list2[num].StartPoint.Y, 5) == Math.Round(list[j].EndPoint.Y, 5)))
                {
                    list2.Add(list[j]);
                    list.Remove(list[j]);
                    num++;
                    j = -1;
                }
            }
            _swPartModel.ClearSelection();
            _swPartModel.Extension.SelectByID2(heaterPathName, "SKETCH", 0.0, 0.0, 0.0, false, 0, null, 0);
            _swPartModel.EditSketch();
            foreach (ISketchPoint point3 in array2)
            {
                point3.Select(false);
                if (point3.Type == 1)
                {
                    _swPartModel.EditDelete();
                }
            }
            double num2 = 0.0;
            foreach (SegmentData data2 in list2)
            {
                data2.Segment.Select(false);
                length = data2.Segment.GetLength();
                num2 += length;
            }
            _swPartModel.ClearSelection();
            double num4 = num2 / 2.0;
            length = 0.0;
            int num5 = 0;
            double num6 = 0.0;
            for (int k = 0; k < list2.Count; k++)
            {
                list2[k].Segment.Select(false);
                length += list2[k].Segment.GetLength();
                if (num4 < length)
                {
                    num5 = k;
                    double num7 = Math.Abs((double)(length - num4));
                    num6 = (list2[num5].Segment.GetLength() - num7) / list2[num5].Segment.GetLength();
                    break;
                }
            }
            _swPartModel.ClearSelection();
            if (list2[num5].Segment.GetType() == 0)
            {
                double num13 = 0.0;
                double x = list2[num5].StartPoint.X;
                double y = list2[num5].StartPoint.Y;
                double num16 = list2[num5].EndPoint.X;
                double num17 = list2[num5].EndPoint.Y;
                if ((Math.Round(num16, 6) == Math.Round(list2[num5 - 1].StartPoint.X, 6)) && (Math.Round(num17, 6) == Math.Round(list2[num5 - 1].StartPoint.Y, 6)))
                {
                    num16 = list2[num5].StartPoint.X;
                    num17 = list2[num5].StartPoint.Y;
                    x = list2[num5].EndPoint.X;
                    y = list2[num5].EndPoint.Y;
                }
                else if ((Math.Round(num16, 6) == Math.Round(list2[num5 - 1].EndPoint.X, 6)) && (Math.Round(num17, 6) == Math.Round(list2[num5 - 1].EndPoint.Y, 6)))
                {
                    num16 = list2[num5].StartPoint.X;
                    num17 = list2[num5].StartPoint.Y;
                    x = list2[num5].EndPoint.X;
                    y = list2[num5].EndPoint.Y;
                }
                double pointX = x + ((num16 - x) * num6);
                double pointY = y + ((num17 - y) * num6);
                _swPartModel.SetAddToDB(true);
                if (_swPartModel.CreatePoint2(pointX, pointY, 0.0) != null)
                {
                    _swPartModel.SketchAddConstraints("sgFixed");
                }
                if (x == num16)
                {
                    num13 = 1.5707963267948966;
                }
                if (y == num17)
                {
                    num13 = 3.1415926535897931;
                }
                if ((x != num16) && !(y == num17))
                {
                    num13 = Math.Atan((num17 - y) / (num16 - x));
                }
                if (num13 > 3.1415926535897931)
                {
                    num13 -= 3.1415926535897931;
                }
                ISketchSegment segment3 = _swPartModel.ICreateLine2(pointX + (0.005 * Math.Cos(num13 + 1.5707963267948966)), pointY + (0.005 * Math.Sin(num13 + 1.5707963267948966)), 0.0, pointX + (0.005 * Math.Cos(num13 + 4.71238898038469)), pointY + (0.005 * Math.Sin(num13 + 4.71238898038469)), 0.0);
                _swPartModel.SketchAddConstraints("sgFIXED");
                segment3.ConstructionGeometry = true;
                _swPartModel.SetAddToDB(false);
                _swPartModel.ClearSelection2(true);
                _swPartModel.InsertSketch2(true);
            }
            if (list2[num5].Segment.GetType() == 1)
            {
                arc = (ISketchArc)list2[num5].Segment;
                startPoint = arc.IGetStartPoint2();
                endPoint = arc.IGetEndPoint2();
                ISketchPoint point4 = arc.IGetCenterPoint2();
                int rotationDir = arc.GetRotationDir();
                double num21 = 0.0;
                double num22 = 0.0;
                double num23 = list2[num5].Segment.GetLength();
                double radius = arc.GetRadius();
                double num25 = (num6 * num23) / radius;
                double num26 = startPoint.X;
                double num27 = startPoint.Y;
                double num28 = endPoint.X;
                double num29 = endPoint.Y;
                double num30 = point4.X;
                double num31 = point4.Y;
                if ((Math.Round(num28, 6) == Math.Round(list2[num5 - 1].StartPoint.X, 6)) && (Math.Round(num29, 6) == Math.Round(list2[num5 - 1].StartPoint.Y, 6)))
                {
                    num26 = endPoint.X;
                    num27 = endPoint.Y;
                    rotationDir = -1 * rotationDir;
                }
                else if ((Math.Round(num28, 6) == Math.Round(list2[num5 - 1].EndPoint.X, 6)) && (Math.Round(num29, 6) == Math.Round(list2[num5 - 1].EndPoint.Y, 6)))
                {
                    num26 = endPoint.X;
                    num27 = endPoint.Y;
                    rotationDir = -1 * rotationDir;
                }
                if ((num30 != num26) && !(num31 == num27))
                {
                    num21 = Math.Atan((num31 - num27) / (num30 - num26));
                }
                if (Math.Round(num30, 8) == Math.Round(num26, 8))
                {
                    if (Math.Round(num31, 8) > Math.Round(num27, 8))
                    {
                        num21 = 4.71238898038469;
                    }
                    else if (Math.Round(num31, 8) < Math.Round(num27, 8))
                    {
                        num21 = 1.5707963267948966;
                    }
                }
                else if (Math.Round(num31, 8) == Math.Round(num27, 8))
                {
                    if (Math.Round(num30, 8) > Math.Round(num26, 8))
                    {
                        num21 = 3.1415926535897931;
                    }
                    else if (Math.Round(num30, 8) < Math.Round(num26, 8))
                    {
                        if (rotationDir > 0)
                        {
                            num21 = 0.0;
                        }
                        else
                        {
                            num21 = 6.2831853071795862;
                        }
                    }
                }
                if ((Math.Round(num30, 8) < Math.Round(num26, 8)) && (Math.Round(num31, 8) < Math.Round(num27, 8)))
                {
                    num22 = num21 + (rotationDir * num25);
                }
                else if ((Math.Round(num30, 8) < Math.Round(num26, 8)) && (Math.Round(num31, 8) > Math.Round(num27, 8)))
                {
                    num22 = (6.2831853071795862 + num21) + (rotationDir * num25);
                }
                else if ((Math.Round(num30, 8) > Math.Round(num26, 8)) && (Math.Round(num31, 8) > Math.Round(num27, 8)))
                {
                    num22 = (3.1415926535897931 + num21) + (rotationDir * num25);
                }
                else if ((Math.Round(num30, 8) > Math.Round(num26, 8)) && (Math.Round(num31, 8) < Math.Round(num27, 8)))
                {
                    num22 = (3.1415926535897931 + num21) + (rotationDir * num25);
                }
                else if (Math.Round(num30, 8) == Math.Round(num26, 8))
                {
                    num22 = num21 + (rotationDir * num25);
                }
                else if (Math.Round(num31, 8) == Math.Round(num27, 8))
                {
                    num22 = num21 + (rotationDir * num25);
                }
                num22 = Math.Round(num22, 6);
                double num32 = num30 + (radius * Math.Cos(num22));
                double num33 = num31 + (radius * Math.Sin(num22));
                bool flag29 = true;
                if (_swPartModel.Extension.SelectByID2("", "SKETCHPOINT", num32, num33, 0.0, false, 0, null, 0))
                {
                    ISketchPoint point5 = iSelectionManager.GetSelectedObject6(0, 1);

                    if ((point5 != null) && ((Math.Round(point5.X, 6) == Math.Round(num32, 6)) && (Math.Round(point5.Y, 6) == Math.Round(num33, 6))))
                    {
                        flag29 = false;
                    }
                }
                _swPartModel.SetAddToDB(true);
                if (flag29 && (_swPartModel.CreatePoint2(num32, num33, 0.0) != null))
                {
                    _swPartModel.SketchAddConstraints("sgFIXED");
                    _swPartModel.ICreateLine2(num30, num31, 0.0, num32, num33, 0.0).ConstructionGeometry = true;
                }
                _swPartModel.SetAddToDB(false);
                _swPartModel.ClearSelection2(true);
                _swPartModel.InsertSketch2(true);
            }

            
        }
   

 运行结果如下图:

CAD中验证正确 :

源代码下载:

https://gitee.com/painezeng/CSharpAndSolidWorks

C# SolidWorks 二次开发 API — 2018版 中文翻译 ModelDoc2 属性和IModelDocExtension属性

属性名称 描述
ActiveView Property (IModelDoc2) 获取只读模式下的当前活动模型视图。注意:此属性是一个get-only属性。集合未实现。
ConfigurationManager Property (IModelDoc2) 获取IConfigurationManager对象,该对象允许访问模型中的配置。
Extension Property (IModelDoc2) 获取imodeldocextension对象,该对象还允许访问模型文档。
FeatureManager Property (IModelDoc2) 获取iFeatureManager对象,该对象允许访问FeatureManager设计树。
FeatureManagerSplitterPosition Property (IModelDoc2) 拆分FeatureManager设计树,并获取或设置FeatureManager设计树面板中拆分栏的位置。
IActiveView Property (IModelDoc2) 获取只读模式下的当前活动模型视图。注意:此属性是一个get-only属性。集合未实现。
ILightSourcePropertyValues Property (IModelDoc2) 获取并设置光源属性值。
IMaterialPropertyValues Property (IModelDoc2) 获取或设置活动配置中材质的属性。
IPageSetup Property (IModelDoc2) 获取此文档的页面设置。
ISelectionManager Property (IModelDoc2) 获取此文档的IsElectionMgr对象,从而使当前选定的对象可用。
LargeAssemblyMode Property (IModelDoc2) 获取或设置此文档的大型程序集模式。
LengthUnit Property (IModelDoc2) 获取并设置imodeldoc2::getUnits、imodeldoc2::igetUnits和imodeldoc2::setUnits使用的相同长度单位值。
LightSourcePropertyValues Property (IModelDoc2) 获取并设置光源属性值。
LightSourceUserName Property (IModelDoc2) 获取或设置solidworks用户界面中显示的光源名称。
MaterialIdName Property (IModelDoc2) 获取或设置材质名称。
MaterialPropertyValues Property (IModelDoc2) 获取或设置活动配置中材质的属性。
MaterialUserName Property (IModelDoc2) 获取或设置材质名称。
ModelViewManager Property (IModelDoc2) 获取IModelViewManager对象,该对象允许访问模型视图。
PageSetup Property (IModelDoc2) 获取此文档的页面设置。
Printer Property (IModelDoc2) 获取或设置此文档的默认打印机。
SceneBkgImageFileName Property (IModelDoc2) 控制用作当前背景图片的图像文件名。
SceneName Property (IModelDoc2) 获取并设置场景的名称。
SceneUserName Property (IModelDoc2) 获取并设置场景的用户名。
SelectionManager Property (IModelDoc2) 获取此文档的IsElectionMgr对象,从而使当前选定的对象可用。注意:此属性是一个get-only属性。集合未实现。
ShowFeatureErrorDialog Property (IModelDoc2) 获取或设置是否显示功能错误对话框。
SketchManager Property (IModelDoc2) 获取允许访问草图创建例程的草图管理器。
SummaryInfo Property (IModelDoc2) 获取或设置solidworks文档的文件摘要信息。
Visible Property (IModelDoc2) 获取或设置活动文档的可见性。
ActiveCommandTab Property (IModelDocExtension) 获取并设置活动的solidworks commandmanager选项卡。
ActiveCommandTabIndex Property (IModelDocExtension) 获取并设置活动solidworks commandmanager选项卡的索引。
AnnotationViewCount Property (IModelDocExtension) 获取此零件或部件文档中的批注视图数。
AnnotationViews Property (IModelDocExtension) 获取此零件或部件文档中的批注视图。
AppPageSetup Property (IModelDocExtension) 获取此文档的SolidWorks应用程序页设置界面。
CommandTabVisible Property (IModelDocExtension) 获取并设置指定的solidworks commandmanager选项卡的可见性。
CustomPropertyBuilderTemplate Property (IModelDocExtension) 获取或设置此部件的自定义属性生成器模板。
CustomPropertyManager Property (IModelDocExtension) 获取此文档或配置的自定义属性。
DimXpertManager Property (IModelDocExtension) 获取此配置的dimxpert架构。
DisplayMode Property (IModelDocExtension) 获取并设置指定显示状态设置的显示模式。
DisplayStateSpecMaterialPropertyValues Property (IModelDocExtension) 获取并设置指定显示状态设置的外观设置。
Document Property (IModelDocExtension) 获取模型文档。
FeatureManagerFilterString Property (IModelDocExtension) 获取或设置FeatureManager设计树筛选器中的字符串。
FlyoutFeatureTreeVisibility Property (IModelDocExtension) 获取或设置弹出型功能管理器设计树的状态。
IncludeMassPropertiesOfHiddenBodies Property (IModelDocExtension) 获取或设置是否在程序集中包含隐藏组件的质量属性。
LinkedDisplayState Property (IModelDocExtension) 获取或设置是否在此部分中链接显示状态。
NeedsRebuild2 Property (IModelDocExtension) 获取是否需要重新生成模型文档。
ShowPartRebuildIndicators Property (IModelDocExtension) 获取或设置是否在具有过期冻结功能的部件上显示重建指示器。
SunLightInformation Property (IModelDocExtension) 获取指定的阳光信息。
ToolboxPartType Property (IModelDocExtension) 获取并设置此部分是否为SolidWorks工具箱部分。
Transparency Property (IModelDocExtension) 获取并设置指定显示状态设置的透明度状态。
UsePageSetup Property (IModelDocExtension) 获取或设置此文档是使用其自己的页面设置值、SolidWorks应用程序页面设置值,还是在单个图纸上使用设置值。
ViewDisplayRealView Property (IModelDocExtension) 获取或设置RealView图形设置。
Visibility Property (IModelDocExtension) 获取并设置指定显示状态设置的可见性状态。

C# SolidWorks 二次开发 API —在自己的网页中嵌入eDrawings Web Viewer

这是Solidworks PDM系统中的Web2客户端,能够实现对很多3D图在web端的预览,我们先不考虑PDM这么 高深的问题,今天我来给大家介绍一下如何把这个功能集成到自己的网页中,实现预览3D格式。
在这里插入图片描述
通过网页端的请求分析,以及后端服务器的对比,发现web版的edrawing是利用了新的scs格式来进行中转的,没有直接在web上对solidworks的原档进行解析,这样保证了数据的安全。
在这里插入图片描述
它利用了一个在线的服务来进行文件的转换,下图是3dcontentcentral这个网站上的请求截图:

在这里插入图片描述
在发布好web2客户端后,发现里面会有一个eDrawingsWebViewer的文件夹:里面就有转换的文件夹,再次进行研究
在这里插入图片描述
找到了一个转换的Exe文件,在cmd命令下直接有提示,传入输入的格式,以及输出的地址,就可以转换成scs文件了。
经过测试,这个转换工具可以直接转换x_t step等中间格式为scs文件,还是很厉害的。
在这里插入图片描述
在这里插入图片描述

最后在本地部署iis下直接 在Site文件夹下 打开main.html,并传入URL即可显示:

在这里插入图片描述
当前它本来有一个中转的服务,这个需要大家自己去处理。目前还没在把服务研究透。

下面是测量的截图

在这里插入图片描述

C# SolidWorks 二次开发 API—连接solidworks

从事二次开发十几年了,一直没有时间好好整理笔记,最近开始持续更新。

Solidworks二次开发需要一些C# Vb.net C++ 等编程语言的基础知识,大多使用Visual Studio进行开发。

再一个就是Solidworks要熟悉或者精通,因为任何手工都无法实现的东西,基本上做二次开发也不能实现。

那我们从最基础的连接到solidworks开始:

1.新建一个窗体程序或者控制台应用,我们以窗体程序为例:

加上一个按钮:

2.用NuGet查找solidworks进行dll的引用。自己选择对应版本或者其它包装好的库

(至少包括SolidWorks.Interop.sldworks ,SolidWorks.Interop.swconst,其它的可以删除掉)

3.新建一个公共类 

using SolidWorks.Interop.sldworks;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace CSharpAndSolidWorks
{
    public class Utility
    {
        public static ISldWorks SwApp { get; private set; }

        public static ISldWorks ConnectToSolidWorks()
        {
            if (SwApp != null)
            {
                return SwApp;
            }
            else
            {
                Debug.Print("connect to solidworks on " + DateTime.Now);
                try
                {
                    SwApp = (SldWorks)Marshal.GetActiveObject("SldWorks.Application");
                }
                catch (COMException)
                {
                    try
                    {
                        SwApp = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.23");//2015
                    }
                    catch (COMException)
                    {
                        try
                        {
                            SwApp = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.26");//2018
                        }
                        catch (COMException)
                        {
                            MessageBox.Show("Could not connect to SolidWorks.", "SolidWorks", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            SwApp = null;
                        }
                    }
                }

                return SwApp;
            }
        }
    }
}

上面这个代码块是C# 连接Solidworks的代码(EXE程序), 默认是solidworks已经被用户打开了。

这种连接不打开solidworks会提示连接失败。

这样我们可以获取到当前第一个运行的solidworks对象。(exe方式永远只能获取到第一个运行的solidworks对象。dll方式是集成在对应的运行进程中的,所以可以多个同时操作)

4.给按钮增加代码:

 private void BtnConnect_Click(object sender, EventArgs e)
        {
            ISldWorks swApp = Utility.ConnectToSolidWorks();

            if (swApp != null)
            {
                string msg = "This message from C#. solidworks version is " + swApp.RevisionNumber();

                swApp.SendMsgToUser(msg);
            }
        }

运行之后,点击按钮,会提示如下消息,表示我们用Visual Studio连接到已经打开的Solidworks成功了 。

可在此下载源码:https://gitee.com/painezeng/CSharpAndSolidWorks

—————————————–

关于连接可以参考下面这一文章:

Solidworks的多开操作与连接指定版本Solidworks

https://blog.csdn.net/zengqh0314/article/details/105565915

C# SolidWorks 二次开发 API —Solidworks的多开操作与连接指定版本Solidworks

        今天有网友问我关于如何用Exe操作多个Solidworks的问题,其实之前我看到过解决方案,是通过进程和id获取,而不是我们平时常用的 (SldWorks)Marshal.GetActiveObject(“SldWorks.Application.27”);

        所以晚上回来查了些资料,发现了有了解决方案,我精简了一下,做了个dll.大家可以试试。    

 ''' <summary>
    ''' 创建一个新的Solidworks并返回实例
    ''' </summary>
    ''' <param name="version">指定版本号,-1表示默认.</param>
    ''' <param name="suppressDialogs">True 则禁用solidworks弹出消息.</param>
    ''' <param name="requireMainWindow">True 表示运行完显示到主窗口</param>
    ''' <param name="startProcessTimeout">返回Null 如果SolidWorks在指定时间内没有打开。</param>
    ''' <param name="createWindowTimeout">返回Null 如果SolidWorks主窗口在指定时间内没有显示.</param>
    ''' <returns></returns>
    Public Shared Function RunSolidWorks(version As Integer,
                                         visible As Boolean,
                                         Optional suppressDialogs As Boolean = False,
                                         Optional requireMainWindow As Boolean = True,
                                         Optional startProcessTimeout As Integer = 30,
                                         Optional createWindowTimeout As Integer = 15) As SldWorks

        Dim executablePath As String = CTFileSystem.GetSolidWorksExecutablePath(version)

        If File.Exists(executablePath) = False Then Return Nothing

        Dim info As ProcessStartInfo = New ProcessStartInfo(executablePath)

        If suppressDialogs Then info.Arguments = "/r"

        Dim process As Process = Process.Start(info)
        Dim app As SldWorks = Nothing
        Dim t As DateTime = DateTime.Now

        While app Is Nothing
            Threading.Thread.Sleep(1000)
            If Math.Abs(DateTime.Now.Subtract(t).Seconds) > startProcessTimeout Then Return Nothing

            'If it were possible to get a GUID from a process ID then we could use GetActiveObject instead of this
            app = GetComObjectFromProcessId(process.Id)
        End While

        t = DateTime.Now
        While IsRunning(isMainWindowCreated:=True) = False
            Threading.Thread.Sleep(1000)
            If Math.Abs(DateTime.Now.Subtract(t).Seconds) > createWindowTimeout Then Return Nothing
        End While

        If visible = False Then
            Dim frame As Frame = app.Frame()
            If frame Is Nothing Then Return app
            Dim handle As IntPtr = frame.GetHWndx64()
            If ShowWindow(handle, 0) Then Return app
        End If

        Return app
    End Function

我刚刚进行了测试,用起来比较简单。我用代码新建了两个solidworks 2018窗口:


        private SldWorks sldWorks2018_1 = null;
        private SldWorks sldWorks2018_2 = null;

        private void button1_Click(object sender, EventArgs e)
        {
            sldWorks2018_1 = PStandAlone.RunSolidWorks(26, true, false, false, 30, 15);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            sldWorks2018_2 = PStandAlone.RunSolidWorks(26, true, false, false, 30, 15);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            sldWorks2018_1.SendMsgToUser("From 2018 -1");
            sldWorks2018_2.SendMsgToUser("From 2018 -2");
        }

      

源码https://gitee.com/painezeng/PSWStandalone(vb.net)

C# SolidWorks 二次开发 API—钣金零件信息提取

有一段时间没有发博文了,最近有人问到钣金件的相关操作,今天我们来看看钣金零件信息的读取。

Solidworks中钣金件是有一个单独的模块,里面有一些固定的文件夹结构。

最后这个文件夹中包含了展开状态时零件的信息。如长度与折弯线相关的信息都在这里面。

一般我们要找到长 宽 厚 折弯角 与距离  折弯方向 这些信息。

输出结果如下,有些小数的处理就忽略了。大家看看就行。 

粗略的写了下,输入信息在这里。很多就是API帮助里面的例子,大家可以在中文翻译中查找到。

        private void btnSheetmetal_Click(object sender, EventArgs e)
        {
            //连接到Solidworks
            ISldWorks swApp = Utility.ConnectToSolidWorks();
            swApp.CommandInProgress = true;
            ModelDoc2 swModel = (ModelDoc2)swApp.ActiveDoc;

            //钣金 变成平板模式的特征
            List<Feature> flatPatternFeatures = new List<Feature>();

            //Bounding Box草图
            List<string> boundingSketchesName = new List<string>();

            //获取当前钣金状态--这个已经过时

            //swSMBendStateFlattened  2 = 弯曲变平;该模型回滚到FlattenBends功能之后,但恰好在相应的ProcessBends功能之前
            //swSMBendStateFolded 3 = 折弯处已折叠;模型回滚到FlattenBends ProcessBends功能对之后
            //swSMBendStateNone   0 = 不是钣金零件;没有SheetMetal功能
            //swSMBendStateSharps 1 = 弯曲处处于锐利状态;零件回滚到第一个FlattenBends功能之前

            var bendState = swModel.GetBendState();

            if (bendState == 0)
            {
                swApp.SendMsgToUser("不是钣金零件!");
                return;
            }
            //  swApp.SendMsgToUser("当前状态" + bendState);
            if (bendState != 2)
            {
                //swApp.Command((int)swCommands_e.swCommands_Flatten, "");
                //设定当前钣金状态 平板 ,下面这行代码不适用现在的零件 ,只适用于很早之前的零件
                //var setStatus = swModel.SetBendState((int)swSMBendState_e.swSMBendStateFlattened);

                //新钣金均是通过获取零件
                var swFeatureManager = swModel.FeatureManager;
                var flatPatternFolder = (FlatPatternFolder)swFeatureManager.GetFlatPatternFolder();

                var featArray = (object[])flatPatternFolder.GetFlatPatterns();

                for (int i = featArray.GetLowerBound(0); i <= featArray.GetUpperBound(0); i++)
                {
                    var feat = (Feature)featArray[i];
                    Debug.Print("    " + feat.Name);

                    flatPatternFeatures.Add(feat);
                    feat.SetSuppression2((int)swFeatureSuppressionAction_e.swUnSuppressFeature, (int)swInConfigurationOpts_e.swThisConfiguration, null);

                    //解压子特征
                    var swSubFeat = (Feature)feat.GetFirstSubFeature();

                    while ((swSubFeat != null))
                    {
                        Debug.Print(swSubFeat.Name.ToString());
                        switch (swSubFeat.GetTypeName())
                        {
                            //如果是草图
                            case "ProfileFeature":

                                var sketchSpc = (Sketch)swSubFeat.GetSpecificFeature2();
                                object[] vSketchSeg = sketchSpc.GetSketchSegments();

                                for (int j = 0; j < vSketchSeg.Length; j++)
                                {
                                    SketchSegment swSketchSeg = (SketchSegment)vSketchSeg[j];

                                    //如果直线不是折弯线,说明是边界框
                                    if (swSketchSeg.IsBendLine() == false)
                                    {
                                        boundingSketchesName.Add(swSubFeat.Name);
                                    }
                                    else if (swSketchSeg.IsBendLine() == true)
                                    {
                                        Debug.Print("钣金宽度为:" + swSketchSeg.GetLength() * 1000);
                                    }
                                }

                                break;

                            default:
                                break;
                        }

                        swSubFeat = (Feature)swSubFeat.GetNextSubFeature();
                    }
                }

                swModel.EditRebuild3();
            }

            //遍历所有特征

            var swSelMgr = (SelectionMgr)swModel.SelectionManager;
            var swFeat = (Feature)swModel.FirstFeature();

            while ((swFeat != null))
            {
                //Debug.Print(swFeat.Name.ToString());
                // Process top-level sheet metal features
                switch (swFeat.GetTypeName())
                {
                    case "SMBaseFlange":
                        //var swBaseFlange = (BaseFlangeFeatureData)swFeat.GetDefinition();

                        //Debug.Print("钣金宽度为:" + swBaseFlange.D1OffsetDistance * 1000);

                        break;

                    case "SheetMetal":
                        //这里可以获取默认的厚度                        Debug.Print(swFeat.Name.ToString());
                        SheetMetalFeatureData sheetMetalFeatureData = (SheetMetalFeatureData)swFeat.GetDefinition();
                        Debug.Print("钣金默认厚度为:" + sheetMetalFeatureData.Thickness * 1000);

                        break;

                    case "SM3dBend":

                        break;

                    case "SMMiteredFlange":

                        break;
                }
                // process sheet metal sub-features
                var swSubFeat = (Feature)swFeat.GetFirstSubFeature();

                while ((swSubFeat != null))
                {
                    // Debug.Print(swSubFeat.Name.ToString());
                    switch (swSubFeat.GetTypeName())
                    {
                        case "SketchBend":

                            GetHisBendInformation(swApp, swModel, swSubFeat);
                            break;

                        case "OneBend":

                            GetHisBendInformation(swApp, swModel, swSubFeat);

                            break;

                        default:
                            break;
                            // Probably not a sheet metal feature
                    }

                    swSubFeat = (Feature)swSubFeat.GetNextSubFeature();
                }

                swFeat = (Feature)swFeat.GetNextFeature();
            }

            return;
        }

        private void GetHisBendInformation(ISldWorks swApp, ModelDoc2 swModel, Feature swFeat)
        {
            MathUtility swMathUtil = default(MathUtility);
            SelectionMgr swSelMgr = default(SelectionMgr);
            OneBendFeatureData swOneBend = default(OneBendFeatureData);
            Object[] vSketchSegs = null;
            SketchSegment swSketchSeg = default(SketchSegment);
            Sketch swSketch = default(Sketch);
            Feature swSketchFeat = default(Feature);
            SketchLine swSketchLine = default(SketchLine);
            SketchPoint swSkStartPt = default(SketchPoint);
            SketchPoint swSkEndPt = default(SketchPoint);
            SelectData swSelData = default(SelectData);
            double[] nPt = new double[3];
            MathPoint swStartPt = default(MathPoint);
            MathPoint swEndPt = default(MathPoint);
            MathTransform swSkXform = default(MathTransform);
            int[] vID = null;
            int i = 0;

            swMathUtil = (MathUtility)swApp.GetMathUtility();

            swSelMgr = (SelectionMgr)swModel.SelectionManager;
            //swFeat = (Feature)swSelMgr.GetSelectedObject6(1, -1);
            //swSelData = swSelMgr.CreateSelectData();
            swOneBend = (OneBendFeatureData)swFeat.GetDefinition();

            /*swBaseBend 4
            swEdgeFlangeBend 8
            swFlat3dBend 6
            swFlatBend 2
            swFreeFormBend 10 = Obsolete
            swHemBend 9
            swLoftedBend 12
            swMirrorBend 7
            swMiterBend 5
            swNoneBend 3
            swRoundBend 1
            swRuledBend 11 = Obsolete
            swSharpBend 0
            */

            Debug.Print("Type of bend (swBendType_e): " + swOneBend.GetType());
            Debug.Print("折弯次数: " + swOneBend.GetFlatPatternSketchSegmentCount2());
            Debug.Print("折弯序号: " + swOneBend.BendOrder);
            Debug.Print("折弯角度: " + swOneBend.BendAngle * 57.3 + " deg");
            Debug.Print("折弯圆角: " + swOneBend.BendRadius);

            if (swOneBend.BendDown == true)
            {
                Debug.Print("向下折弯: " + "Yes");
            }
            else
            {
                Debug.Print("向下折弯: " + " No");
            }

            vSketchSegs = (Object[])swOneBend.FlatPatternSketchSegments2;

            for (i = 0; i <= vSketchSegs.GetUpperBound(0); i++)
            {
                swSketchSeg = (SketchSegment)vSketchSegs[i];
                swSketch = swSketchSeg.GetSketch();
                swSketchLine = (SketchLine)swSketchSeg;
                swSkStartPt = (SketchPoint)swSketchLine.GetStartPoint2();
                swSkEndPt = (SketchPoint)swSketchLine.GetEndPoint2();
                vID = (int[])swSketchSeg.GetID();

                // Get sketch feature
                swSketchFeat = (Feature)swSketch;
                swSkXform = swSketch.ModelToSketchTransform;
                swSkXform = (MathTransform)swSkXform.Inverse();

                nPt[0] = swSkStartPt.X;
                nPt[1] = swSkStartPt.Y;
                nPt[2] = swSkStartPt.Z;
                swStartPt = (MathPoint)swMathUtil.CreatePoint(nPt);
                swStartPt = (MathPoint)swStartPt.MultiplyTransform(swSkXform);
                double[] swStartPtArrayData;
                swStartPtArrayData = (double[])swStartPt.ArrayData;

                nPt[0] = swSkEndPt.X;
                nPt[1] = swSkEndPt.Y;
                nPt[2] = swSkEndPt.Z;
                swEndPt = (MathPoint)swMathUtil.CreatePoint(nPt);
                swEndPt = (MathPoint)swEndPt.MultiplyTransform(swSkXform);
                double[] swEndPtArrayData;
                swEndPtArrayData = (double[])swEndPt.ArrayData;

                // Debug.Print("File = " + swModel.GetPathName());
                Debug.Print("  Feature = " + swFeat.Name + " [" + swFeat.GetTypeName2() + "]");
                Debug.Print("    Sketch             = " + swSketchFeat.Name);
                Debug.Print("    SegID              = [" + vID[0] + ", " + vID[1] + "]");
                Debug.Print("    Start with respect to sketch   = (" + swSkStartPt.X * 1000.0 + ", " + swSkStartPt.Y * 1000.0 + ", " + swSkStartPt.Z * 1000.0 + ") mm");
                Debug.Print("    End with respect to sketch   = (" + swSkEndPt.X * 1000.0 + ", " + swSkEndPt.Y * 1000.0 + ", " + swSkEndPt.Z * 1000.0 + ") mm");
                Debug.Print("    Start with respect to model    = (" + swStartPtArrayData[0] * 1000.0 + ", " + swStartPtArrayData[1] * 1000.0 + ", " + swStartPtArrayData[2] * 1000.0 + ") mm");
                Debug.Print("    End with respect to model    = (" + swEndPtArrayData[0] * 1000.0 + ", " + swEndPtArrayData[1] * 1000.0 + ", " + swEndPtArrayData[2] * 1000.0 + ") mm");
            }
        }
  

 

C# SolidWorks 二次开发 API — 文件导出(x_t/dxf)

小例子,导出文件。

下面是代码:

        private void btnExport_Click(object sender, EventArgs e)
        {
            ISldWorks swApp = Utility.ConnectToSolidWorks();

            if (swApp != null)
            {
                ModelDoc2 swModel = (ModelDoc2)swApp.ActiveDoc;

                if (swModel.GetType() == (int)swDocumentTypes_e.swDocPART || swModel.GetType() == (int)swDocumentTypes_e.swDocASSEMBLY)
                {
                    ModelDocExtension swModExt = (ModelDocExtension)swModel.Extension;

                    int error = 0;

                    int warnings = 0;

                    //设置导出版本
                    swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swParasolidOutputVersion, (int)swParasolidOutputVersion_e.swParasolidOutputVersion_161);

                    swModExt.SaveAs(@"C:\export.x_t", (int)swSaveAsVersion_e.swSaveAsCurrentVersion, (int)swSaveAsOptions_e.swSaveAsOptions_Silent, null, ref error, ref warnings);
                }
                else if (swModel.GetType() == (int)swDocumentTypes_e.swDocDRAWING)
                {
                    ModelDocExtension swModExt = (ModelDocExtension)swModel.Extension;

                    int error = 0;

                    int warnings = 0;

                    //设置dxf 导出版本 R14
                    swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swDxfVersion, 2);

                    //是否显示 草图
                    swModel.SetUserPreferenceToggle(196, false);

                    swModExt.SaveAs(@"C:\export.dxf", (int)swSaveAsVersion_e.swSaveAsCurrentVersion, (int)swSaveAsOptions_e.swSaveAsOptions_Silent, null, ref error, ref warnings);
                }
            }
        }