Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide a Hole Sketch

Status
Not open for further replies.

jzecha

Aerospace
Jan 20, 2016
235
US
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:
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

 
Replies continue below

Recommended for you

hide/show is on selections...
so, define a selection, add the sketch, do visproperties...

regards,
LWolf
 
Hi ,
Try to use selection :
osel.Clear
osel.Add oHole.Sketch
osel.VisProperties.SetShow catVisPropertyNoShowAttr

Regards ,
Tudor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top