Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

How to use ApprenticeServerComponent and ApprenticeServerDocument in .Net classlibrary(c# dll)

vijaykumarreddy25
Participant

How to use ApprenticeServerComponent and ApprenticeServerDocument in .Net classlibrary(c# dll)

vijaykumarreddy25
Participant
Participant

Hi,

Please provide solution for how to use ApprenticeServerComponent and ApprenticeServerDocument in .Net classlibrary(c# dll).

My requirement is to open document using ApprenticeServerComponent in .Net classlibrary(c# dll).

 

Thanks & Regards,

Vijay

0 Likes
Reply
518 Views
4 Replies
Replies (4)

pcrawley
Advisor
Advisor

You might have more luck reposting over on the customisation forum here: 

Inventor iLogic and VB.net Forum - Autodesk Community

 

One of the forum moderators can move this post for you.

Peter

JelteDeJong
Mentor
Mentor

You might want to look at this post "iProperties Without Inventor (Apprentice)". In the post, they use vb.net. I translated to C# (but did not test it.) it looks something like this:

Inventor.ApprenticeServerComponent apprentice = new Inventor.ApprenticeServerComponent();
Inventor.ApprenticeServerDocument apprenticeDoc = apprentice.Open(Filename);

Inventor.PropertySet summaryPropSet = apprenticeDoc.PropertySets["Inventor Document Summary Information"];
Inventor.Property companyProp = summaryPropSet["Company"];
companyProp.Value = "www.hjalte.nl";

apprenticeDoc.PropertySets.FlushToFile();

apprenticeDoc.Close();

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes

vijaykumarreddy25
Participant
Participant

Thank you for your response JelteDeJong.


Inventor.ApprenticeServerComponent apprentice = new Inventor.ApprenticeServerComponent();
Inventor.ApprenticeServerDocument apprenticeDoc = apprentice.Open(Filename);
Inventor.PropertySet summaryPropSet = apprenticeDoc.PropertySets["Inventor Document Summary Information"];
Inventor.Property companyProp = summaryPropSet["Company"];
companyProp.Value = "www.hjalte.nl";
apprenticeDoc.PropertySets.FlushToFile();
apprenticeDoc.Close();


The above code it is working fine for Console Application(C#) or Windows Application(C#).
But in class library (dll) it is not working.
Can you please let me know is there any solution is there to execute in class library (dll).

Thanks & Regards,
Vijay

0 Likes

jjstr8
Collaborator
Collaborator

Is the platform target for your application using the DLL set to x64? It cannot be 'Any CPU'

 

Edit:  Just to clarify, it can't be 'Any CPU' with 'Prefer 32-bit' checked (which is the default).  So either unchecking 'Prefer 32-bit' with 'Any CPU' or selecting x64 will work.

0 Likes