- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to use ApprenticeServerComponent and ApprenticeServerDocument in .Net classlibrary(c# dll)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.