Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate files iAssembly

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
oneshortplanck
1019 Views, 9 Replies

Generate files iAssembly

I have an assembly with around 120 variants in it.

 

I am getting a little annoyed having to click the OK button when asked:

"Do you want to save changes to 122.iam" and its dependants"

 

is there any way to set the default to OK?

(other than setting an electric motor and a poking device up)

 

i would like to leave it over night etc...

 

thanks in advance

9 REPLIES 9
Message 2 of 10

BUMP
Message 3 of 10
Cadmanto
in reply to: oneshortplanck

The only place I thought this message might be (which I wasn't holding my breath) would have been in the application options under the prompts taband it wasn't there.

I know what you are talking about and this is a pain.  Unless there is an iLogic routine that does this I am not sure there is a way around other then to keep doing what you are doing.

 

check.PNGIf this solved your issue please mark this posting "Accept as Solution".

Or if you like something that was said and it was helpful, Kudoskudos.PNG are appreciated. Thanks!!!! Smiley Very Happy

 

New EE Logo.PNG

Inventor.PNG     vault.PNG

Best Regards,
Scott McFadden
(Colossians 3:23-25)


Message 4 of 10
Anonymous
in reply to: oneshortplanck

Hey,

 

I've got the same problem for ±110 variants. There isn't any setting available in the "prompts" tab in the application option of Inventor 2016. Has anyone got any ideas?

 

If iLogic is the answer, any basic code to start with would be helpfull.

 

Many thanks to all who give any clues at all.

 

Paul

Message 5 of 10
oneshortplanck
in reply to: Anonymous

I think I have a work around, (but as with all workarounds, Autodesk should arrange for a proper fix):
go to the ipart or Iassembly sub folder and delete all the files. make sure you have all checked out from the vault so there is no writ protection on the files if you are using one.
now generate the files and (if I remember correctly) you wont get the save messages).
Message 6 of 10
ThomasB44
in reply to: Anonymous

Hi @Anonymous

Please try this iLogic rule :

 

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate()

'If it is an iPart
If ThisDoc.Document.DocumentType = kPartDocumentObject Then
    Dim oDoc As PartDocument = ThisDoc.Document
    Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
    Dim oFactory As iPartFactory = oDef.iPartFactory
    Dim oRow As iPartTableRow
    
    For Each oRow In oFactory.TableRows
        oFactory.CreateMember(oRow)
    Next
End If

'If it is an iAssembly
If ThisDoc.Document.DocumentType = kAssemblyDocumentObject Then
    Dim oDoc As AssemblyDocument = ThisDoc.Document
    Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
    Dim oFactory As iAssemblyFactory = oDef.iAssemblyFactory
    Dim oRow As iAssemblyTableRow
    
    For Each oRow In oFactory.TableRows
        oFactory.CreateMember(oRow)
    Next
End If

iLogicVb.UpdateWhenDone = True

 


Thomas
Mechanical Designer / Inventor Professionnal 2023
Inventor Professional EESignature

Message 7 of 10
Anonymous
in reply to: ThomasB44

Thomas,

 

this iLogic does the trick. Many many thanks! Now I can generate all files without looking (e.g. before going home). This is a solution for me!

 

@oneshortplanck: I'm sorry, but your work around did not seem to work here. I think you'll like Thomas his code as well. But many thanks for your suggestion.

 

grz

Message 8 of 10
ThomasB44
in reply to: Anonymous

@Anonymous

You're welcome Smiley Happy

 

In a particular case, like populate some iProperties that are not in the factory table, members are not saved.

In fact, like with the right click command "Generate members", the members are generated if there is a model or a factory table change.

 

To prevent this, you can click on the "rebuild all" command before run the rule or you can add at the start of the rule :

 

SyntaxEditor Code Snippet

ThisDoc.Document.Rebuild()

So in this way, Inventor believe all members have been modified and save them all, even if there is no changes, but it could be a longer operation.


Thomas
Mechanical Designer / Inventor Professionnal 2023
Inventor Professional EESignature

Message 9 of 10
gilsdorf_e
in reply to: ThomasB44

Oh, that's funny. I did the same with Inventor API recently. After keyusers tests we will roll that out to the complete company.

protected override void ButtonDefinition_OnExecute(NameValueMap context)
        {
            Document doc = InventorApplication.ActiveDocument;

            if (doc.DocumentType.Equals(DocumentTypeEnum.kAssemblyDocumentObject))

            {
                //für Baugruppen 
                AssemblyDocument thisAssembly = doc as AssemblyDocument;


                if (thisAssembly.ComponentDefinition.IsiAssemblyFactory)
                {

                    iAssemblyFactory factory = thisAssembly.ComponentDefinition.iAssemblyFactory;

                    iAssemblyTableRows rows = factory.TableRows;
                    foreach (iAssemblyTableRow row in rows)
                    {

                        factory.CreateMember(row);

                    }

                }
                else
                {
                    MessageBox.Show("Das ist kein iPart und keine iAssembly!");
                }

            }
            if (doc.DocumentType.Equals(DocumentTypeEnum.kPartDocumentObject))

            {
                //für Bauteile 
               PartDocument thisPart = doc as PartDocument;


                if (thisPart.ComponentDefinition.IsiPartFactory)
                {

                    iPartFactory factory = thisPart.ComponentDefinition.iPartFactory;

                    iPartTableRows rows = factory.TableRows;
                    foreach (iPartTableRow row in rows)
                    {

                        factory.CreateMember(row);

                    }

                }
                else
                {
                    MessageBox.Show("Das ist kein iPart und keine iAssembly!");
                }

            }
        }

Additionally keyusers tell me that the generation seems a lot faster in Inventor 2018, without inital lag like with right-click "Generate members".

 

Message 10 of 10
gilsdorf_e
in reply to: gilsdorf_e

Be aware that if you are connected to Vault, in case of iAssemblies with subassemblies all components must be already on local disk, otherwise you will have unresolved references.

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

Post to forums  

Autodesk Design & Make Report