Help with SDK "copy design" copydesign.exe crashing with Inventor 2022

Help with SDK "copy design" copydesign.exe crashing with Inventor 2022

chrisw01a
Collaborator Collaborator
1,115 Views
14 Replies
Message 1 of 15

Help with SDK "copy design" copydesign.exe crashing with Inventor 2022

chrisw01a
Collaborator
Collaborator

Hello group,

Hoping I can connect with someone who can give me some direction here.  Years ago, we modified the copy design program to meet our needs.  It functions like so:  An inventor file is selected, the program recognizes all linked files and then you choose a path of where to copy them to (or rename in the current folder).  During the copy process, we rename the leading characters of the files up to a dash"-" to match a job number so when the files arrive in the new folder, they all contain job numbers.

 

Example:

original file: 12345-101

new file: 33333-101

 

It is a simple program but it is the cornerstone of our engineering process for generating jobs from our standard part templates.

 

SO, I am very exited to implement Inventor 2022 and make full use of the new Model States feature however, our file copy program crashes if a model contains any model states.

 

Would any of you know what might be causing this?  I would suspect it has something to do with model states... I think the program was built in VB.net 2005 Express but I am still working on trying to find that info.

 

Attached are the source files and the "filecopy.exe" in the "bin\debug" folder will run the program.

0 Likes
1,116 Views
14 Replies
Replies (14)
Message 2 of 15

chrisw01a
Collaborator
Collaborator

Here is the exception:

chrisw01a_0-1635353344277.png

 

0 Likes
Message 3 of 15

A.Acheson
Mentor
Mentor

I would have this post moved over to the ilogic forum. @CGBenner or 

@johnsonshiue can hopefully move this for you. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 15

chrisw01a
Collaborator
Collaborator

We seem to have misplaced our VB Studio 2008 installer.  Does anyone have a copy?

 

If anyone has time to run a debug and give me some suggestions, I would really appreciate it!

 

0 Likes
Message 5 of 15

chrisw01a
Collaborator
Collaborator
Thank you
0 Likes
Message 6 of 15

matt_jlt
Collaborator
Collaborator

Not sure if it is related but Vault 2022 copy design doesnt work properly on files with model reps either, the only reason we haven't gone to Inventor 2022 yet.

0 Likes
Message 7 of 15

CattabianiI
Collaborator
Collaborator

HI @chrisw01a,


Hey guys/gals, I have a similar issue here do you think this is related?

Yes it could be, try to use currentFile.FilePropertySets instead of currentFile.PropertySets.

Btw if you want someone here to try your code, migrate it properly to Inv2022: proper visual studio version, framework version and mostly create the smallest version of your program that can reproduce the issue.

0 Likes
Message 8 of 15

chrisw01a
Collaborator
Collaborator

Thanks for the idea.  It has been 10 years since I did the program so still trying to figure out VB Studio 2022 at the moment.  Had some missing references but I think I got it fixed.

 

Will try the change and report back.

0 Likes
Message 9 of 15

chrisw01a
Collaborator
Collaborator

So it is no longer crashing with your suggestion, but now it is not changing the part number like it is supposed to.

 

If I breakpoint, it shows the correct value of "-101" but in the finished part, it still shows "Part1" as the part number.

 

chrisw01a_0-1635423839664.png

 

 

chrisw01a_1-1635423880225.png

 

 

0 Likes
Message 10 of 15

CattabianiI
Collaborator
Collaborator

Has 99999-101.ipt been migrated?
Does it have level of details/ model state?
How do you save the document? You could try PropertySets.FlushToFile API (follow the link to check a sample)
Check openedDoc.FullDocumentName value.

0 Likes
Message 11 of 15

chrisw01a
Collaborator
Collaborator

I believe it has been migrated because the program checks for migration before doing anything.

 

'Make sure the version is current
        If openedDoc.NeedsMigrating = True Then
            'MsgBox("The File " & openedDoc.FullFileName & " needs updated to the current version.  Please update it and try again.", MsgBoxStyle.Exclamation)
            'Call resetForm()

            addUnmigratedFile(openedDoc.FullFileName)

            'Exit Sub
        End If

 

Yes, one model state: 

chrisw01a_0-1635425335328.png

 

I'll attach the part here.

 

The file is saved by:

' Get the FileSaveAs object.
        Dim fileSaveAs As Inventor.FileSaveAs = apprentice.FileSaveAs
' Do the save copy as of all the files.
        fileSaveAs.ExecuteSaveCopyAs()
0 Likes
Message 12 of 15

baris.uyarD9VEA
Participant
Participant

Is there any update on this? Because SDK\UserTools\CopyDesign is not working with ModelStates correctly. If I open the assembly file, change the model state, save it, and close it, the .idw file still points to the previous active model state. And copy design is fail. But Design Assistant 2025 works. If my drawing file is more complex, like having all the different model states on the same drawing file, the SDK tool fails again. Vault CopyDesign or Design Assitant is working correctly all the time.

 

So, it seems like there is no issue with the API but something missing in the CopyDesign SDK. Could you please help us with what we are missing?

@Markus.Koechl 

0 Likes
Message 13 of 15

Markus.Koechl
Autodesk
Autodesk

Hi, @baris.uyarD9VEA. You probably mentioned my name when you were thinking about Vault CopyDesign. But the API used here is Inventor only. I hope you understand this is not my focus, and I won't chime in.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 14 of 15

baris.uyarD9VEA
Participant
Participant

Hi, thank you so much for the explanation. Who from Autodesk can help us with Inventor API?

0 Likes
Message 15 of 15

baris.uyarD9VEA
Participant
Participant

Hi, thank you so much for the explanation. Who from Autodesk can help us with Inventor API?

0 Likes