VaultInventorServer STEP export from ASSEMBLY results in empty file

VaultInventorServer STEP export from ASSEMBLY results in empty file

ampersanddevelopment
Explorer Explorer
1,513 Views
8 Replies
Message 1 of 9

VaultInventorServer STEP export from ASSEMBLY results in empty file

ampersanddevelopment
Explorer
Explorer

We use VaultInventorServer to generate STEP files in Vault.
This works fine for PART files, but results in almost empty stp files when used with ASSEMBLY files.

 

When i run similar code as VBA in Inventor the results are ok.

It seems to me bug in the VaultInventorServer with the translator extension for step files.

 

// Rendition STP
private void ExecuteStp(
    InventorServer inv,
    Document doc,
    string sourceFile)
{
    // define file name
    var fileName = sourceFile + ".stp";

    // initialize translator
    TranslatorAddIn translator = inv.ApplicationAddIns.ItemById["{90AF7F40-0C01-11D5-8E83-0010B541CD80}"] as TranslatorAddIn;

    TranslationContext transContext = inv.TransientObjects.CreateTranslationContext();
    transContext.Type = IOMechanismEnum.kFileBrowseIOMechanism;

    DataMedium transData = inv.TransientObjects.CreateDataMedium();
    transData.FileName = fileName;

    NameValueMap transOptions = inv.TransientObjects.CreateNameValueMap();

    if (translator.HasSaveCopyAsOptions[doc, transContext, transOptions] == true)
    {
        transOptions.Value["ApplicationProtocolType"] = 3;
    }

    // export to file
    translator.SaveCopyAs(doc, transContext, transOptions, transData);
}

 

0 Likes
Accepted solutions (1)
1,514 Views
8 Replies
Replies (8)
Message 2 of 9

Markus.Koechl
Autodesk
Autodesk
Accepted solution

Did you check that all assembly components are downloaded before the export starts? I posted a full coded sample job that successfully creates STEP files from parts and assemblies and attaches the outcome as design representation files in Vault (https://github.com/koechlm/Vault-Sample---InventorExportAnySampleJob). I hope this sample helps to identify the issue that you are facing.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 3 of 9

peteh
Enthusiast
Enthusiast

Is Inventor Server the same as Inventor Apprentice?

0 Likes
Message 4 of 9

Markus.Koechl
Autodesk
Autodesk
Apprentice is a subset of the Inventor API shared by the Design Tracking application. It is an ActiveX component; the primary target is managing file references and properties. InventorServer is an Inventor application without a user interface and graphic screen; its primary target is to provide full automation capabilities for other applications, e.g., batch publishing or design automation. It is NOT available as a separate installable rather than part of other applications. Vault includes Inventor Server to support Job Processor tasks and creates a "VaultInventorServer" process at the runtime of a job if needed.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 5 of 9

peteh
Enthusiast
Enthusiast

Thank you - that answers my question.

0 Likes
Message 6 of 9

d.peskin
Explorer
Explorer

Does Apprentice support PDF-Export from IPT/IAM files?

I've used it for IDW to PDF export, but if I try the same translator.SaveCopyAs(document, context, options, dataMedium) method on IPT files, I get COMException (0x80004005)

0 Likes
Message 7 of 9

Markus.Koechl
Autodesk
Autodesk

Hi @d.peskin, may I ask you to clarify your objective and environment first? This thread is about exporting STEP files using VaultInventorServer in a custom job.

If your export target is 3D PDF, please create a new thread.  3D PDF Export (Anark AddIn) is available in Inventor only.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 8 of 9

d.peskin
Explorer
Explorer

Thank you for the answer,

 

we have a C# Add-In what runs on the JobServer and uses InventorServer or Inventor depending on configuration.

With a full Inventor version we can create (plain) PDF, STEP and DXF documents from IDW, IPT and IAM files.

 

If our application uses InventorServer  object, IPT/IAM->STEP and IDW->PDF exports work perfectly, but  IPT/IAM->PDF fails. We use same code for all formats.

 

                dynamic context = Management.Instance.InventorApp.TransientObjects.CreateTranslationContext();
                context.Type = IOMechanismEnum.kFileBrowseIOMechanism;

                AITlog.Debug(" :: InventorPlotter:ExportNeutralFormat :: Translator-context set");

                NameValueMap options = Management.Instance.InventorApp.TransientObjects.CreateNameValueMap();
                dynamic dataMedium = Management.Instance.InventorApp.TransientObjects.CreateDataMedium();
                dynamic translator = (TranslatorAddIn)Management.Instance.InventorApp.ApplicationAddIns.ItemById[GetTranslationAddinIdByDocumentType(documentSettings.NeutralFormat)];
                if (!translator.Activated)
                {
                    translator.Activate();
                }
...
                    translator.SaveCopyAs(document, context, options, dataMedium);
0 Likes
Message 9 of 9

Markus.Koechl
Autodesk
Autodesk
As mentioned in the thread earlier, 3D PDF export requires full Inventor and is unavailable for running jobs on VaultInventorServer.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe