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

大家好,今天继续介绍我们的枚举应用系列。

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

(1)第一个为swsUserPreferenceIntegerValue_e,这个枚举的含义为用户偏好整数值,下面是官方的具体枚举值:

MemberDescription
swsColorChartColorOptionBaseChartColorNumber23 = Get or set the number of colors in the color chart; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color Options > No of chart colors
swsColorChartColorOptionChartColorNumber22 = Get or set the user-defined number of colors in the color chart; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color Options > User defined
swsColorChartColorOptionLegendType24 = Get or set the color legend type as defined in swsColorChartOptionLegendTypeValue_e; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color Options > (Default, Rainbow, Gray scale, User Defined)
swsColorChartColorOptionvonMisesColorValue27 = Get or set the color for values above yield for vonMises plots; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color Options > Specify color for values above yield for vonMises plot
swsColorChartNumberFormatLegendPrecision25 = Get or set the number of decimal places for precision of number formats; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Number format > No. of decimal places:
swsColorChartNumberFormatOption21 = Get or set the number format as defined in swsColorChartNumberFormatOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Number format > (Scientific, Floating, or General)
swsColorChartNumberFormatUseDiffNoFormatOption26 = Get or set which notation other than scientific to use for small numbers as defined in swsColorNumberFormatUseDiffNumberFormatOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Number format > Scientific > Use different number format for small numbers (0.001 < |x| < 1000) > (Floating or General)
swsColorChartPosition3 = Get or set the position of the color bar as defined in swsColorChartPositionValue_e; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Position > (Predefined positions or user defined)
swsColorChartPositionUserDefinedXValue18 = Get or set the color bar's horizontal distance from the left of the graphics area as a percentage of the width of the window; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Position > User defined > Horizontal from left:
swsColorChartPositionUserDefinedYValue19 = Get or set the color bar's vertical distance from the top of the graphics area as a percentage of the height of the window; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Position > User defined > Vertical from top:
swsColorChartWidthOption20 = Get or set the color chart width as defined in swsColorChartWidthOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Width
swsDefaultResultFolder1 = Get or set the results folder option as defined in swsResultFolderValue_e; corresponds to Simulation > Options > Default Options > Results > Results folder > (SOLIDWORKS document folder or User defined)
swsDefaultSolverValue0 = Get or set the default solver as defined in swsSolverType_e; corresponds to Simulation > Options > Default Options > Results > Default Solver > (Automatic, Direct sparse, or FFEPlus) 
swsEMailType30
swsPlotBoundaryOptionMeshColor9 = Get or set the mesh color for boundaries (see Remarks); corresponds to Simulation > Options > Default Options > Plot > Settings options > Boundary options > Mesh > color select box
swsPlotBoundaryOptionModelColor29 = Get or set the model color for boundaries (see Remarks); corresponds to Simulation > Options > Default Options > Plot > Settings options > Boundary options > Model
swsPlotBoundaryOptionTranslucentSingleColorSetting8 = Get or set the translucent color for boundaries (see Remarks); corresponds to Simulation > Options > Default Options > Plot > Settings options > Boundary options > Translucent (Single color) > color select box
swsPlotDeformedShapeOptionSetSuperImposeOption16 = Get or set the translucent color option for superimposing the model on deformed shape as defined in swsPlotDeformedShapeOptionSuperImposeValue_e; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on deformed shape > Superimpose model on deformed shape > Translucent (part colors or single color)
swsPlotDeformedShapeOptionSetting12 = Get or set how to show deformed shape results as defined in swsPlotDeformedShapeOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on undeformed shape or Show results on deformed shape
swsPlotDeformedShapeOptionTranslucentColor28 = Get or set the translucent color for superimposing the model on deformed shape (see Remarks);  corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on deformed shape > Superimpose model on deformed shape > Translucent (single color) > color select box
swsPlotDeformedShapeResultOther15 = Get or set the deformation scale factor for all other studies as defined in swsPlotDeformedShapeOptionScaleFactorOtherValue_e; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on deformed shape > Deformation scale factor for: > all other studies: > Automatic or True(1.0)
swsPlotDeformedShapeResultScaleContact13 = Get or set the deformation scale factor for all studies with "No penetration" contact as defined in swsPlotDeformedShapeOptionScaleFactorContactValue_e; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on deformed shape > Deformation scale factor for: > all studies with "No penetration" contact: > Automatic or True(1.0)
swsPlotDeformedShapeResultScaleLarge14 = Get or set the deformation scale factor for studies with the "Large displacement" option as defined in swsPlotDeformedShapeOptionScaleFactorLargeDispValue_e; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show results on deformed shape > Deformation scale factor for: > studies with the "Large displacement" option: > Automatic or True(1.0)
swsPlotSettingsBoundaryOption5 = Get or set the boundary option as defined in swsPlotBoundarySettingsOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Settings options > Boundary options
swsPlotSettingsFringeOption4 = Get or set the fringe option as defined in swsPlotFringeSettingsOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Settings options > Fringe options
swsPlotShowExcludedBodiesOption6 = Get or set the translucent color option for excluded bodies as defined in swsPlotShowExcludedBodiesOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Settings options > Show excluded bodies > Translucent (Single color or Part colors)
swsPlotShowExcludedBodyTranslucentSingleColor10 = Get or set the translucent color for all excluded bodies (see Remarks);  corresponds to Simulation > Options > Default Options > Plot > Settings options > Show excluded bodies > Translucent (Single color) > color select box
swsPlotShowHiddenBodiesOption7 = Get or set the translucent color option for hidden bodies as defined in swsPlotShowHiddenBodiesOptionValue_e; corresponds to Simulation > Options > Default Options > Plot > Settings options > Show hidden bodies > Translucent (Single color or Part colors)
swsPlotShowHiddenBodyTranslucentSingleColor11 = Get or set the translucent color for all hidden bodies (see Remarks); corresponds to Simulation > Options > Default Options > Plot > Settings options > Show hidden bodies > Translucent (Single color) > color select box
swsReportPublishOption2 = Get or set the report folder location as defined in swsReportFolderValue_e; corresponds to Simulation > Options > Default Options > Report > Report publish options > Report folder
swsReportPublishOptionReportFolderUserDefinedPath17

