05-29-2020
12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-29-2020
12:32 AM
Hi @Anonymous
To get your rule to run, I'd recommend getting the sketch by its name:
Dim oDoc As Document = ThisDoc.Document Dim oSketch As PlanarSketch = oDoc.ComponentDefinition.Sketches.Item("sketch name") 'sketch name = Name of sketch Dim oColor As Color oColor = ThisApplication.TransientObjects.CreateColor(255, 255, 255) 'White Dim oLine As SketchLine = oSketch.SketchLines(2) oLine.OverrideColor = oColor oLine.LineWeight = 2 'Set Lineweight
Identifying a specific line is a bit difficult. You could use RefKeys like @Anonymous is doing here:
If you have the sketch visible though, maybe it's enough to just have the user pick the line like this?
'Get the sketchLine Dim oLine As SketchLine = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchCurveLinearFilter, "Pick the sketchline") 'Set the color oLine.OverrideColor = ThisApplication.TransientObjects.CreateColor(255, 255, 255) 'Set the line weight oLine.LineWeight = 2
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website