C# Solidworks二次开发:枚举应用实战(第五讲)

大家好,今天是我们枚举应用的第五讲。

下面是今天要介绍的枚举:

(1)第一个枚举为swConStraintType_e,这个枚举为草图约束,下面是官方的具体枚举值:

MemberDescription
swConstraintType_ALONGX48
swConstraintType_ALONGX3D64
swConstraintType_ALONGXPOINTS51
swConstraintType_ALONGXPOINTS3D66
swConstraintType_ALONGY49
swConstraintType_ALONGY3D65
swConstraintType_ALONGYPOINTS52
swConstraintType_ALONGYPOINTS3D67
swConstraintType_ALONGZ50
swConstraintType_ALONGZPOINTS53
swConstraintType_ANGLE2
swConstraintType_ANGLE3P43
swConstraintType_ARCANG18019
swConstraintType_ARCANG27020
swConstraintType_ARCANG9018
swConstraintType_ARCANGBOTTOM22
swConstraintType_ARCANGLEFT23
swConstraintType_ARCANGRIGHT24
swConstraintType_ARCANGTOP21
swConstraintType_ARCLENGTH44
swConstraintType_ATINTERSECT13
swConstraintType_ATMIDDLE12
swConstraintType_ATPIERCE40
swConstraintType_BELTTRACTION69
swConstraintType_BLOCKFIXEDLOCK70 = Lock two blocks together
swConstraintType_BLOCKNORMALLOCK71 = Lock blocks to be normal to one another (3D sketch)
swConstraintType_BLOCKROTATELOCK72 = Lock blocks to rotate around each other (3D sketch)
swConstraintType_C3TOUCH83
swConstraintType_CIRCULARPATTCNT77
swConstraintType_COINCIDENT9
swConstraintType_COLINEAR27
swConstraintType_CONCENTRIC10
swConstraintType_CONICRHO82
swConstraintType_CORADIAL28
swConstraintType_DIAMETER15
swConstraintType_DISTANCE1
swConstraintType_DOUBLEANGLE84 = Double angle display
swConstraintType_DOUBLEDISTANCE41
swConstraintType_ELLIPSEANG18034
swConstraintType_ELLIPSEANG27035
swConstraintType_ELLIPSEANG9033
swConstraintType_ELLIPSEANGBOTTOM37
swConstraintType_ELLIPSEANGLEFT38
swConstraintType_ELLIPSEANGRIGHT39
swConstraintType_ELLIPSEANGTOP36
swConstraintType_EQUALCURV3DALIGN80 =  Aligned equal curvature between 3D splines
swConstraintType_EQUALCURVATURE61
swConstraintType_EQUALTANGENT62
swConstraintType_FAKESLOTCONSTRAINT73 = Not actually a constraint; for display purposes only
swConstraintType_FITSPLINE60
swConstraintType_FIXED17
swConstraintType_FIXEDSLOT74 = Fix a slot
swConstraintType_FLANGEFACEDIST81 = Distance from virtual point to the relevant flange face
swConstraintType_HORIZONTAL4
swConstraintType_HORIZPOINTS25
swConstraintType_INTERSECTION56
swConstraintType_INVALIDCTYPE0
swConstraintType_ISOBYPOINT58 = ISO curve when its constraint parameter is determined by an external point
swConstraintType_LINEARPATTCNT76
swConstraintType_MERGEPOINTS42
swConstraintType_NORMAL45
swConstraintType_NORMALPOINTS46
swConstraintType_OFFSETEDGE16
swConstraintType_PARALLEL7
swConstraintType_PARALLELYZ54
swConstraintType_PARALLELZX55
swConstraintType_PATTERNED57
swConstraintType_PERPENDICULAR8
swConstraintType_PLANAROFFSET79 = For routing pipe offsets
swConstraintType_RADIALOFFSET78 = For routing pipe offsets
swConstraintType_RADIUS3
swConstraintType_SAMECURVELENGTH85 = Equal arc/spline length
swConstraintType_SAMEISOPARAM59 = Common relation for all pieces ( for the face ) of the surface's iso curve
swConstraintType_SAMELENGTH14
swConstraintType_SAMESLOTS75 = Same slot width and length
swConstraintType_SKETCHOFFSET47 = Between entities of the same sketch
swConstraintType_SNAPANGLE31
swConstraintType_SNAPGRID29
swConstraintType_SNAPLENGTH30
swConstraintType_SYMMETRIC11
swConstraintType_TANGENT6
swConstraintType_TANGENTFACE63
swConstraintType_TRACTION68
swConstraintType_USEEDGE32
swConstraintType_VERTICAL5 = Applies only to sketch lines
swConstraintType_VERTPOINTS26 = Applies only to sketch points

