本文主要是介绍C# Solidworks二次开发:枚举应用实战(第六讲),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
大家好,今天继续介绍我们的枚举应用实战系列。
下面是今天要介绍的枚举:
(1)第一个为swMateType_e,这个枚举为装配件的类型,下面是官方的具体枚举值:
Member | Description |
---|---|
swMateANGLE | 6 |
swMateCAMFOLLOWER | 9 |
swMateCOINCIDENT | 0 |
swMateCONCENTRIC | 1 |
swMateCOORDINATE | 20 |
swMateDISTANCE | 5 |
swMateGEAR | 10 |
swMateHINGE | 22 |
swMateLINEARCOUPLER | 18 |
swMateLOCK | 16 |
swMateLOCKTOSKETCH | 12 |
swMateMAGNETIC | 25 |
swMateMAXMATES | 14 |
swMatePARALLEL | 3 |
swMatePATH | 15 |
swMatePERPENDICULAR | 2 |
swMatePROFILECENTER | 24 |
swMateRACKPINION | 13 |
swMateSCREW | 17 |
swMateSLIDER | 23 |
swMateSLOT | 21 |
swMateSYMMETRIC | 8 |
swMateTANGENT | 4 |
swMateUNIVERSALJOINT | 19 |
swMateUNKNOWN | 7 |
swMateWIDTH | 11 |
(2)第二个为swPropertyManagerPageBitmapButtons_e,这个枚举为属性管理器页面位图按钮,下面是官方的具体枚举值:
Member | Description |
---|---|
swBitmapButtonImage_alongz | 1 |
swBitmapButtonImage_angle | 2 |
swBitmapButtonImage_auto_bal_circular | 3 |
swBitmapButtonImage_auto_bal_left | 4 |
swBitmapButtonImage_auto_bal_right | 5 |
swBitmapButtonImage_auto_bal_square | 6 |
swBitmapButtonImage_auto_bal_top | 7 |
swBitmapButtonImage_diameter | 8 |
swBitmapButtonImage_dimension_set_default_attributes | 38 |
swBitmapButtonImage_distance1 | 9 |
swBitmapButtonImage_distance2 | 10 |
swBitmapButtonImage_draft | 11 |
swBitmapButtonImage_dve_but_cmark_bolt | 12 |
swBitmapButtonImage_dve_but_cmark_linear | 13 |
swBitmapButtonImage_dve_but_cmark_single | 14 |
swBitmapButtonImage_favorite_add | 34 |
swBitmapButtonImage_favorite_delete | 35 |
swBitmapButtonImage_favorite_load | 37 |
swBitmapButtonImage_favorite_save | 36 |
swBitmapButtonImage_leader_ang_above | 15 |
swBitmapButtonImage_leader_ang_beside | 16 |
swBitmapButtonImage_leader_hor_above | 17 |
swBitmapButtonImage_leader_hor_beside | 18 |
swBitmapButtonImage_leader_left | 19 |
swBitmapButtonImage_leader_no | 20 |
swBitmapButtonImage_leader_right | 21 |
swBitmapButtonImage_leader_yes | 22 |
swBitmapButtonImage_parallel | 23 |
swBitmapButtonImage_perpendicular | 24 |
swBitmapButtonImage_reverse_direction | 25 |
swBitmapButtonImage_revision_circle | 26 |
swBitmapButtonImage_revision_hexagon | 27 |
swBitmapButtonImage_revision_square | 28 |
swBitmapButtonImage_revision_triangle | 29 |
swBitmapButtonImage_stack | 33 |
swBitmapButtonImage_stackleft | 30 |
swBitmapButtonImage_stackright | 31 |
swBitmapButtonImage_stackup | 32 |
(3)第三个为swRunMacroError_e,这个枚举为VBA宏错误代码,下面是官方的具体枚举值:
Member | Description |
---|---|
swRunMacroError_BadParmCount | 9 |
swRunMacroError_BadVarType | 10 |
swRunMacroError_Busy | 17 |
swRunMacroError_CallFailed | 20 |
swRunMacroError_CallRejected | 19 |
swRunMacroError_CantSave | 27 |
swRunMacroError_ConnectionTerminated | 18 |
swRunMacroError_DiskError | 26 |
swRunMacroError_Exception | 12 |
swRunMacroError_InvalidArg | 1 |
swRunMacroError_Invalidindex | 22 |
swRunMacroError_InvalidProcname | 6 |
swRunMacroError_InvalidPropertyType | 7 |
swRunMacroError_MacrosAreDisabled | 2 |
swRunMacroError_NoPermission | 23 |
swRunMacroError_NotInDesignMode | 3 |
swRunMacroError_OnlyCodeModules | 4 |
swRunMacroError_OpenFileFailed | 28 |
swRunMacroError_OutOfMemory | 5 |
swRunMacroError_Overflow | 13 |
swRunMacroError_ParmNotOptional | 15 |
swRunMacroError_Reverted | 24 |
swRunMacroError_SuborfuncExpected | 8 |
swRunMacroError_TooManyOpenFiles | 25 |
swRunMacroError_TypeMismatch | 14 |
swRunMacroError_UnknownLcid | 16 |
swRunMacroError_UserInterrupt | 11 |
swRunMacroError_Zombied | 21 |
(4)第四个为swSelectType_e,这个枚举值为返回ID类型的值,下面是官方的具体枚举值:
Member | Description |
---|---|
swSelANNOTATIONTABLES | 98; See Remarks |
swSelANNOTATIONVIEW | 139; See Remarks |
swSelARROWS | 49; See Remarks |
swSelATTRIBUTES | 8; See Remarks |
swSelBLOCKDEF | 99; See Remarks |
swSelBLOCKINST | 93; See Remarks |
swSelBODYFEATURES | 22; See Remarks |
swSelBODYFOLDER | 118; See Remarks |
swSelBOMFEATURES | 97; See Remarks |
swSelBOMS | 54; See Remarks |
swSelBOMTEMPS | 64; See Remarks |
swSelBorder | 254; See Remarks |
swSelBREAKLINES | 31; See Remarks |
swSelBROWSERITEM | 69; See Remarks |
swSelCAMERAS | 136; See Remarks |
swSelCENTERLINES | 103; See Remarks |
swSelCENTERMARKS | 28; See Remarks |
swSelCENTERMARKSYMS | 100; See Remarks |
swSelCOMMENT | 127; See Remarks |
swSelCOMMENTSFOLDER | 126; See Remarks |
swSelCOMPONENTS | 20; See Remarks |
swSelCOMPPATTERN | 37; See Remarks |
swSelCOMPSDONTOVERRIDE | 72; See Remarks |
swSelCONFIGURATIONS | 47; See Remarks |
swSelCONNECTIONPOINTS | 66; See Remarks |
swSelCOORDSYS | 61; See Remarks |
swSelCOSMETICWELDS | 220; See Remarks |
swSelCTHREADS | 39; See Remarks |
swSelCUSTOMSYMBOLS | 60; See Remarks |
swSelDATUMAXES | 5; See Remarks |
swSelDATUMLINES | 62; See Remarks |
swSelDATUMPLANES | 4; See Remarks |
swSelDATUMPOINTS | 6; See Remarks |
swSelDATUMTAGS | 36; See Remarks |
swSelDCABINETS | 42; See Remarks |
swSelDETAILCIRCLES | 17; See Remarks |
swSelDIMENSIONS | 14; See Remarks |
swSelDISPLAYSTATE | 148; See Remarks |
swSelDOCSFOLDER | 125; See Remarks |
swSelDOWELSYMS | 86; See Remarks |
swSelDRAWINGVIEWS | 12; See Remarks |
swSelDTMTARGS | 40; See Remarks |
swSelEDGES | 1; See Remarks |
swSelEMBEDLINKDOC | 123; See Remarks |
swSelEMPTYSPACE | 72; See Remarks |
swSelEQNFOLDER | 55; See Remarks |
swSelEVERYTHING | -3; See Remarks |
swSelEXCLUDEMANIPULATORS | 111; See Remarks |
swSelEXPLLINES | 45; See Remarks |
swSelEXPLSTEPS | 44; See Remarks |
swSelEXPLVIEWS | 43; See Remarks |
swSelEXTSKETCHPOINTS | 25; See Remarks |
swSelEXTSKETCHSEGS | 24; See Remarks |
swSelEXTSKETCHTEXT | 88; See Remarks |
swSelFABRICATEDROUTE | 70; See Remarks |
swSelFACES | 2; See Remarks |
swSelFRAMEPOINT | 77; See Remarks |
swSelFTRFOLDER | 94; See Remarks |
swSelGENERALTABLEFEAT | 142; See Remarks |
swSelGTOLS | 13; See Remarks |
swSelHELIX | 26; See Remarks |
swSelHOLESERIES | 83; See Remarks |
swSelHOLETABLEAXES | 105; See Remarks |
swSelHOLETABLEFEATS | 104; See Remarks |
swSelIMPORTFOLDER | 57; See Remarks |
swSelINCONTEXTFEAT | 29; See Remarks |
swSelINCONTEXTFEATS | 32; See Remarks |
swSelJOURNAL | 124; See Remarks |
swSelLEADERS | 84; See Remarks |
swSelLIGHTS | 73; See Remarks |
swSelLOCATIONS | -2; See Remarks |
SwSelMAGNETICLINES | 225; See Remarks |
swSelMANIPULATORS | 79; See Remarks |
swSelMATEGROUP | 30; See Remarks |
swSelMATEGROUPS | 33; See Remarks |
swSelMATES | 21; See Remarks |
swSelMATESUPPLEMENT | 138; See Remarks |
swSelMIDPOINTS | 59; See Remarks |
swSelNOTES | 15; See Remarks |
swSelNOTHING | 0; See Remarks |
swSelOBJGROUP | 155; See Remarks |
swSelOBJHANDLES | 48; See Remarks |
swSelOLEITEMS | 7; See Remarks |
swSelPICTUREBODIES | 80; See Remarks |
swSelPLANESECTIONS | 219; see Remarks |
swSelPOINTREFS | 41; See Remarks |
swSelPOSGROUP | 68; See Remarks |
swSelPUNCHTABLEFEATS | 234; See Remarks |
swSelREFCURVES | 23; See Remarks |
swSelREFEDGES | 51; See Remarks |
swSelREFERENCECURVES | 26; See Remarks |
swSelREFFACES | 52; See Remarks |
swSelREFSILHOUETTE | 53; See Remarks |
swSelREFSURFACES | 27; See Remarks |
swSelREVISIONCLOUDS | 240; See Remarks |
swSelREVISIONTABLE | 113; See Remarks |
swSelREVISIONTABLEFEAT | 119; See Remarks |
swSelROUTECURVES | 63; See Remarks |
swSelROUTEPOINTS | 65; See Remarks |
swSelROUTESWEEPS | 67; See Remarks |
swSelSECTIONLINES | 16; See Remarks |
swSelSECTIONTEXT | 18; See Remarks |
swSelSELECTIONSETFOLDER | 258; See Remarks |
swSelSELECTIONSETNODE | 259; See Remarks |
swSelSFSYMBOLS | 35; See Remarks |
swSelSHEETS | 19; See Remarks |
swSelSILHOUETTES | 46; See Remarks |
swSelSIMELEMENT | 102; See Remarks |
swSelSIMULATION | 101; See Remarks |
swSelSKETCHBITMAP | 85; See Remarks |
swSelSKETCHCONTOUR | 96; See Remarks |
swSelSKETCHES | 9; See Remarks |
swSelSKETCHHATCH | 56; See Remarks |
swSelSKETCHPOINTFEAT | 71; See Remarks |
swSelSKETCHPOINTS | 11; See Remarks |
swSelSKETCHREGION | 95; See Remarks |
swSelSKETCHSEGS | 10; See Remarks |
swSelSKETCHTEXT | 34; See Remarks |
swSelSOLIDBODIES | 76; See Remarks |
swSelSOLIDBODIESFIRST | 81; See Remarks |
swSelSUBATOMFOLDER | 121; See Remarks |
swSelSUBSKETCHDEF | 154; See Remarks |
swSelSUBSKETCHINST | 114; See Remarks |
swSelSUBWELDFOLDER | 107; See Remarks |
swSelSURFACEBODIES | 75; See Remarks |
swSelSURFBODIESFIRST | 78; See Remarks |
swSelSWIFTANNOTATIONS | 130; See Remarks |
swSelSWIFTFEATURES | 132; See Remarks |
swSelSWIFTSCHEMA | 159; See Remarks |
swSelTITLEBLOCK | 192; See Remarks |
swSelTITLEBLOCKTABLEFEAT | 206; See Remarks |
swSelUNSUPPORTED | -1; See Remarks |
swSelVERTICES | 3; See Remarks |
swSelVIEWERHYPERLINK | 58; See Remarks |
swSelWELDBEADS | 122; See Remarks |
swSelWELDMENT | 106; See Remarks |
swSelWELDMENTTABLEFEATS | 116; See Remarks |
swSelWELDS | 38; See Remarks |
swSelWIREBODIES | 74; See Remarks |
swSelZONES | 50; See Remarks |
其对应的备注如下所示:
swSelectType_e | IModelDocExtension::SelectByID2 | ISelectionMgr::GetSelectedObject6 | IFeature::GetSpecificFeature2 |
---|---|---|---|
swSelNOTHING | |||
swSelEDGES | "EDGE" | IEdge | |
swSelFACES | "FACE" | IFace2 | |
swSelVERTICES | "VERTEX" | IVertex | |
swSelDATUMPLANES | "PLANE" | Feature2 | IRefPlane |
swSelDATUMAXES | "AXIS" | Feature2 | IRefAxis |
swSelDATUMPOINTS | "DATUMPOINT" | Feature1 | No specific interface |
swSelOLEITEMS | "OLEITEM" | Not Supported | |
swSelATTRIBUTES | "ATTRIBUTE" | Feature1 | IAttribute |
swSelSKETCHES | "SKETCH" | Feature2 | ISketch |
swSelSKETCHSEGS | "SKETCHSEGMENT" | ISketchSegment | |
swSelSKETCHPOINTS | "SKETCHPOINT" | ISketchPoint | |
swSelDRAWINGVIEWS | "DRAWINGVIEW" | IView | |
swSelGTOLS | "GTOL" | IGtol | |
swSelDIMENSIONS | "DIMENSION" | IDisplayDimension | |
swSelNOTES | "NOTE" | INote | |
swSelSECTIONLINES | "SECTIONLINE" | Feature1 | IDrSection |
swSelDETAILCIRCLES | "DETAILCIRCLE" | Feature1 | IDetailCircle |
swSelSECTIONTEXT | "SECTIONTEXT" | ||
swSelSHEETS | "SHEET" | ISheet | |
swSelCOMPONENTS | "COMPONENT" | IComponent2 | |
swSelMATES | "MATE" | Feature2 | IMate |
swSelBODYFEATURES | "BODYFEATURE"3 | Feature1 | No specific interface |
swSelREFCURVES | "REFCURVE" | Feature1 | IReferenceCurve |
swSelEXTSKETCHSEGS | "EXTSKETCHSEGMENT" | ISketchSegment | |
swSelEXTSKETCHPOINTS | "EXTSKETCHPOINT" | ISketchPoint or origin point | |
swSelHELIX | "HELIX" | ||
swSelREFERENCECURVES | "REFERENCECURVES" | Feature1 | IReferenceCurve |
swSelREFSURFACES | "REFSURFACE" | ||
swSelCENTERMARKS | "CENTERMARKS" | Not supported | |
swSelINCONTEXTFEAT | "INCONTEXTFEAT" | ||
swSelMATEGROUP | "MATEGROUP" | ||
swSelBREAKLINES | "BREAKLINE" | IBreakLine | |
swSelINCONTEXTFEATS | "INCONTEXTFEATS" | ||
swSelMATEGROUPS | "MATEGROUPS" | ||
swSelSKETCHTEXT | "SKETCHTEXT" | ||
swSelSFSYMBOLS | "SFSYMBOL" | ISFSymbol | |
swSelDATUMTAGS | "DATUMTAG" | IDatumTag | |
swSelCOMPPATTERN | "COMPPATTERN" | ||
swSelWELDS | "WELD" | IWeldSymbol | |
swSelCTHREADS | "CTHREAD" | Feature or ICThread4 | ICosmeticThreadFeatureData |
swSelDTMTARGS | "DTMTARG" | IDatumTargetSym | |
swSelPOINTREFS | "POINTREF" | ||
swSelDCABINETS | "DCABINET" | ||
swSelEXPLVIEWS | "EXPLODEDVIEWS" | ||
swSelEXPLSTEPS | "EXPLODESTEPS" | ||
swSelEXPLLINES | "EXPLODELINES" | ||
swSelSILHOUETTES | "SILHOUETTE" | ISilhouetteEdge | |
swSelCONFIGURATIONS | "CONFIGURATIONS" | Feature1 | IConfiguration |
swSelOBJHANDLES | |||
swSelARROWS | "VIEWARROW" | IProjectionArrow | |
swSelZONES | "ZONES" | ||
swSelREFEDGES | "REFERENCE-EDGE" | IEdge | |
swSelREFFACES | |||
swSelREFSILHOUETTE | Feature1 | ||
swSelBOMS | "BOM" | ||
swSelEQNFOLDER | "EQNFOLDER" | ||
swSelSKETCHHATCH | "SKETCHHATCH" | ||
swSelIMPORTFOLDER | "IMPORTFOLDER" | ||
swSelVIEWERHYPERLINK | "HYPERLINK" | ||
swSelMIDPOINTS | |||
swSelCUSTOMSYMBOLS - Obsolete | "CUSTOMSYMBOL" | ICustomSymbol | |
swSelCOORDSYS | "COORDSYS" | ||
swSelDATUMLINES | "REFLINE" | ||
swSelROUTECURVES | |||
swSelBOMTEMPS | "BOMTEMP" | ||
swSelROUTEPOINTS | "ROUTEPOINT" | ||
swSelCONNECTIONPOINTS | "CONNECTIONPOINT" | ||
swSelROUTESWEEPS | |||
swSelPOSGROUP | "POSGROUP" | ||
swSelBROWSERITEM | "BROWSERITEM" | ||
swSelFABRICATEDROUTE | "ROUTEFABRICATED" | ||
swSelSKETCHPOINTFEAT | "SKETCHPOINTFEAT" | ||
swSelCOMPSDONTOVERRIDE | |||
swSelLIGHTS | "LIGHTS" | ||
swSelWIREBODIES | |||
swSelSURFACEBODIES | "SURFACEBODY" | ||
swSelSOLIDBODIES | "SOLIDBODY" | ||
swSelFRAMEPOINT | "FRAMEPOINT" | ||
swSelSURFBODIESFIRST | |||
swSelMANIPULATORS | "MANIPULATOR" | ||
swSelPICTUREBODIES | "PICTURE BODY" | ||
swSelSOLIDBODIESFIRST | |||
swSelLEADERS | "LEADER" | ||
swSelSKETCHBITMAP | "SKETCHBITMAP" | ||
swSelDOWELSYMS | "DOWLELSYM" | IDowelSymbol | |
swSelEXTSKETCHTEXT | "EXTSKETCHTEXT" | ||
swSelBLOCKINST - Obsolete | "BLOCKINST" | IBlockInstance | |
swSelFTRFOLDER | "FTRFOLDER" | ||
swSelSKETCHREGION | "SKETCHREGION" | ||
swSelSKETCHCONTOUR | "SKETCHCONTOUR" | ||
swSelBOMFEATURES | "BOMFEATURE" | ||
swSelANNOTATIONTABLES | "ANNOTATIONTABLES" |
| |
swSelBLOCKDEF | "BLOCKDEF" | ||
swSelCENTERMARKSYMS | "CENTERMARKSYMS" | ||
swSelSIMULATION | "SIMULATION" | ||
swSelSIMELEMENT | "SIMULATION_ELEMENT" | ||
swSelCENTERLINES | "CENTERLINE" | ||
swSelHOLETABLEFEATS | "HOLETABLE" | IHoleTable | |
swSelHOLETABLEAXES | "HOLETABLEAXIS" | ||
swSelWELDMENT | "WELDMENT" | ||
swSelSUBWELDFOLDER | "SUBWELDMENT" | ||
swSelEXCLUDEMANIPULATORS | |||
swSelREVISIONTABLE | "REVISIONTABLE" | ||
swSelSUBSKETCHINST | "SUBSKETCHINST" | ISketchBlockInstance | |
swSelWELDMENTTABLEFEATS | "WELDMENTTABLE" | IWeldmentCutListFeature | |
swSelBODYFOLDER | "BDYFOLDER" | IBodyFolder | |
swSelREVISIONTABLEFEAT | "REVISIONTABLEFEAT" | ||
swSelSUBATOMFOLDER | |||
swSelWELDBEADS3 | "WELDBEADS" | ||
swSelEMBEDLINKDOC | "EMBEDLINKDOC" | ||
swSelJOURNAL | "JOURNAL" | ||
swSelDOCSFOLDER | "DOCSFOLDER" | ||
swSelCOMMENTSFOLDER | "COMMENTSFOLDER" | ICommentFolder | |
swSelCOMMENT | "COMMENT" | IComment | |
swSelCAMERAS | "CAMERAS" | Feature1 | ICamera |
swSelMATESUPPLEMENT | "MATESUPPLEMENT" | IMateLoadReference | |
swSelANNOTATIONVIEW | "ANNVIEW" | ||
swSelGENERALTABLEFEAT | "GENERALTABLEFEAT" | ||
swSelSUBSKETCHDEF | "SUBSKETCHDEF" | ISketchBlockDefinition | |
swSelDISPLAYSTATE | "VISUALSTATE" | ||
swSelTITLEBLOCK | "TITLEBLOCK" | ITitleBlock | |
swSelEVERYTHING | "EVERYTHING" | ||
swSelLOCATIONS | "LOCATIONS" | ||
swSelUNSUPPORTED | "UNSUPPORTED" | ||
swSelSWIFTANNOTATIONS | "SWIFTANN" | Feature1 | IDimXpertAnnotation |
swSelSWIFTFEATURES | "SWIFTFEATURE" | Feature1 | IDimXpertFeature |
swSelSWIFTSCHEMA | "SWIFTSCHEMA" | IDimXpertManager | |
swSelTITLEBLOCKTABLEFEAT | "TITLEBLOCKTABLEFEAT" | ITitleBlockTableFeature | |
swSelOBJGROUP | "OBJGROUP" | ||
swSelCOSMETICWELDS | "COSMETICWELDS" | ||
swSelMAGNETICLINES | "MAGNETICLINES" | ||
swSelSELECTIONSETFOLDER | "SELECTIONSETFOLDER" | ISelectionSetFolder | |
swSelSELECTIONSETNODE | "SUBSELECTIONSETNODE" | ||
swSelPUNCHTABLEFEATS | "PUNCHTABLE" | IPunchTable | |
swSelHOLESERIES | "HOLESERIES" |
1 Use Feature::GetSpecificFeature2 to get the interface shown in the fourth column.
2 Use QueryInterface to get the interface shown in the fourth column.
3 Use swSelWELDBEADS to select caterpillar or end-treatment weld beads in drawings. To select fillet bead features, use "BODYFEATURE" with IModelDocExtension::SelectByID2.
4 Feature or CThread depending on whether you select the cosmetic thread feature in a part or assembly or you select the cosmetic thread annotation in a drawing.
这篇关于C# Solidworks二次开发:枚举应用实战(第六讲)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!