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: 

Looking for a Save Script

1 REPLY 1
Reply
Message 1 of 2
iUser2k13
269 Views, 1 Reply

Looking for a Save Script

hello

 

im new in inventor and new in ilogic.

 

i looking for a script, that "save as" my top assembly and...

 

- delete all features of the parts in my assembly, that are disable like this


Feature.IsActive("Hole1") = False

Feature.IsActive("Radius1") = False


 

 

- delete all rules and formulars in all assemblys and parts

 

- delete all custom parameters in the top assembly

 

so that i ve after run the "save as"-script, a clean assembly....

 

perhaps anyone of you have something like this

 

regard

 

1 REPLY 1
Message 2 of 2

You may consider something like this:

ThisDoc.Document.SaveAs(NewFileNameAndExtension, True)

'Delete suppressed features in components at all levels
Dim oAsmDoc As AssemblyDocument = ThisDoc.Document
For Each oDoc As Inventor.Document In oAsmDoc.AllReferencedDocuments
  If TypeOf oDoc Is PartDocument Then
    Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
    For Each oFeature As PartFeature In oDef.features
        If oFeature.Suppressed Then oFeature.Delete
    Next
  End If
Next
Beep
InventorVb.DocumentUpdate()

 Hope this helps.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report