91精品国产高清一区二区三区蜜臀,无码肛交在线,18禁自拍网站,日韩V亚洲

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

SOLIDWORKS焊件切割清單怎么生成

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


SolidWorks焊件切割清單1.jpeg


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

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


宏代碼:

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焊件三維圖,編輯切割清單,默認是這種情況,會生成“材料”和“數(shù)量”2個屬性

2、點擊工具-宏-新建

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

4、然后我們會發(fā)現(xiàn),之前的切割清單多了兩項單重和總重

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

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

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




免責聲明:

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




相關資訊


如何卸載SOLIDWORKS軟件?

SOLIDWORKS工程圖模板制作

SOLIDWORKS焊件使用教程

SOLIDWORKS有限元分析怎么做?