iLogic Design Copy failure

iLogic Design Copy failure

AnufrievSergey
Enthusiast Enthusiast
3,896 Views
19 Replies
Message 1 of 20

iLogic Design Copy failure

AnufrievSergey
Enthusiast
Enthusiast

Hi, all.

iLogic Design Copy is great instrument! It works wery well, but i find some issue.

 

If you uncheck boxed renaming - renaming procedure stops at all (copying error). Please fix this.

 

I need to rename only those parts, which get influence, from my iLogic parameters, not all parts.

 

More info at the pictures below.

 

AUTODESK1.jpg

AUTODESK2.jpg

0 Likes
Accepted solutions (3)
3,897 Views
19 Replies
Replies (19)
Message 2 of 20

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi Sergey,

 

The behavior does not sound right to me. I need to work with the project team and see why it behaves this way. Hopefully, it can be fixed soon.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 20

MjDeck
Autodesk
Autodesk

@AnufrievSergey , it looks like you are creating copies of each file in the same folder. Is that true? The source folder is the same as the target (destination) folder?


Mike Deck
Software Developer
Autodesk, Inc.

Message 4 of 20

AnufrievSergey
Enthusiast
Enthusiast
Good morning, Mike. Yes, the folder is the same.
0 Likes
Message 5 of 20

MjDeck
Autodesk
Autodesk

We weren't expecting the source and destination to be the same. We can make changes to support that workflow in future.
It looks like there's no workaround with iLogic Design Copy. Have you considered using Copy Design in Vault instead?


Mike Deck
Software Developer
Autodesk, Inc.

Message 6 of 20

AnufrievSergey
Enthusiast
Enthusiast

Yes, our company use Vault with a part name generator. It will be great generate names for 'iLogic Design Copy' files from Vault name generator. I just don't know how.

0 Likes
Message 7 of 20

MjDeck
Autodesk
Autodesk

I'm not familiar with Vault Copy Design myself, but I think it's worth a try. You can set the "Reuse" option on individual files to avoid copying and renaming them. If you have questions about Copy Design, it's best to ask them on the Vault forum.
But I'm wondering  why you want to create a copy in the same folder. How are you planning to use the copy?


Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 20

AnufrievSergey
Enthusiast
Enthusiast

Good day, MJ.

 

I use storage stackable trolley for aluminium alloy profiles different shapes. Each profile need to be store by own trolley with exact dimension. And this dimensions are parametric, I call it general dimensions. See picture.

for mjdeck.jpg

Some parts are depends from general dimensions, some parts not. All trolleys is a same project and need to be saved in one folder, but parts can be save in a several subfolder. But in a "iLogic Copy Design" i can choose only vault project root. I not except that my experience in a "iLogic Copy Design" is poor. And if you can explain how can i save all parts of three trolley: 800x600x400, 800x400x400, 800x400x600 (it is LxWxH in mm), in a same folder or subfolders, it will be wery helpful. I have some unified parts and have a parts witch depend from general dimensions.

 

Thanks, please excuse me for delay answer.

0 Likes
Message 9 of 20

MjDeck
Autodesk
Autodesk
Accepted solution

I think Vault Design Copy would be better for what you're trying to do.


Mike Deck
Software Developer
Autodesk, Inc.

Message 10 of 20

AnufrievSergey
Enthusiast
Enthusiast

Hi, "Vault Design Copy" good too. I just need to adjust my file name generator now. Thanks.

0 Likes
Message 11 of 20

paulm
Explorer
Explorer

edit. i made an error. sorry.

0 Likes
Message 12 of 20

chrisw01a
Collaborator
Collaborator

@MjDeck wrote:

We weren't expecting the source and destination to be the same. We can make changes to support that workflow in future.
It looks like there's no workaround with iLogic Design Copy. Have you considered using Copy Design in Vault instead?



MjDeck,

Can we please get a copy of the source code for iLogic Copy Design? I need to figure out how you are iterating through "AllReferencedDocuments" when .ipt's with model states are involved. Our program (calling Apprentice Server) is having an issue where Document.AllReferencedDocuments is recognizing two copies of the same document due to the document having two model states. This is blowing up our program. Any help is appreciated.

 

 

0 Likes
Message 13 of 20

