Create and pattern axis in a cut
Create and pattern axis in a cut
(OP)
Alright...something I did all the time in Pro/E, but for the life of me can't figure out how to do it in SW.
Problem: I have an assembly that utilizes carriage bolts. I used to create my square cuts and would pop an axis point in the middle of it. This way, when I assembled the bolts (which had an axis), it was a mate to surface and axis to axis mate. Ref Pattern the bolt, and boom...all the holes are filled with bolts.
With SolidWorks...I can't find a way to create an axis in a sketch. I can create an axis utilizing a sketched point, but the axis won't pattern.
So...how does one create a pattern-able axis in SW OR is there a preferred, simple SolidWorks way to assemble a cylindrical part into a square hole?
Problem: I have an assembly that utilizes carriage bolts. I used to create my square cuts and would pop an axis point in the middle of it. This way, when I assembled the bolts (which had an axis), it was a mate to surface and axis to axis mate. Ref Pattern the bolt, and boom...all the holes are filled with bolts.
With SolidWorks...I can't find a way to create an axis in a sketch. I can create an axis utilizing a sketched point, but the axis won't pattern.
So...how does one create a pattern-able axis in SW OR is there a preferred, simple SolidWorks way to assemble a cylindrical part into a square hole?






RE: Create and pattern axis in a cut
Stefan Hamminga
EngIT Solutions
CSWP/Mechanical designer/AI student
RE: Create and pattern axis in a cut
At the part level, I draw a line midpoint to midpoint of the square cut. I then put a point midpoint of that line. This way, if my square cut changes, the center point stays centered. I then mate the axis of the carriage bolt to that point. Finally I add a coincident mate between parts, and also a parallel mate to sides to lock it.
http://livedigital.com/content/478611/
Flores
SW06 SP4.1
RE: Create and pattern axis in a cut
And why would you need to pattern the axis to all holes? You just mate the bolt to the master hole, then use a Derived Component Pattern to populate the rest. Provided the holes in the part were created with a pattern feature.
Jason
UG NX2.02.2 on Win2000 SP3
SolidWorks 2006 SP4.0 on WinXP SP2
RE: Create and pattern axis in a cut
"my point, and I did have one . . ."
--
Hardie "Crashj" Johnson
SW 2005 SP 4.0 (reluctant to change)
Nvidia Quadro FX 1000
AMD Athalon 1.8 GHz 2 Gig RAM
RE: Create and pattern axis in a cut
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
RE: Create and pattern axis in a cut
RE: Create and pattern axis in a cut
Stefan Hamminga
EngIT Solutions
CSWP/Mechanical designer/AI student
RE: Create and pattern axis in a cut
Jason
UG NX2.02.2 on Win2000 SP3
SolidWorks 2006 SP4.0 on WinXP SP2
RE: Create and pattern axis in a cut
That only works if your holes are a pattern (linear, sketch driven, circular, etc). If your holes are all in one Hole Wizard feature (which you can use as a base feature for a component pattern) then they will all highlight with a double-click.
Something I've been meaning to do for a while is write a macro that will highlight the first hole of a hole wizard feature. I finally got up the gumption to do so.
This macro allows either pre- or post-selection of a hole wizard feature either in the feature tree or by one of its faces. It will select the first hole of that wizard feature. Any component mated with that hole can be patterned using the hole wizard feature as the pattern's base feature.
CODE
Dim swApp As SldWorks.SldWorks
Dim SelMgr As SldWorks.SelectionMgr
Dim swDoc As SldWorks.ModelDoc2
Dim SelType As SwConst.swSelectType_e
Dim sMsg As String
Dim i As Long
Dim fSelFeature As SldWorks.Feature
Dim myHwFeature As SldWorks.Feature
Dim FaceArray As Variant
Const MINSELECTIONS = 1
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set SelMgr = swDoc.SelectionManager
If SelMgr.GetSelectedObjectCount2(-1) > 1 Then
MsgBox "Please select one Wizard hole"
swDoc.ClearSelection2 True
End If
If SelMgr.GetSelectedObjectCount2(-1) < 1 Then
While SelMgr.GetSelectedObjectCount2(-1) < 1
DoEvents 'Wait
Wend
End If
If SelMgr.GetSelectedObjectType3(1, -1) = swSelBODYFEATURES Then
Set fSelFeature = SelMgr.GetSelectedObject6(1, -1)
ElseIf SelMgr.GetSelectedObjectType3(1, -1) = swSelFACES Then
Set fSelFeature = SelMgr.GetSelectedObject6(1, -1).GetFeature
Else
MsgBox "Select a hole wizard feature to use this function"
Exit Sub
End If
If fSelFeature.GetTypeName <> "HoleWzd" Then
MsgBox "Feature is not hole wizard"
Exit Sub
End If
FaceArray = fSelFeature.GetFaces
'select the first face in the array. It's probably the first hole.
FaceArray(0).Select False
End Sub
RE: Create and pattern axis in a cut
Also, is there any way to change the highlight colour to something more visible? I tested it on a thin plate with CSK holes and only the "drilled" hole portion was highlighted the usual dark green colour. Trouble is that portion was very thin and did not stand out very well.
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
RE: Create and pattern axis in a cut
All this macro does to highlight the face is select it. In order to change the color it would have to either change the actual face color or change your system setting for selection color. There are a couple of ways to help find that first hole. One would be to add the line
swDoc.ViewZoomToSelection
just before the End Sub. I think that's the right syntax. I won't be sitting in front of SW until next Wednesday. (Happy 4th everybody! Happier 4th to those in the US who are off work!
The other way to help the hole stand out would be to select the edges of that face along with the face itself, since edges highlight with a bolder line than faces. It would just be a few more lines of code to find all edges belonging to that face and add them to the selection set. I'll add that sometime next week unless someone beats me to it.
RE: Create and pattern axis in a cut
CODE
Dim swApp As SldWorks.SldWorks
Dim SelMgr As SldWorks.SelectionMgr
Dim swDoc As SldWorks.ModelDoc2
Dim SelType As SwConst.swSelectType_e
Dim sMsg As String
Dim i As Long
Dim fSelFeature As SldWorks.Feature
Dim myHwFeature As SldWorks.Feature
Dim FaceArray As Variant
Dim EdgeArray As Variant
Const MINSELECTIONS = 1
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set SelMgr = swDoc.SelectionManager
If SelMgr.GetSelectedObjectCount2(-1) > 1 Then
MsgBox "Please select one Wizard hole"
swDoc.ClearSelection2 True
End If
If SelMgr.GetSelectedObjectCount2(-1) < 1 Then
While SelMgr.GetSelectedObjectCount2(-1) < 1
DoEvents 'Wait
Wend
End If
If SelMgr.GetSelectedObjectType3(1, -1) = swSelBODYFEATURES Then
Set fSelFeature = SelMgr.GetSelectedObject6(1, -1)
ElseIf SelMgr.GetSelectedObjectType3(1, -1) = swSelFACES Then
Set fSelFeature = SelMgr.GetSelectedObject6(1, -1).GetFeature
Else
MsgBox "Select a hole wizard feature to use this function"
Exit Sub
End If
If fSelFeature.GetTypeName <> "HoleWzd" Then
MsgBox "Feature is not hole wizard"
Exit Sub
End If
FaceArray = fSelFeature.GetFaces
'select the first face in the array. It's probably the first hole.
FaceArray(0).Select False
EdgeArray = FaceArray(0).GetEdges
For i = 0 To UBound(EdgeArray)
EdgeArray(i).Select True
Next i
swDoc.ViewZoomToSelection
End Sub
RE: Create and pattern axis in a cut
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091