Message 1 of 4
HoleFeatures
Not applicable
04-05-2005
01:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having a difficult time trying to add a Thru Hole to an extruded part.
I must add the hole After the part is extruded.
The part is very basic, just a rectangle extruded to a thickness of 1/2"
Here is the Sample Code:
Dim oInventorApp As Object
Set oInventorApp = GetObject(, "Inventor.Application")
Dim oPartCompDef As PartComponentDefinition
Set oPartCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oSketch As PlanarSketch
Set oSketch = oPartCompDef.Sketches.Item(1)
Dim oCenterPoints As ObjectCollection
Set oCenterPoints = oInventorApp.TransientObjects.CreateObjectCollection
oCenterPoints.Add oSketch.SketchPoints.Add(oInventorApp.TransientGeometry.CreatePoint2d(1, 1))
Dim oNewHole As HoleFeature
Set oNewHole = oPartCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oCenterPoints, 2, kPositiveExtentDirection)
VB gives me a "Type Mismatch" error when I Add the new hole definition to variable: oNewHole.
In the VB debugger, the AddDrilledByThroughAllExtent() is shown as having a Data Type of "Integer"
Any help would be greatly appreciated.
Brian
I must add the hole After the part is extruded.
The part is very basic, just a rectangle extruded to a thickness of 1/2"
Here is the Sample Code:
Dim oInventorApp As Object
Set oInventorApp = GetObject(, "Inventor.Application")
Dim oPartCompDef As PartComponentDefinition
Set oPartCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oSketch As PlanarSketch
Set oSketch = oPartCompDef.Sketches.Item(1)
Dim oCenterPoints As ObjectCollection
Set oCenterPoints = oInventorApp.TransientObjects.CreateObjectCollection
oCenterPoints.Add oSketch.SketchPoints.Add(oInventorApp.TransientGeometry.CreatePoint2d(1, 1))
Dim oNewHole As HoleFeature
Set oNewHole = oPartCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oCenterPoints, 2, kPositiveExtentDirection)
VB gives me a "Type Mismatch" error when I Add the new hole definition to variable: oNewHole.
In the VB debugger, the AddDrilledByThroughAllExtent() is shown as having a Data Type of "Integer"
Any help would be greatly appreciated.
Brian