国产乱国产乱,国产白嫩美女在线,日美韩一级片,啪啪电影院

當前位置:首頁 > 熱點新聞> 新技熱點

SOLIDWORKS焊件切割清單怎么生成

相信很多SOLIDWORKS設計師都會遇到這樣一個問題,就是SolidWorks工程圖出圖的時候,我們的SolidWorks焊件切割清單的總重,是沒法設置調用的,不能通過單重x數量實現,但是我們的SOLIDWORKS裝配體的材料明細表可以。那么如何實現SolidWorks焊件切割清單的總重呢?今天給大家整理分享一份網絡比較認可的方法,大家可以親自實踐。


SolidWorks焊件切割清單1.jpeg


SolidWorks焊件切割清單總重設置方法

SolidWorks焊件切割清單生成單重和總重的原理呢就是利用“宏”命令來實現,下面就給大家分享這個宏以及使用方法。


宏代碼:

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim thisFeat As SldWorks.Feature
Dim thisSubFeat As SldWorks.Feature
Dim cutFolder As Object
Dim BodyCount As Integer
Dim fn As String
Dim pn As String
Dim custPropMgr As SldWorks.CustomPropertyManager
Dim propNames As Variant
Dim vName As Variant
Dim propName As String
Dim Value As String
Dim resolvedValue As String
Dim TotalW As Double
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set thisFeat = Part.FirstFeature
Do While Not thisFeat Is Nothing
   If thisFeat.GetTypeName = "SolidBodyFolder" Then
       thisFeat.GetSpecificFeature2.UpdateCutList
   End If
   Set thisSubFeat = thisFeat.GetFirstSubFeature
   Do While Not thisSubFeat Is Nothing
       If thisSubFeat.GetTypeName = "CutListFolder" Then
           Set cutFolder = thisSubFeat.GetSpecificFeature2
       End If
       If Not cutFolder Is Nothing Then
           BodyCount = cutFolder.GetBodyCount
           If BodyCount > 0 Then
               Set custPropMgr = thisSubFeat.CustomPropertyManager
               If Not custPropMgr Is Nothing Then
                   custPropMgr.Delete "Total Weight"
                   custPropMgr.Delete "Weight"
                   fn = thisSubFeat.Name
                   pn = Part.GetTitle
                   custPropMgr.Add "Weight", "文字", Chr(34) & "SW-Mass@@@" & fn & "@" & pn & Chr(34)
                   propNames = custPropMgr.GetNames
                   If Not IsEmpty(propNames) Then
                       For Each vName In propNames
                           propName = vName
                           custPropMgr.Get2 propName, Value, resolvedValue
                           If propName = "
Weight" Then TotalW = resolvedValue
                       Next vName
                   End If
                   custPropMgr.Add "Total Weight", "文字", Format(BodyCount * TotalW, "0.00")
               End If
           End If
       End If
       Set thisSubFeat = thisSubFeat.GetNextSubFeature
   Loop
   Set thisFeat = thisFeat.GetNextFeature
Loop
End Sub


1、打開SolidWorks焊件三維圖,編輯切割清單,默認是這種情況,會生成“材料”和“數量”2個屬性

2、點擊工具-宏-新建

3、將上面的宏代碼復制進來,運行宏后添加單重和總重屬性

4、然后我們會發現,之前的切割清單多了兩項單重和總重

5、下面在SolidWorks工程圖切割清單里面調用單重和總重

注:英文標題,在切割清單上雙擊可以修改為單重和總重漢字。

以上就是SolidWorks切割清單總重利用宏命令的方法實現總重的調用,趕緊試一下吧!




免責聲明:

本文系網絡轉載,版權歸原作者所有。如涉及版權問題,請與微辰三維聯系,我們將及時協商版權問題或刪除內容。




相關資訊


如何卸載SOLIDWORKS軟件?

SOLIDWORKS工程圖模板制作

SOLIDWORKS焊件使用教程

SOLIDWORKS有限元分析怎么做?

                      国产乱国产乱 西宁市| 雷山县| 峨山| 乐昌市| 溆浦县| 盐山县| 高雄县| 荥阳市| 眉山市| 平谷区| 武平县| 津南区| 灵石县| 沂源县| 四会市| 贵德县| 兴仁县| 尉氏县| 海盐县| 永登县| 邻水| 通道| 湖南省| 宾阳县| 通海县| 临高县| 阿图什市| 肃南| 平顺县| 怀集县| 虎林市| 神池县| 龙川县| 洛扎县| 漯河市| 军事| 桐庐县| 麦盖提县| 白水县| 湟源县| 绥阳县| http://444 http://444 http://444