(2)第二个为swDesignTableErrors_e,这个枚举值为设计表的错误,下面是官方的具体枚举值:

MemberDescription
swDTbCannotOpen27 
swDTblCfgInvalid1
swDTblCorrupt
swDTblCurrentlyEditing
swDTblDataInvalidComponetState15 
swDTblDataInvalidFeatureState16 
swDTblDisplayStateError18 
swDTblExiting
swDTblFileNotFound
swDTblInvalidColCustomProp10 
swDTblInvalidColumnDimName11 
swDTblInvalidColumnFeatName12 
swDTblInvalidColumnKeyWord13 
swDTblInvalidColumnValue
swDTblInvalidConfigName14
swDTblInvalidRowNameKeyword21 
swDTblInvalidYesNoData17 
swDTblLinkChanged
swDTblModelFeatRequired19 
swDTblNegitiveDimension25 
swDTblNoError0
swDTblNoFileName
swDTblNotSuppressible23 
swDTblParentConfigInvalid20 
swDTblTableIsEmpty24 
swDTblTolTypeInvalid22 
swDTblTooManyColumns
swDTbUnUsedConfiguration26 
swDTConfigCircularDefinition33 
swDTDimAngleValueRangeError31 
swDTDimValueRangeError30 
swDTInvalidComponentName28 
swDTInvalidEquation32 
swDTNeedsComponent29 

(3)第三个为swFaultEntityErrorCode_e,这个枚举为实体故障错误码,下面是官方具体的枚举值:

MemberDescription
swBodyCorrupt1 = Data structure is corrupt
swBodyInsideOut3 = Body is inside out
swBodyInvalidIdentifiers2 = Body has invalid or duplicate identifiers
swBodyRegionsInconsistent4 = Regions of body are inconsistent
swEdgeBadFaceOrder14 = On a non-manifold edge, the face order around the edge does not match the order of the faces' surfaces around the edge
swEdgeBadWire15 = Two wireframe edges intersect at a position other than a vertex
swEdgeNonPeriodicCurve5 = Open or non-periodic curve on ring edge
swEdgeNonPeriodicNomGeom6 = Open or non-periodic nominal geometry on ring edge
swEdgeSpcurveOutOfTol11 = Spcurve not within edge's tolerance
swEdgeSpcurveOutOfTolNomGeom12 = Spcurve not within edge's tolerance of nominal geometry
swEdgeTouchEdge36 = Edges touch
swEdgeVertexNotLie7 = Vertex does not lie on edge's curve
swEdgeVertexNotLieNomGeom8 = Vertex does not lie on nominal geometry
swEdgeVerticesTouch13 = Vertices of edge touch
swEdgeWrongDir9 = Curve in wrong direction for edge
swEdgeWrongDirNomGeom10 = Nominal geometry in wrong direction
swEntityStateInvalid34 = State of entity is invalid
swFaceBadEdge17 = Edge does not lie on face's surface
swFaceBadEdgeOrder18 = Edge order around the face does not match the order of the edges' curves around the face
swFaceBadLoops20 = Loops inconsistent
swFaceBadVertex16 = Vertex does not lie on face's surface
swFaceBadWireframe22 = A wireframe edge intersects a face at a position other than a vertex
swFaceCheckerFailure23 = Checker failure during face/face check
swFaceFaceInconsistency24 = Inconsistent faces
swFaceNoAccomVertex19 = A surface singularity has no accompanying vertex
swFaceSelfIntersecting21 = Face is self intersecting
swGeomDegenerate26 = Geometry degenerated
swGeomStateSelfIntersect25 = Geometry is self intersecting
swRegionBadShells27 = Inconsistent shells
swShellBadTopologyGeometry28 = A topological entity belonging to a shell is not geometrically within the shell
swShellIntersect29 = Shell shell inconsistency
swTopolMissingGeometry35 = Missing geometry
swTopolNotG1Continuous30 = Topology's geometry is not G1 continuous
swTopolSizeBoxViolation31 = Some or all of entity is outside size box
swTopolStateCheckFail32 = Checker failure
swTopolStateNoGeometry33 = Missing geometry

