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