- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create some automation, but I also want to make it easy for others without much iLogic experience to edit, maintain, and duplicate. There are other threads on how to create a new section view through iLogic, but I want to be able to create the section view manually and place notes, dimensions, symbols, etc.
What I would normally do is right click on the section line and edit; then dimension the line to the part so it would stretch and move with the changes to the part. With the parts I am working on now this method does not work. The part is just a rectangle, but the outside edges have a profile that changes based on the part. When the profile changes, all association with the sketch line edit dimensions are lost.
Below is an example of my normal routine for setting section lines that will dynamically change with the part for section views.
For reasons I don't want to get into, the position of the section view is not centered on purpose. So I have an equation that off centers it.
This gives me a nice predictable section view, until this roundover profile changes to a chamfer. Then these dimensions are all lost.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm starting to think the only solution to this one is to create the detail view from scratch via iLogic every time. Was hoping for something a little less tedious that would be easy to train people who are not strong in iLogic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Finally found the solution to the problem. Have to find the view the sketch is on first, then iterate through all sketches on the view to find the ones to update by name. Delete the line and re-add the line for the section view.
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
' Get the view the section views are being created from
Dim oView As DrawingView = ActiveSheet.View("FRONT VIEW").View
' Set a reference to the transient geometry object.
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oSketch As DrawingSketch
Dim line As SketchLine
Dim vertLinePoint As Double = oView.Height / oView.Scale / 2 + 2
Dim horzLinePoint As Double = oView.Width / oView.Scale / 2 + 2
For Each oSketch In oView.Sketches
Select Case oSketch.Name
Case "vert"
' Open the sketch for edit.
oSketch.Edit
' delete all lines in sketch
For Each line In oSketch.SketchLines
line.Delete
Next
' redraw line in the sketch to move section view
Call oSketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(0, vertLinePoint), oTG.CreatePoint2d(0, -vertLinePoint))
' Exit from editing the sketch.
oSketch.ExitEdit
Case "horz"
' Open the sketch for edit.
oSketch.Edit
' delete all lines in sketch
For Each line In oSketch.SketchLines
line.Delete
Next
' redraw line in the sketch to move section view
Call oSketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(horzLinePoint, 0), oTG.CreatePoint2d(-horzLinePoint, 0))
' Exit from editing the sketch.
oSketch.ExitEdit
End Select
Next