• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor

    Reply
    Mentor
    Posts: 152
    Registered: ‎11-30-2007
    Accepted Solution

    iLogic to Delete Sketched Symbol from the IDW

    189 Views, 3 Replies
    11-05-2012 05:57 AM

    Hey all!

     

    I was trying to find an answer for that with the SEARCH here and google also, after read many topics i gave up and like always, trying it direct here :smileyhappy:

     

    How can I delete one Sketched Symbol from my Drawing ? It wont be in use in any sheet, i just need to delete it and the recreate with my code, so by this way the symbol is updated.

    The other part of the code is created already, just need this parte to delete...

    I found some ways but just delete the symbol from the sheet, not the source symbol.

     

    How can i delete it then ?

     

    thanks!

     

    Túlio Barata

    IV 2013
    Please use plain text.
    *Expert Elite*
    Posts: 855
    Registered: ‎02-16-2006

    Re: iLogic to Delete Sketched Symbol from the IDW

    11-05-2012 12:13 PM in reply to: tuliobarata

    I'm no use at ilogic but another way to do what you want, if the replacement Sketched Symbol will have the same name, is to create your new sketched symbol in a drawing then use the drawing transfer wizard to overwrite this symbol into your other drawings.

     

    Not really what you wanted but I hope this helps.

    Please use plain text.
    Mentor
    Posts: 152
    Registered: ‎11-30-2007

    Re: iLogic to Delete Sketched Symbol from the IDW

    11-05-2012 03:23 PM in reply to: harco

    Hey harco, thanks for the reply man!

     

    Well, i guess that is not gonna work for the thing I'm building here.

    The problem is that:

    I have one code that creates some notes to put in a drawing (actually many notes), and the best way i've found to control these notes, is creating them into a Symbol....but, when i create them in the symbol, it keeps the old text too..so it becomes a mess, like, if i use the Form to make the notes 3 times in the same IDW, it'll keep those 3 versions of the notes, one over the other...

     

    So my idea is to delete the symbol and recreate it with ilogic, so instead of update, each time the user change the notes, the code would delete all the symbols in the sheets, delete the source symbol and the create a new one with the notes.

    Or maybe (just thought it now while writing), i could just clear the symbol if that's easier...just dont know how, but if a could erase all the things inside the symbol, i guess would work great too!!

     

    Thanks very much!

     

    Túlio Barata

    IV 2013
    Please use plain text.
    Mentor
    Posts: 152
    Registered: ‎11-30-2007

    Re: iLogic to Delete Sketched Symbol from the IDW

    11-06-2012 11:40 AM in reply to: tuliobarata

    Found it !!!

     

    Here the code that I used, i just got the same code to delete the symbol from all the sheets, changed something and now it deletes from the entire IDW:

     

        Dim oDrawDoc As DrawingDocument
         oDrawDoc = ThisApplication.ActiveDocument
    Dim oSketchedSymbolDef As SketchedSymbolDefinition    
        For Each oSketchedSymbolDef  In oDrawDoc.SketchedSymbolDefinitions
        If oSketchedSymbolDef.Name = "Notas Solution" Then
        oSketchedSymbolDef.Delete
        Else 
        End If
        Next

     

    Thanks very much!


    Túlio Barata

    IV 2013
    Please use plain text.