10-10-2021
12:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-10-2021
12:44 PM
Hello
In such a case it would be much more helpful to upload the ipt file. I think there are some dimensions missing (please see picture).
Anyway, when your parts are always a revolve, there could be an alternative way we can try.
Dim oApp As Inventor.Application=ThisApplication
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oUOM As UnitsOfMeasure = oPartDoc.UnitsOfMeasure
Dim oCompdef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oWorkSurface As WorkSurface = oCompdef.WorkSurfaces.Item(1)
Dim oSurfaceBody As SurfaceBody = oWorkSurface.SurfaceBodies.Item(1)
Dim oEdge As Edge = oSurfaceBody.Edges.Item(1)
Dim dLoopLength As Double=oApp.MeasureTools.GetLoopLength(oEdge)
Dim dRadius As Double = oUOM.ConvertUnits(dLoopLength / 2 / System.Math.PI,"cm",oUOM.LengthUnits)
Dim oParam As UserParameter
Try
oCompdef.Parameters.UserParameters.Item("diam").Expression=dRadius & oUOM.LengthUnits
Catch
oCompdef.Parameters.UserParameters.AddByExpression("diam", dRadius, oUOM.LengthUnits )
End Try
R. Krieg
RKW Solutions
www.rkw-solutions.com