Hello everyone, I'm new and I have been trying to change an extrude value using iLogic, but I'm encountering a problem.
The idea is that if the value I enter goes over 3050 mm (the max length the store sells), then iLogic should just bring it back down to 3050 mm and give me a heads-up.
Once I enter an extrude value, the rule runs and displays the correct number. However, when the extrusion is performed, the program adds a zero at the end of the number. For example, if I enter 5050, the rule shows that it has been changed to 3030, but the extrusion ends up being 30500, if I enter 250, it displays 250, but the extrusion becomes 2500.
I have no idea what I am doing wrong.
Sub Main()
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oExtrusion As ExtrudeFeature = oPartDoc.ComponentDefinition.Features.ExtrudeFeatures.Item(1)
Dim NewLength As Double = Length
If NewLength > 3050 Then
MessageBox.Show("Como vas a poner un perfil de " & NewLength.ToString()& " don retrasao", "OE AWEONAO")
NewLength = 3050
End If
oExtrusion.SetDistanceExtent(DirectCast(NewLength, System.ValueType), PartFeatureExtentDirectionEnum.kSymmetricExtentDirection)
oPartDoc.Update()
MessageBox.Show("Ya le cambiamos el perfil a " & NewLength & " mm.", "ome pendejo", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Thank you very much for your help, I appreciate it.
Solved! Go to Solution.
Solved by A.Acheson. Go to Solution.
Hi @yomarposada
Any number entered in the code will be automatically in system units which is cm. If you want 250mm then perform the conversion yourself by entering 25 or you can also give a string value such as "250 mm".
Can't find what you're looking for? Ask the community or share your knowledge.