(4)第四个为swKernelErrorCode_e,这个枚举为内核错误码,下面是官方的具体枚举值:

MemberDescription
swErrorBodyDontKnit-101041
swErrorCheckFailed-105061
swErrorCheckFailed2-113812
swErrorCurveDiscontinuous-100131
swErrorCurveShort-101057
swErrorEdgeIncorrectOrder-116406
swErrorEdgeisectInvalid-116404
swErrorError0
swErrorFacecheckFailed-113829
swErrorFaceFaceInconsistent-113816
swErrorFaceRedundant-116402
swErrorFailed-101063
swErrorGeometryDegenerate-113806
swErrorGeometryDiscontinuous-113827
swErrorGeometryMissing-113803
swErrorGeometrySelfx-113805
swErrorHasInvalidentity-101004
swErrorInconsistentDirs-116403
swErrorInvalidEntity-100914
swErrorInvalidGeometry-100999
swErrorInvalidGeometry2-113808
swErrorInvalidKnots-100978
swErrorInvalidLoop-116405
swErrorInvalidParameter-100120
swErrorInvalidPattern-101042
swErrorInvalidSharing-100921
swErrorLoopsInconsistent-113826
swErrorNotEntity-100022
swErrorSuccess1
swErrorSurfaceDiscontinuous-100129
swErrorTopologySelfx-113804
swErrorUnknown-1
swErrorVertexNotOnCurve-113818
swErrorVerticesTouch-113821

本篇文章要介绍的就是这么多,我们下篇文章再见。

  • 12
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
C# SolidWorks二次开发是指使用C#编程语言来扩展和定制SolidWorks软件的功能。下面是进行C# SolidWorks二次开发的步骤: 1. 环境配置: - 首先,确保您已经安装了SolidWorks软件和Visual Studio开发环境。 - 然后,安装SolidWorks API SDK。您可以在SolidWorks安装包中找到"SolidWorks API SDK.msi"文件,并按照安装向导进行安装。 2. 创建插件Addin: - 打开Visual Studio,并创建一个新的C#项目。 - 在项目中,添加对SolidWorks API的引用。您可以在项目的引用中添加SolidWorks.Interop.sldworks和SolidWorks.Interop.swcommands等引用。 - 创建一个类,并实现SolidWorks的事件接口,例如ISwAddin或ISwAddin2。 - 实现所需的功能,例如创建自定义工具栏、菜单或按钮,并实现其相应的事件处理程序。 3. 运行和调试: - 在Visual Studio中编译和生成项目。 - 将生成的插件文件(.dll文件)复制到SolidWorks的插件目录中,一般为"C:\ProgramData\SolidWorks\SOLIDWORKS 20XX\addins"。 - 启动SolidWorks软件,您应该能够看到您创建的自定义工具栏、菜单或按钮。 - 单击按钮或执行其他操作来测试和调试您的插件功能。 通过以上步骤,您可以开始使用C#编程语言进行SolidWorks的二次开发,实现自定义的功能和工具,以满足您的需求。请确保在开发过程中参考官方文档和其他相关教程,以便更好地理解和掌握C# SolidWorks二次开发的技术。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

喵桑さん

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值