Apprentice, openWithOptions method use

Apprentice, openWithOptions method use

Anonymous
Not applicable
2,894 Views
7 Replies
Message 1 of 8

Apprentice, openWithOptions method use

Anonymous
Not applicable

Hi ! I'm a new user of Inventor API and have some problems in finding answers in the API documentation which seems very poor...

 

So, i'm trying to open a large number of Inventor files with an ApprenticeServerComponent object. The problem is that some of these files have wrong references (which i'll fix) and when i call appServ.Open(filename), Apprentice make a scan of the missing references through dozen of thousands files, which is very slow and uncomfortable. So i'd like to open the files with the "SkippAllUnresolvedFiles" option in appServ.OpenWithOptions(). But this failed cause of wrong argument. I cant find any example or reference on the use of ApprenticeServerComponent .OpenWithOptions() function. Nothing about the possible options. The one i tried "SkipAllUnresolvedFiles" have been taken from the "Documents.OpenWithOptions Method" API reference, but doesnt work...

 

Here is my (non-working) code (of course, filename is a string containing the adress of an existing file on my hd) :

 

NameValueMap openFilesOptions;

openFilesOptions = this.appServ.TransientObjects.CreateNameValueMap();
            
openFilesOptions.Add("SkipAllUnresolvedFiles", true);
            
try
{
    appDoc = appServ.OpenWithOptions(filename, openFilesOptions);
    appDoc.Close();
}
catch (Exception e)
{

    MessageBox.Show("error : " + e.ToString());
    appDoc = null;
}

 

Thanks in advance

 

0 Likes
2,895 Views
7 Replies
Replies (7)
Message 2 of 8

Raider_71
Collaborator
Collaborator

Hi I would like to know if you came right with the OpenwithOptions method. I have a simalar issue. My application is a batch printer of idw's but it bombes out giving me an HRESULT.... error. I have noticed that this only happens if there is an idw with unresolved references. I also tried your "SkipAllUnresolvedFiles" sugestion but with no joy. 

 

Any ideas?

 

Thanks

 

Pieter

0 Likes
Message 3 of 8

philippe.leefsma
Alumni
Alumni

Hi,

 

Apprentice and Inventor share pretty much the same API, so in case you look for details about an Apprentice method, it always worth taking a look at the corresponding Inventor API.

 

Unfortunately in case of "OpenWithOptions" and the "SkipAllUnresolvedFiles" options, Apprentice doesn't support it yet. We have logged a wish about that to our engineering team but it has not been implemented yet. I guess there is no workaround while using Apprentice at the moment.

 

Sorry for the bad news.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 4 of 8

GeorgK
Advisor
Advisor

Hi,

 

is there a full list of supported functions?

 

Cheers

 

Georg

0 Likes
Message 5 of 8

philippe.leefsma
Alumni
Alumni

Hi Georg,

 

Do you mean a list of supported methods by Apprentice? The Inventor SDK API Help files contains the methods supported by Apprentice, but unfortunately there are sometimes a few exceptions...

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 8

GeorgK
Advisor
Advisor

Hi Philippe,

 

I mean these exceptions 🙂

 

Regards

 

Georg

0 Likes
Message 7 of 8

philippe.leefsma
Alumni
Alumni

No we don't provide this kind of information publicly, this is a case by case.

 

Sorry about that.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 8 of 8

MechMachineMan
Advisor
Advisor

Can someone confirm that this is still an issue in apprentice?

I'm running into this as I made a vbscript to act as a "quick missing reference" checker; however it's not much quicker because it's making apprentice still try to resolve the file every time before opening.

 

I'm assuming this Option missing means there's no way to open it quickly?


(I'm running under the assumption that since FileScriptingObject can check if a File exists at it's location, inventor should be able to do something similar and tell you which files references are broken for the same reason, instead of having to wait 15 minutes for it to try and resolve all of the unresolved references...)


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type