Message 1 of 3
Create a simple hole with a specific depth

Not applicable
06-22-2018
10:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I ‘m trying to create a simple hole by adding the depth, and it throws the next exception.
$exception {"El parámetro no es correcto. (Excepción de HRESULT: 0x80070057 (E_INVALIDARG))"} System.ArgumentException}
Does anyone know what the error is in the parameter?
hole2 = oComDef.Features.HoleFeatures.AddDrilledByDistanceExtent(oHoleCenters2, "8 mm", "10 mm", PartFeatureExtentDirectionEnum.kNegativeExtentDirection, True, "118 deg")
Public Sub createSimpleHole() Dim hole2 As HoleFeature Dim oPoint, oPoint2 As Point2d oPoint = oTransGeom.CreatePoint2d(1, 1) oPoint2 = oTransGeom.CreatePoint2d(1, 1) Dim point, point2 As SketchPoint point = oSketch.SketchPoints.Add(oPoint, True) point2 = oSketch.SketchPoints.Add(oPoint2, True) point.HoleCenter = True point2.HoleCenter = True Dim offset, o2 As TwoPointDistanceDimConstraint offset = oSketch.DimensionConstraints.AddTwoPointDistance(lineWidth.StartSketchPoint, point, DimensionOrientationEnum.kVerticalDim, oTransGeom.CreatePoint2d(2, 2), False) o2 = oSketch.DimensionConstraints.AddTwoPointDistance(lineHight.StartSketchPoint, point, DimensionOrientationEnum.kHorizontalDim, oTransGeom.CreatePoint2d(-2, 0), False) offset.Parameter.Value = (offsetWidth / 10) o2.Parameter.Value = Math.Abs(15 / 10) Dim d1, d2, d3, d4 As TwoPointDistanceDimConstraint d1 = oSketch.DimensionConstraints.AddTwoPointDistance(lineWidth.StartSketchPoint, point2, DimensionOrientationEnum.kVerticalDim, oTransGeom.CreatePoint2d(2, 2), False) d2 = oSketch.DimensionConstraints.AddTwoPointDistance(lineHight.StartSketchPoint, point2, DimensionOrientationEnum.kHorizontalDim, oTransGeom.CreatePoint2d(-2, 0), False) d1.Parameter.Value = (offsetWidth / 10) d2.Parameter.Value = Math.Abs(30 / 10) oSketch.ExitEdit() Dim oHoleCenters2 As ObjectCollection oHoleCenters2 = m_invApp.TransientObjects.CreateObjectCollection oHoleCenters2.Add(point) oHoleCenters2.Add(point2) hole2 = oComDef.Features.HoleFeatures.AddDrilledByDistanceExtent(oHoleCenters2, "8 mm", "10 mm", PartFeatureExtentDirectionEnum.kNegativeExtentDirection, True, "118 deg") End Sub
program goal
program goal