Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am currently working on a Ilogic rule to find easily undefined sketches, to check a part. I have already the code as shown below. Which makes undefined sketches visible and shows the names of those sketches in a message box. But to find these sketches you still have to search trough your features. Anybody know how to get the name of the feature where a sketch is used in?
My goal is that the messagebox say "1 undefined sketch. Sketch 3 used in extrude 5"
Anyone with suggestions?
Thanks a lot
Dim oDoc As PartDocument oDoc = ThisDoc.Document Dim counter As Integer = 0 Dim oSketch As PlanarSketch Dim ListSketch As New ArrayList Dim oText As String For Each oSketch In oDoc.ComponentDefinition.Sketches If oSketch.ConstraintStatus <> 51713 Then oSketch.Visible = True counter += 1 Dim oSketchName As String = oSketch.Name ListSketch.Add(oSketch.Name) Else oSketch.Visible = False End If Next For i As Integer = 0 To ListSketch.Count - 1 If i = 0 Then oText = ListSketch(i) Else oText = oText & vbLf & ListSketch(i) End If Next If counter = 0 Then MessageBox.Show("Good job, no undefined sketches!", "No undefined sketches",MessageBoxButtons.OK) Else MessageBox.Show("There are " & counter & " undefined sketches." & vbLf & vbLf & "The following sketches are undefined" & vbLf & oText, counter &"Undefined sketches",MessageBoxButtons.OK) End If
Solved! Go to Solution.