Use Template to add Document gives Style conflict

Use Template to add Document gives Style conflict

dominiek_vanwest
Advocate Advocate
505 Views
8 Replies
Message 1 of 9

Use Template to add Document gives Style conflict

dominiek_vanwest
Advocate
Advocate

Hi,

 

I want to add a new assembly based on our Template. I've tried all the below codes. However I keep getting a style conflict but I don't get this when I manually add a new assembly myself.

What could be the problem here and how can I fix it?

Thanks in advance!

oAssDoc = oApp.Documents.Add(Inventor.DocumentTypeEnum.kAssemblyDocumentObject, oApp.FileManager.GetTemplateFile(Inventor.DocumentTypeEnum.kAssemblyDocumentObject))

or

oAssDoc = oApp.Documents.Add(Inventor.DocumentTypeEnum.kAssemblyDocumentObject, oApp.DesignProjectManager.DesignProjects.ItemByName("Vault").TemplatesPath & "\Standard.iam", True)

or

oAssDoc = oApp.Documents.Add(Inventor.DocumentTypeEnum.kAssemblyDocumentObject, oApp.DesignProjectManager.ActiveDesignProject.TemplatesPath & "\Standard.iam", True)

image.png

0 Likes
506 Views
8 Replies
Replies (8)
Message 2 of 9

bradeneuropeArthur
Mentor
Mentor

You need to update the styles in the styles library or update the template with the styles library.

This is a default inventor message you will get when there is a style conflict.

You also get that when you create a new file if messages are not suppressed by the user. Never show this message again.

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 3 of 9

dominiek_vanwest
Advocate
Advocate

Thank you Arthur for the reply.

 

I looked through the prompts (under Application Options) but I can't find this particular message. Also all the Prompt are set on Always.

Is there another way to get this message to pop-up again?

0 Likes
Message 4 of 9

bradeneuropeArthur
Mentor
Mentor

Reset application options?

Are you using a different style library when using your code, that would also explain the message.

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 5 of 9

dominiek_vanwest
Advocate
Advocate

In my code there is nothing to set which Library I should use.

 

I looked a bit further and found there is this conflict in the template but it's not in the Inventor Material Library but in the Autodesk Material Library.

But I still don't understand why I do get the message when I use my code and why I don't get the message when I manually use the template when creating a new assembly.

 

I tried adjusting the template. I select Yes for Update here:

image.png

But then I get a conflict in the Inventor Material Library:

image.png

So I keep going back and forth....

0 Likes
Message 6 of 9

bradeneuropeArthur
Mentor
Mentor

I have this issue seen too.

Remove the library that you do not use from the ipj file.

 

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 7 of 9

dominiek_vanwest
Advocate
Advocate

Removing the library from the ipj file didn't work.

 

I see we also have a style conflict with another library, which is called RAL_Appearance (see pic below).

I tried to update that library with the style which gave a conflict and this worked all fine. Untill I closed and opened Inventor again, then the style conflicts were back. Is that because my colleagues use the same library and even though I update the library it's not actually updated or is it something else? And how can I actually update the style?

image.png

 

0 Likes
Message 8 of 9

WCrihfield
Mentor
Mentor

Is your style library file(s) located on your PC, like in the default install location, or is it located on a shared network location?  If located on shared network location, and others projects are all pointing to the same file at the same time, then it may not let you update that style library file properly.  It may be a situation where there must be no other references to the file when you update it for the update to stick properly.  If the file is local, and there are no other Inventor users logged into your PC but you, then it should be able to update OK.  But I noticed you have a project named "Vault".  Are you using Vault?  If so, is it possible that may have something to do with it?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 9 of 9

dominiek_vanwest
Advocate
Advocate

Our libraries are on a network so I think I'll have to ask the colleagues to close Inventor first to change anything to the libraries.

 

In the meantime I found a solution so the message doesn't pop up anymore. I just added this to my code:

oApp.SilentOperation = True
0 Likes