Identify Fixed Relations
Identify Fixed Relations
(OP)
Is it possible to quickly identify if a sketch has been constrained properly with dimensions rather than defining with a fixed relation in order to make the sketch "fully defined".
im working with a large design tree and dont want to open each sketch in order to determine if it was constrained properly.
Is a Macro a possibilty?
im working with a large design tree and dont want to open each sketch in order to determine if it was constrained properly.
Is a Macro a possibilty?






RE: Identify Fixed Relations
Bradley
SolidWorks Premim 2007 x64 SP3.1
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400
RE: Identify Fixed Relations
I do not know of a way and I'm not sure that even API can do that ... but then I'm API illiterate.
RE: Identify Fixed Relations
RE: Identify Fixed Relations
CODE
Dim AllFeatures As Variant
Dim allRelations As Variant
Dim allChild As Variant
Dim i As Long
Dim j As Long
Dim mySketch As Sketch
Dim RelMgr As SketchRelationManager
Dim ResultString As String
Dim ChildNames As String
Dim FixedCount As Long
Sub main()
Set swApp = Application.SldWorks
ResultString = ""
AllFeatures = Empty
AllFeatures = swApp.ActiveDoc.FeatureManager.GetFeatures(False)
For i = 0 To UBound(AllFeatures)
If AllFeatures(i).GetTypeName = "ProfileFeature" Then
Set mySketch = AllFeatures(i).GetSpecificFeature
If Not (mySketch Is Nothing) Then
Set RelMgr = mySketch.RelationManager
allRelations = Empty
allChild = Empty
allRelations = RelMgr.GetRelations(swAll)
allChild = mySketch.GetChildren
FixedCount = 0
For j = 0 To UBound(allRelations)
If allRelations(j).GetRelationType = swConstraintType_FIXED Then
FixedCount = FixedCount + 1
End If
Next j
ChildNames = " ("
For j = 0 To UBound(allChild)
ChildNames = ChildNames & allChild(j).Name & ", "
Next j
ChildNames = Left(ChildNames, Len(ChildNames) - 2) & ")"
If FixedCount > 0 Then
ResultString = ResultString & vbCrLf & FixedCount & " -" & mySketch.Name & ChildNames
End If
End If
End If
Next i
MsgBox "Quantity of ""Fixed"" relations" & vbCrLf & "per sketch in this model:" & vbCrLf & ResultString
End Sub
RE: Identify Fixed Relations
RE: Identify Fixed Relations
RE: Identify Fixed Relations
Thanks for the vote of confidence, but I'm just a hack with an ever-growing library. handleman is the pro coder here that comes up with this stuff from scratch all the time. [smiley]
mails,
I'm curious as to why you are wanting to check sketches with fixed vs. dim'd constraints?
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: Identify Fixed Relations
RE: Identify Fixed Relations
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Identify Fixed Relations
RE: Identify Fixed Relations
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: Identify Fixed Relations
A macro is definitely possible. An addin could be more useful for constant monitoring.
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Identify Fixed Relations
Windows XP / Microsoft Wireless Optical Mouse 5000 / SolidWorks 2007 SP2.2 / SpaceBall 5000
www.Tate3d.com "Right-click. It's friggin' magic!"... Jack L. Tate
FAQ376 I'm famous.
RE: Identify Fixed Relations
Windows XP / Microsoft Wireless Optical Mouse 5000 / SolidWorks 2007 SP2.2 / SpaceBall 5000
www.Tate3d.com "Right-click. It's friggin' magic!"... Jack L. Tate
FAQ376 I'm famous.
RE: Identify Fixed Relations
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: Identify Fixed Relations
RE: Identify Fixed Relations
RFUS
RE: Identify Fixed Relations
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: Identify Fixed Relations
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group