Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Ralf_Krieg
in reply to: Alex.Shechter

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