Section View Sketch Location Not Updating When Moved

Section View Sketch Location Not Updating When Moved

Tiffany_Hayden_
Collaborator Collaborator
285 Views
2 Replies
Message 1 of 3

Section View Sketch Location Not Updating When Moved

Tiffany_Hayden_
Collaborator
Collaborator

When I have a section view located on a specific base view. When I move the section view sketch line to another location on the sheet, it seems like the location EndPointSketch/StartPointSketch doesn't change. I tried to convert to sheet space and see if it updated but no luck. So my question is how to get the latest and greatest exact location of the section view sketch or sketch line. I do not want the location of the section view. I am referring to the section view sketch attached to the base view. If you move the centerline within the sketch to move the section view the location does not update and stays the same as the original. I'm hoping I'm just referencing the wrong parameter but not sure. I tried to update the sheet as well before referencing the geometry but no change happened.

 

 

 

Public Sub SectionviewsTest()
    Dim oDrawView As DrawingView: Set oDrawView = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingViewFilter, "Select a Drawing View.")
    Dim oDrawDoc As DrawingDocument: Set oDrawDoc = ThisApplication.ActiveDocument
    Dim oSheet As Sheet: Set oSheet = oDrawDoc.ActiveSheet
    Dim oSketch As DrawingSketch
    Dim oPoint2d As Point2d
    
    For Each oSketch In oDrawView.Sketches
        Set oPoint2d = oDrawView.DrawingViewToSheetSpace(oSketch.SketchLines(1).EndSketchPoint.Geometry)
    
        Debug.Print oSketch.Name & ", " & oPoint2d.X & ", " & oPoint2d.Y
    
    Next
    
End Sub

 

 

TiffanyHaydenSWQYG_0-1662473338631.png

 

You may ask why I need this? So my main reason is I have to order the section views from top to bottom and from left to right. If the location is not accurate then the ordering will be wrong. Thanks in advance! 

 

Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Accepted solutions (1)
286 Views
2 Replies
Replies (2)
Message 2 of 3

marcin_otręba
Advisor
Advisor

if you want coordinates you can use, it shows correct values after moving line:

 

  Dim Vline As DrawingCurve = thisapplication.CommandManager.Pick(selectionfilterenum.kDrawingCurveSegmentFilter,"Pick section line").parent
  MessageBox.Show(vline.StartPoint.X & " + " & vline.StartPoint.Y, "Title")

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 3 of 3

Tiffany_Hayden_
Collaborator
Collaborator
Accepted solution

@marcin_otręba 

The solution for me was to constrain the sketch. If the sketch isn't constrained it won't show any movement. But now that made the sketch fully constrained and used the constraints to move the sketch line now the coordinates for startsketchpoint and endsketchpoint move and update. If the section sketch line is not fully constrained the original placement of the sketchline is the only thing the startsketchpoint or endsketchpoint listens to. That is until the sketch is constrained and then it is updated.  

Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes