velope
velope

Reputation: 11

Conversion from IFC to SVF

To convert from IFC file to SVF output for Autodesk viewer, derivative webhooks (https://forge.autodesk.com/en/docs/webhooks/v1/developers_guide/overview/) can be used. Is there another way to do the same thing like using "autodesk design automation" and if yes, which option should be chosen?

For conversion from IFC to SVF using output-advanced-conversionMethod-v3 instead of conversion method legacy or modern, which library for .NET can be used, because in Autodesk.Forge you can´t select "v3" option, only legacy or modern.

For "autodesk design automation" what king of activities can be used with the same functionality than derivative API?

Upvotes: 0

Views: 404

Answers (2)

Eason Kang
Eason Kang

Reputation: 7070

Update

My PR#100 has been merged. Please have a try with the least version, v1.9.0.

=====================

Unfortunately, Design Automation API doesn't support converting IFC to SVF/SVF2. Therefore, using Model Derivative API is the only way.

Regarding using the v3 conversion method with .NET, you can send submit raw JSON rather than using the type-mapped data model class as a workaround.

string urn = "dXJuOmFkc2sub2JqZW....";

derivative.Configuration.AccessToken = "YOUR_ACCESS_TOKEN";

var restSharpClient = derivative.Configuration.ApiClient.RestClient;
var jobPayload = new JObject(
    new JProperty("input",
        new JObject(
            new JProperty("urn",
                urn
            )
        )
    ),
    new JProperty("output",
        new JObject(
            new JProperty("formats",
                new JArray{
                     new JObject(
                        new JProperty("type",
                            "svf"
                        ),
                        new JProperty("views",
                            new JArray{
                                "3d"
                            }
                        ),
                        new JProperty("advanced",
                            new JObject(
                                new JProperty("conversionMethod",
                                    "v3"
                                )
                            )
                        )
                    )
                }
            )
        )
    )
);

RestRequest request = new RestRequest("/modelderivative/v2/designdata/job", RestSharp.Method.POST);
request.AddHeader("Authorization", "Bearer " + derivative.Configuration.AccessToken);

var body = JsonConvert.SerializeObject(jobPayload);
request.AddParameter("application/json", body, ParameterType.RequestBody);

IRestResponse response = await restSharpClient.ExecuteAsync(request);
var result = JsonConvert.DeserializeObject<dynamic>(response.Content);

Just want to clarify. Please be noted Forge API is a set of RESTfull Web APIs. Model Derivative API itself supports the v3 IFC conversion method. You can definitely submit the translation job by calling the API directly with raw JSON.

However, the problem you addressed is that our .NET API client doesn't add the v3 field in the ConversionMethodEnum here. I will suggest our team add that support A.S.A.P. Sorry for the inconvenience.

https://github.com/Autodesk-Forge/forge-api-dotnet-client/blob/4ed6475248743dafca9d6b13d5e28c3f50a6577f/src/Autodesk.Forge/Model/JobSvfOutputPayloadAdvanced.cs#L67

cf. Created a PR here: https://github.com/Autodesk-Forge/forge-api-dotnet-client/pull/100

Upvotes: 0

Michal Hradil
Michal Hradil

Reputation: 111

Actually, this is doable using Forge Design Automation. The beauty of FDA is that it can work with several Autodesk products. So you can import the IFC file as part of one activity to Revit and use it to produce any generic 3D file format (like STEP) and then create another activity to import this file to Inventor, which can easily produce the SVF file.

Upvotes: 1

Related Questions