(2)第二个为swsUserPreferenceToggle_e,这个枚举的含义为用户首选项切换值,下面是官方的具体枚举值:

MemberDescription
swsAverageStressesAtMidnodes17 = Get or set whether to average stresses at mid-nodes; corresponds to Simulation > Options > Default Options > Results > Average stresses at mid-nodes (high-quality solid mesh only)
swsColorChartColorNoOfChartColorFlip13 = Get or set whether to flip the chart colors; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color options > Flip
swsColorChartColorSpecifyColorForvonMisesPlot14 = Get or set whether to specify color for values above yield for vonMises plot; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Color options > Specify color for values above yield for vonMises plot
swsColorChartDetails11 = Get or set whether to display plot details; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Display plot details 
swsColorChartDisplay10 = Get or set whether to display plot details; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Display color charts 
swsColorChartNumberFormatUseDifferentNumberFormat12 = Get or set whether to use a different number format for small numbers; corresponds to Simulation > Options > Default Options > Plot > Color Chart > Number format > Scientific > Use different number format for small numbers (0.001 < |x| < 1000)
swsEMailAuthentication16 = Get or set whether my server requires authentication; corresponds to Simulation > Options > System Options > Email Notification Settings > My server requires authentication
swsLoadAllStudies_e15 = Get or set whether to load all Simulation studies when opening a model; corresponds to Simulation > Options > System Options > General > Load all Simulation studies when opening a model. (requires more time to open a model)
swsPlotAnnotationShowMaxValue5 = Get or set whether to show the maximum value annotation in plots; corresponds to Simulation > Options > Default Options > Plot > Annotation and range > Show maximum value annotation
swsPlotAnnotationShowMinValue4 = Get or set whether to show the minimum value annotation in plots; corresponds to Simulation > Options > Default Options > Plot > Annotation and range > Show minimum value annotation
swsPlotAnnotationShowRangeBasedOnShowCompOnly6 = Get or set whether to show range based on shown components only in plots; corresponds to Simulation > Options > Default Options > Plot > Annotation and range > Show range based on shown components only
swsPlotDeformedShapeOptionSuperImposeModelOnDeformedShape9 = Get or set whether to superimpose model on deformed shape in plots; corresponds to Simulation > Options > Default Options > Plot > Deformed shape options > Show rsults on deformed shape > Superimpose model on deformed shape
swsPlotShowExcludedBodies7 = Get or set whether to show excluded bodies in plots; corresponds to Simulation > Options > Default Options > Plot > Settings options > Show excluded bodies
swsPlotShowHiddenBodies8 = Get or set whether to show hidden bodies in plots; corresponds to Simulation > Options > Default Options > Plot > Settings options > Show hidden bodies
swsResultFolderKeepTempDataBase1 = Get or set whether to keep temporary database files in results folder; corresponds to Simulation > Options > Default Options > Results > Results folder > Keep temporary database files
swsResultFolderUnderSubFolder0 = Get or set whether to set results folder under a SOLIDWORKS document folder sub folder; corresponds to Simulation > Options > Default Options > Results > Results folder > SOLIDWORKS document folder > Under sub folder
swsShowReportOnPublish3 = Get or set whether to show the report when it's published; corresponds to Simulation > Options > Default Options > Report > Report publish options > Show report on publish
swsTrendTrackerBackUpModelsRestoreIteration2 = Get or set whether to back up models for Restore to Iteration; corresponds to Simulation > Options > Default Options > Results > Trend Tracker > Backup models for Restore to Iteration

(3)第三个为swsWindowsBasicColors_e,这个枚举的含义为windows基本色,下面是官方的具体枚举值:

MemberDescription
swsAqua16776960
swsBlack0
swsBlue16711680
swsCoral4227327
swsCyan16777088
swsDarkBlue4194304
swsDarkGreen4210688
swsDarkOliveGreen16384
swsDarkPurple4194368
swsDarkRed4194432
swsDeepGray64
swsDeepSkyBlue12645680
swsDodgerBlue16744448
swsGray8421504
swsGreen32768
swsGreenYellow65408
swsIndigo8388672
swsKhaki4227200
swsLawnGreen4259584
swsLightRed8421631
swsLightSalmon4210816
swsLightSeaGreen8421440
swsLightYellow8454143
swsLime65280
swsMagenta16711935
swsMaroon128
swsMediumPurple12615808
swsMidnightBlue10485760
swsNavy8388608
swsOlive32896
swsOrange33023
swsPaleGreen8454016
swsPlum12615935
swsPurple8388736
swsRed255
swsRoyalBlue8404992
swsSapGreen4227072
swsSgiBeet16711808
swsSgiSalmon8388863
swsSgiSlateBlue16744576
swsSilver12632256
swsSpringGreen8453888
swsTan16512
swsTeal8421376
swsViolet16744703
swsWhite16777215
swsYellow65535

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

  • 30
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
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二次开发的技术。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

喵桑さん

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

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

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

打赏作者

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

抵扣说明:

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

余额充值