Message 1 of 4

Not applicable
11-25-2017
12:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I tried to create a hole with the hole feature on a workpoint. I was able to project the workpoint on a sketch and use this sketch to drill the hole. But this way the projected point is not automatically refreshed when workpoint changed. That is why I tried to generate the hole directly by the workpoint like this so far:
Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument Dim oDef As ComponentDefinition Set oDef = oDoc.ComponentDefinition ' Create an object collection for the hole center points. Dim oHoleCenters As ObjectCollection Set oHoleCenters = ThisApplication.TransientObjects.CreateObjectCollection oHoleCenters.Add oDef.WorkPoints.Item("COG") Dim oCenterPlacementDef As PointHolePlacementDefinition Set oCenterPlacementDef = oDef.Features.HoleFeatures.CreatePointPlacementDefinition(oHoleCenters, oDef.WorkAxis.Item(1)) Call oDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oCenterPlacementDef, "1 cm", kPositiveExtentDirection)
An error occured in line:
Set oCenterPlacementDef = oDef.Features.HoleFeatures.CreatePointPlacementDefinition(oHoleCenters, oDef.WorkAxis.Item(1))
Can anyone tell me how to set up the holefeature on a workpoint/point correctly?
Thanks in advance.
Lars
Solved! Go to Solution.