Create Autodesk.Vault.UpdateRevisionBlock.dwg job using API

Create Autodesk.Vault.UpdateRevisionBlock.dwg job using API

darius.simkunas
Advocate Advocate
1,591 Views
11 Replies
Message 1 of 12

Create Autodesk.Vault.UpdateRevisionBlock.dwg job using API

darius.simkunas
Advocate
Advocate

Hi,

I need to synchronize AutoCAD revisison block table using job processor.

For this I would like to create already existing job done by Autodesk.

I try to create job, but some parameters are missing. (The given key was not present in the dictionary.)

The code is below.

I can create and sync properties, but revision table update not working.

JobParam param1 = new JobParam();
param1.Name = "FileVersionId";
param1.Val = pdfup.Id.ToString();
JobParam param2 = new JobParam();
param2.Name = "FileMasterId";
param2.Val = pdfup.MasterId.ToString();
JobParam param3 = new JobParam();
param3.Name = "FileId";
param3.Val = pdfup.Id.ToString();
m_serviceManager.JobService.AddJob("Autodesk.Vault.SyncProperties", "property sync job", new JobParam[] { param1 },10);
m_serviceManager.JobService.AddJob("Autodesk.Vault.UpdateRevisionBlock.dwg", "DWG Create job", new JobParam[] { param1, param2, param3 },10);

0 Likes
1,592 Views
11 Replies
Replies (11)
Message 2 of 12

sajith_subramanian
Autodesk Support
Autodesk Support

Hi @darius.simkunas,

 

Queuing up an out-of-the-box job using the API is actually unsupported. The behavior is undocumented, and it could change from release to release.

 

Regards,

Sajith 


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 3 of 12

ThomasRambach
Advisor
Advisor

@sajith_subramanianis this answer still true? It's listed in the SDK documentation.

0 Likes
Message 4 of 12

sajith_subramanian
Autodesk Support
Autodesk Support

Hi @ThomasRambach,

 

I do believe it is still true. Also, could you help me with where it is listed in the SDK docs? I wasn't able to locate it in the documentation.

 

Regards,

Sajith 


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 5 of 12

smilinger
Advisor
Advisor

I think you can configure your lifecycle transition to auto trigger the job for you, then just as the job is pending or running you can use the api method JobService.GetJobsByDate to get the job and check the params needed.

0 Likes
Message 6 of 12

smilinger
Advisor
Advisor

OK, I did it for you. I think the parameters needed for job type Autodesk.Vault.UpdateRevisionBlock.dwg is as follows:

FileVersionId: the file id

UpdateViewOption: true/false, if create dwf

PDFPublishOption: true/false, if create pdf

 

And it is actually unnecessary to add this type of job manually, it's automatically triggered after Autodesk.Vault.SyncProperties if it's detected that the file has rev block. So you can just remove the line for adding this job in your code.

 

Message 7 of 12

ThomasRambach
Advisor
Advisor

@sajith_subramanianin the Vault documentation that installs with the SDK. Listed under AddJob method.

0 Likes
Message 8 of 12

vas_ampelas
Contributor
Contributor

Hi, could I kindly request a further explanation on how to discover which parameters a job is asking for? Thank you.

0 Likes
Message 9 of 12

smilinger
Advisor
Advisor

You can use change state on the file to trigger the jobs and then use JobService.GetJobsByDate to get these jobs and check the ParamArray property of the job object.

 

I will use PowerShell, like this:

 

Add-Type -Path 'C:\Program Files\Autodesk\Vault Client 2021\Explorer\Autodesk.Connectivity.WebServices.dll'
Add-Type -Path 'C:\Program Files\Autodesk\Vault Client 2021\Explorer\Autodesk.DataManagement.Client.Framework.dll'
Add-Type -Path 'C:\Program Files\Autodesk\Vault Client 2021\Explorer\Autodesk.DataManagement.Client.Framework.Forms.dll'
Add-Type -Path 'C:\Program Files\Autodesk\Vault Client 2021\Explorer\Autodesk.DataManagement.Client.Framework.Vault.dll'
Add-Type -Path 'C:\Program Files\Autodesk\Vault Client 2021\Explorer\Autodesk.DataManagement.Client.Framework.Vault.Forms.dll'

$env:Path += ';C:\Program Files\Autodesk\Vault Client 2021\Explorer'

$vaultConnection = [Autodesk.DataManagement.Client.Framework.Vault.Forms.Library]::Login($null)

$vault = $vaultConnection.WebServiceManager
$jobService = $vault.JobService

# run this statement at the appropriate time when the job you want is ready or running (you can see it in the job queue)
$jobs = $jobService.GetJobsByDate(10, [datetime]::Now.AddMinutes(-1))
$jobs = $jobs | Where-Object Typ -EQ 'Autodesk.Vault.PDF.Create.idw'

# check the params of the job
$jobs[0].ParamArray

 

 

Message 10 of 12

clastrilla
Advocate
Advocate

This is great! I've got a similar question. What if I don't want the SyncProperties job to trigger the Update Rev Block job? I looked at the job parameters of the Sync Properties job and it doesn't look like there is any parameter for it:


FileVersionIds --> 10218
QueueCreateDwfJobsOnCompletion --> True
QueueCreateDxf2dJobsOnCompletion --> False
QueueCreateDxfFlatPatternJobsOnCompletion --> False
QueueCreatePdfJobsOnCompletion --> False
QueueCreateStepJobsOnCompletion --> False
QueueUpdateItemJobsOnCompletion  --> False

 

Does anybody know if there is a parameter to set the Update Revision Block to False?

 

Thanks!

0 Likes
Message 11 of 12

Markus.Koechl
Autodesk
Autodesk
I am not aware of an option to stop revision table updates. If "Revision Table" is enabled in the behavior configuration, the job is submitted for idw/dwg drawings. May I ask why you want to enable revision table handling but not update the tables?


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 12 of 12

clastrilla
Advocate
Advocate

Hi Markus. It's because we have a state prior to release where manual intervention is being done on the Revision Table in Inventor (namely removing the secondary revisions on the rev table by hiding them). The workflow is as such that pre-release, we need to have the secondary revisions shown, but post release only the primary revs are shown.

The IDW file is opened in the Pre-Release state in Inventor, and a script is run in Inventor to hide the secondary revision rows.

When the file is then transitioned to the Released state, the Update Revision Table job undoes all the "fixes" done to the rev table.

0 Likes