MjDeck
Autodesk
Autodesk

@chrisw01a , it's not an Apprentice bug. They really are two separate documents, although they are in one single ipt file. In Inventor 2022 and later, a model state file contains one factory document, plus one member document for each model state.
When a model state component is placed in an assembly, the assembly contains a reference to one of the member documents.
If you place two different model states of the same file, then the assembly contains references to two different model state member documents.
To avoid trying to copy the same file twice, you could keep a HashSet or Dictionary of the filenames that have been processed.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 14 of 20

chrisw01a
Collaborator
Collaborator
I see. We are already keeping a dictionary to make sure we don't create any duplicate file suffixes. In fact, that is exactly the part where it is blowing up.

So if we have two parts in the source folder:
12345-101.ipt
77777-101.ipt

We are exiting the program because in our destination directory, this would cause duplicate part names.
Unfortunately this model state issue is creating this scenario naturally so the program finds:
12345-101.ipt
12345-101.ipt
And it determins that this will create a duplicate in our destination folder so we exit.

I'm not sure how to fix this to allow for both cases.

There is nothing else I can call from Apprentice to eliminate the duplicate?

Thanks for the reply.
Chris
0 Likes
Message 15 of 20

MjDeck
Autodesk
Autodesk

You can use the File.AllReferencedFiles property. Sample:

 

        For Each fileX As Inventor.File In openedDoc.File.AllReferencedFiles
            Debug.Print("referenced file: {0}", fileX.FullFileName)
        Next

 

However, that doesn't give you the Document. And unfortunately, it looks like each member document has a separate  NeedsMigrating flag. You have to activate the model state and save it in order to migrate its document. Let me double-check that behavior.

But I would recommend using openedDoc.AllReferencedDocuments as you are now. But add a new dictionary of filenames (in addition to what you have now) to avoid adding names twice.


Mike Deck
Software Developer
Autodesk, Inc.

Message 16 of 20

MjDeck
Autodesk
Autodesk

You can get a list of Documents from a File. So if you want to use AllReferencedFiles:

        For Each fileX As Inventor.File In openedDoc.File.AllReferencedFiles
            Debug.Print("referenced file: {0}", fileX.FullFileName)
            For Each docX As Inventor.ApprenticeServerDocument In fileX.AvailableDocuments
                Debug.Print("   needs migrating = {0}", docX.NeedsMigrating)
            Next
        Next




Mike Deck
Software Developer
Autodesk, Inc.

Message 17 of 20

chrisw01a
Collaborator
Collaborator

@MjDeck wrote: In Inventor 2022 and later, a model state file contains one factory document, plus one member document for each model state.


MjDeck,

Given your examples, is there a way to determine if the document is a factory document vs member document? This could help me a lot.

0 Likes
Message 18 of 20

MjDeck
Autodesk
Autodesk

Here's a sample function to test for factory and member documents. This could be improved by to defining an Enum and returning that instead of an integer.

    ''' <summary>
    ''' Returns:
    ''' 0 if the document is not a model state document
    ''' 1 if it is a model state factory
    ''' 2 if it is a model state member
    ''' </summary>
    Private Function GetModelStateDocumentType(doc As Inventor.ApprenticeServerDocument) As Integer
        If doc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
            Dim compDef As Inventor.PartComponentDefinition = doc.ComponentDefinition
            If compDef.IsModelStateFactory Then Return 1
            If compDef.IsModelStateMember Then Return 2
        ElseIf doc.DocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
            Dim compDef As Inventor.AssemblyComponentDefinition = doc.ComponentDefinition
            If compDef.IsModelStateFactory Then Return 1
            If compDef.IsModelStateMember Then Return 2
        End If
        Return 0
    End Function

Here's some info about the model state API.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 19 of 20

chrisw01a
Collaborator
Collaborator
Thank you a bunch. I am having to do my regular work at the moment but will get back to it soon.
0 Likes
Message 20 of 20

Yijiang.Cai
Autodesk
Autodesk
Accepted solution

This idea has been implemented within Autodesk Inventor 2024.2. Please review the Inventor 2024.2 What's New article here. For more information regarding how you may leverage the feature, and please review this page. Special thanks to everyone who cast a vote for it.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com