04-12-2021
02:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-12-2021
02:24 AM
Hello
By counting the profiles used for create this extrusion.
Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oUserParams As UserParameters = oDoc.ComponentDefinition.Parameters.UserParameters
Dim iCount As Integer
Dim sCount As String
' If a feature is Active (not suppressed), it is added the FeatureList array
For Each oExtrusion As ExtrudeFeature In oDoc.ComponentDefinition.Features.ExtrudeFeatures
If oExtrusion.Name.StartsWith("SL") Then
If Feature.IsActive(oExtrusion.Name) Then
sCount = Mid(oExtrusion.Name, 3)
If sCount.Length = 1 Then
sCount = "0" & sCount
End If
MsgBox("Number_of_Slots_" & sCount & ": " & oExtrusion.Definition.Profile.Count)
Try
Parameter("Number_of_Slots_" & sCount)= oExtrusion.Definition.Profile.Count
Catch
oUserParams.AddByExpression ("Number_of_Slots_" & sCount, oExtrusion.Definition.Profile.Count, UnitsTypeEnum.kUnitlessUnits)
End Try
End If
End If
Next
R. Krieg
RKW Solutions
www.rkw-solutions.com