Hmmm i dont find a way to get the lenght of a chamfer (selected edge) over the API.
Anyone has a idea ??
Solved! Go to Solution.
Solved by JhoelForshav. Go to Solution.
try this iLogic code:
Dim f As PartFeature = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFeatureFilter, "Select champfer") If (TypeOf f Is CornerChamferFeature) Then ' for sheetmetal parts MsgBox(f.Definition.ChamferDefinition.Distance.Value * 10) Else If (TypeOf f Is ChamferFeature) Then ' for parts MsgBox(f.Definition.Distance.Value * 10) Else MsgBox("None champfer selected") End If
this does not work if the champfer option 2 distaces is chosen. in that case you could use:
and calculate the distance your self.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Hi,
I think what @frank_schalla is looking for is the length of the chamfered edge, Not the length parameter of the chamfer feature...
If so, maybe something like this should do the trick?
Sub Main Dim oDoc As PartDocument = ThisDoc.Document Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition Dim oChamfs As ChamferFeatures = oDef.Features.ChamferFeatures Dim oChamf As ChamferFeature = oChamfs.Item(1) oChamf.SetEndOfPart(True) Dim totLength As Double = 0 For Each oEdge As Edge In oChamf.Definition.ChamferedEdges totLength += EdgeLength(oEdge) Next oChamf.SetEndOfPart(False) MsgBox(totLength) End Sub Function EdgeLength(ByRef oEdge As Edge) As Double Dim curveEval As CurveEvaluator curveEval = oEdge.Evaluator Dim minParam As Double Dim maxParam As Double Call curveEval.GetParamExtents(minParam, maxParam) Dim curveLength As Double Call curveEval.GetLengthAtParam(minParam, maxParam, curveLength) EdgeLength = curveLength * 10 End Function
For this example i simply took the chamferfeature item 1 in the model. But you can of course use it on a selected chamfer feature as well 🙂
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
Hello Jhoel Forshav
thank's you both and yes you are right.
The chamfer values was easy but based on you idea also the edges now we can grab
Thank You 🙂
Can't find what you're looking for? Ask the community or share your knowledge.