Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have developed a rule to place centerlines on slotted holes on the drawing sheet.
It works by selecting the curves of a single slot, (so i window over the slot and get 2 arcs and 2 lines)
then run the rule. The rule then adds a bisector between the pair of arcs and and another between the pair of lines.
This works well, but I would like improve the process by adding a loop where i can continuously window select slot curves and it will add the bisector in between selection events.
Could someone please help with the loop and the window selection code?
I am using INV Pro 2024
here is my code :
Dim oDoc As DrawingDocument = ThisDrawing.Document
Dim osheet As Sheet = oDoc.ActiveSheet
Dim oSSet As SelectSet = oDoc.SelectSet
Dim oArcsCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Dim oLineCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
If oSSet.Count = 0 Then
MessageBox.Show("You no pick stuff first", "Crap", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
For Each obj As DrawingCurveSegment In oSSet
If obj.GeometryType = 5253 Then
oArcsCol.Add(osheet.CreateGeometryIntent(obj.Parent))
Else
oLineCol.Add(osheet.CreateGeometryIntent(obj.Parent))
End If
Next
End If
osheet.Centerlines.AddBisector(oArcsCol.Item(1),oArcsCol.Item(2))
osheet.Centerlines.AddBisector(oLineCol.Item(1),oLineCol.Item(2))
Solved! Go to Solution.