I have the code below that creates holes normal to a surface.
It does exactly what i want, but i would like it to hide the hole sketch once it is created.
I tried a few approaches and nothing works, can someone give me some pointers on the right code to use?
This is the code that currently does not work:
Here is the full Hole Code:
It does exactly what i want, but i would like it to hide the hole sketch once it is created.
I tried a few approaches and nothing works, can someone give me some pointers on the right code to use?
This is the code that currently does not work:
Code:
'Hide Hole Sketch
Set VisPropertySet2 = oHole.Sketch.VisProperties
VisPropertySet2.SetShow 0
Here is the full Hole Code:
Code:
'Create Hole
oPart.InWorkObject = oPart.Bodies.Item(PartBodyName)
Dim SF1 As ShapeFactory
Set SF1 = oPart.ShapeFactory
Dim oHole As Hole
Set oHole = SF1.AddNewHoleFromPoint(coord(0), coord(1), coord(2), reference4, hDepthIN)
oHole.Type = catSimpleHole
oHole.AnchorMode = catExtremPointHoleAnchor
Dim oHoleLimit As Limit
Set oHoleLimit = oHole.BottomLimit
'Setting Up Blind vs Through Hole
Select Case index1
Case Is = "Blind"
oHoleLimit.LimitMode = catOffsetLimit
Case Is = "Through All"
oHoleLimit.LimitMode = catUpToLastLimit
End Select
Dim oHoleLength As Length
Set oHoleLength = oHole.Diameter
oHoleLength.Value = hDiameterIN
'oHole.BottomType = catVHoleBottom
Dim oHoleAngle As Angle
'Setting Bottom of Hole Style
Select Case index2
Case Is = "V-Bottom"
oHole.BottomType = catVHoleBottom
Set oHoleAngle = oHole.BottomAngle
oHoleAngle.Value = hAngleIN
'Call MsgBox("V-Bottom")
Case Is = "Flat"
oHole.BottomType = catFlatHoleBottom
oPart.UpdateObject oHole
'Call MsgBox("Flat")
End Select
oHole.SetDirection reference1
oHole.ThreadingMode = catSmoothHoleThreading
oHole.ThreadSide = catRightThreadSide
'Hide Hole Sketch
Set VisPropertySet2 = oHole.Sketch.VisProperties
VisPropertySet2.SetShow 0
'Dim oPosSketch As Sketch
'Set oPosSketch = oHole.Sketch
oPart.UpdateObject oHole
'If ReverseStatus = 1 Then
'hole1.Reverse
'Else
'End If