Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not geting the same DrawingView from parent

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
161 Views, 0 Replies

Not geting the same DrawingView from parent

Hallo.

 

I get some strange behavior in my code.

 

The idea was to have this code delete all bend notes in a drawing view of a flat pattern. but it dose not work. It's like the DrawingCurve.Parent is returning different drawing view, then the one i picked at the start.

 

I have solved this by using Reference Keys from the drawing view and comparing them.

 

So I´m just wondering if I´m missing something or is this intend behavior?

 

 

  Dim DrawingView As Inventor.DrawingView
  DrawingView = m_inventor.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingViewFilter, "Pick")

    If DrawingView IsNot Nothing Then

        Dim Sheet As Sheet
        Sheet = DrawingView.Parent

        Dim DrawingDocument As Document
        DrawingDocument = Sheet.Parent

        Dim ReferencedDocument As Document
        ReferencedDocument = DrawingView.ReferencedDocumentDescriptor.ReferencedDocument

        Dim ComponentDefinition As ComponentDefinition
        ComponentDefinition = GetComponentDefinition(ReferencedDocument)

        If TypeOf ComponentDefinition Is SheetMetalComponentDefinition Then

            Dim BendNotes As BendNotes
            BendNotes = Sheet.DrawingNotes.BendNotes

            For Each BendNote In BendNotes.Cast(Of BendNote)
                Dim DrawingCurve As DrawingCurve
                DrawingCurve = BendNote.BendEdge

                ' For some reason this donse not return same drawing view that was used as input.
                Dim ParentDrawingView As DrawingView
                ParentDrawingView = DrawingCurve.Parent

                If DrawingView = ParentDrawingView = True Then
                    BendNote.Delete()
                End If
            Next

            Document.Update()

        End If

    End If

 

 

 

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report