Check if drawings needs migrating

Check if drawings needs migrating

w.pepping
Advocate Advocate
1,079 Views
4 Replies
Message 1 of 5

Check if drawings needs migrating

w.pepping
Advocate
Advocate

I have an add in to make a copy design.

In Inventor the active design is first checked if all files are migrated to the current release because I do the copy design with apprentice.

In Apprentice it is not possible to migrate.

 

The issue is that if I do a check for migrating drawings, the answer is always false, even if the drawing is saved in an older version. For ipt and iam files it works correct.

I use this code:

    Dim doc As Document
    Set doc = ThisApplication.ActiveDocument

MsgBox (doc.NeedsMigrating)

How can I detect if a drawing needs to be migrated for further use in Apprentice?

 

 

 

Get control of your sheet metal files.
Download the app from matprop.com
0 Likes
Accepted solutions (1)
1,080 Views
4 Replies
Replies (4)
Message 2 of 5

JaneFan
Autodesk
Autodesk
Accepted solution

Hello @w.pepping

 

Seems there is something not working well in DrawingDocument.NeedsMigrating. Please use this code as a work around: 

If Not oDoc.SoftwareVersionSaved.DisplayVersion = ThisApplication.SoftwareVersion.DisplayVersion Then

Msgbox("Document.NeedsMigrating is True")

End If




Jane Fan
Inventor/Fusion QA Engineer
Message 3 of 5

bradeneuropeArthur
Mentor
Mentor

@w.pepping

 

Hi,

 

Please use a specific declaration  for the drawingdocument.

 

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument

MsgBox b.NeedsMigrating

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 5

w.pepping
Advocate
Advocate

The specific declaration does not the trick. Result is still NO for all drawing files.

The answer of JaneFan is a good work around. Only thing to be aware of is the service pack number since Inventor 2017.

If a part has a DisplayVersion of 2017.1 you do not want to migrate it to 2017.2. Another thing is that it is possible to open a 2018 document in 2017. For that situation you need an extra check.

Get control of your sheet metal files.
Download the app from matprop.com
0 Likes
Message 5 of 5

salariua
Mentor
Mentor

Thanks @JaneFan 

@w.pepping is right, I had a case where 2018.1  reported as needs migrating to 2018.2

 

checking just first 4 digits and avoiding files created with newer Inventor. My case avoiding files from 2019, 2020...

 

If Left(oDoc.SoftwareVersionSaved.DisplayVersion,4) < Left(ThisApplication.SoftwareVersion.DisplayVersion,4) Then
   MsgBox("NeedsMigrating")
End If
Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes