Create Custom Task with an exe

Create Custom Task with an exe

Anonymous
Not applicable
1,064 Views
6 Replies
Message 1 of 7

Create Custom Task with an exe

Anonymous
Not applicable

Hello,

 

I try to create custom task in scheduler with an exe (RFATranslator.Translate.RevitServer) but it does not work

Also, I want to use it with all files in a directory and files have been convert go in a new directory.

 

Capture 3.PNG

Capture 2.PNG

 

Someone know to do this?

 

Regards,

 

0 Likes
Accepted solutions (1)
1,065 Views
6 Replies
Replies (6)
Message 2 of 7

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Hoping that example in the below blog link may be helpful.

 

https://beinginventive.typepad.com/being-inventive/2011/11/how-to-create-a-custom-task-in-task-scheduler.html

 

If not, please provide non confidential source code (.exe) and model data to test the same?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi Chandra,

 

So, I don't understand all the thing in this page. 

In fact, about application, I don't if these can be do what I want to do.

 

In real, I want to create an automatic task which can convert *.ipt files to *.rfa files. 

In Inventor, to do this you have to use BIM Content and I hope to create a task which can use this feature.

 

I don't know if it's possible and I realize it's a specific task.

 

Regards.

0 Likes
Message 4 of 7

zengyongting
Autodesk
Autodesk

@Anonymous 

 

RFATranslator.Translate.RevitServer.exe is an internal exe file called by BIM Content Add-in. It has complex commandline argments and can not be used directly.

 

BIM Content Add-in provides APIs to convert .ipt/.iam files to .rfa files. You can write a script to do the translation. 

 

Regrads,

Paul

0 Likes
Message 5 of 7

Anonymous
Not applicable

Hi Paul,

 

Thanks for your answer. 

Just can you give some details about that.

Do you know where are these files about this Add-in ?

 

I'm a beginner about script and I would like to know if you can just lead me for the beginning.

 

Thanks a lot.

Regards,

Baptiste.

 

0 Likes
Message 6 of 7

zengyongting
Autodesk
Autodesk
Accepted solution

@Anonymous 

 

BIM Add-in APIs are embedded into Inventor APIs. Users can use those APIs directly without knowing any technical detail about BIM Add-in. 

 

I made a simple VBA script to show how to export a part/assembly to rfa file. You can try it.

  • Launch Inventor.
  • Launch VBA editor from Ribbon "Tools"->"VBA Editor
  • Insert a module by context menu of "Modules" folder of "ApplicationProject".
  • Copy/paste follow code into new created module. Then "Run"/"Debug" the script.

Sub DoRFAExport()

 

Dim strInvFilePath As String
strInvFilePath = "C:\test\part1.ipt"

 

Dim strRFAFilePath As String
strRFAFilePath = "C:\test\part1.rfa"

 

Call RFAExportFunc(strInvFilePath, strRFAFilePath)

End Sub

 

Sub RFAExportFunc(strInvFilePath As String, strRFAFilePath As String)

'open document
Dim oDoc As Document
Set oDoc = ThisApplication.Documents.Open(strInvFilePath)

 

'get BIMComponent object
Dim oBIMComp As BIMComponent
If (oDoc.DocumentType = kPartDocumentObject) Then
    Dim oPartDocument As PartDocument
    Set oPartDocument = oDoc
    Set oBIMComp = oPartDocument.ComponentDefinition.BIMComponent
Else
    If (oDoc.DocumentType = kAssemblyDocumentObject) Then
        Dim oAssyDocument As AssemblyDocument
        Set oAssyDocument = oDoc
        Set oBIMComp = oAssyDocument.ComponentDefinition.BIMComponent
    End If
End If
If (oBIMComp Is Nothing) Then
    Return
End If

 

'export to .rfa
Call oBIMComp.ExportBuildingComponent(strRFAFilePath)

 

'close doc
Call oDoc.Close(True)

 

End Sub

 

P.S. Inventor API help file is installed at "C:\Users\Public\Documents\Autodesk\Inventor 20xx\Local Help". We can get more API details from it.

 

Regards,

Paul

0 Likes
Message 7 of 7

Anonymous
Not applicable

Perfect, it works.

 

Thanks a lot for best help.

 

Regards

Baptiste

0 Likes