You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用APS Model Derivative API转换SVF2文件不完整问题排查

复杂Inventor模型转SVF2时组件丢失/显示「Model is Empty」问题排查

问题现象

  • 使用APS Model Derivative API将复杂Autodesk Inventor模型转换为SVF2格式,部分模型转换正常,但多数模型丢失部分或全部组件,部分模型查看时弹出「Model is Empty」窗口:
    「Model is Empty」弹窗
  • 即使模型转换后完全为空,任务仍返回成功结果
  • 将原装配体中无法显示的文件加入其他装配体后,SVF2可正常显示,说明问题与几何形状无关

疑问

是否有额外的任务输出可供查看,以定位失败的位置和原因?

补充信息(编辑)

使用PowerShell完成文件上传与任务提交,脚本如下:

$clientID = "[REDACTED]"
$clientSecret = "[REDACTED]"
$bucketName = "[REDACTED]"
$zipFile = "C:\Work\FileName.zip"
$topAssemblyName = "FileName.iam"

#get access token
function Authenticate-Forge()
{
    $form = @{
        client_id = $clientID
        client_secret = $clientSecret
        grant_type = 'client_credentials'
        scope = 'data:write data:read bucket:create bucket:delete'
    }
    
    $uri = 'https://developer.api.autodesk.com/authentication/v1/authenticate'
    
    $result = Invoke-RestMethod -Uri $uri -Body $form -Method Post
    
    return $result.access_token
}

$token = Authenticate-Forge


#create a bucket for storing files
$bucketsURI = 'https://developer.api.autodesk.com/oss/v2/buckets'

$bodyHash = @{
    bucketKey = $bucketName
    access = 'full'
    policyKey = 'persistent'

}

$bucketHeaders = @{
    'Authorization' = "Bearer $($token)"
    'Content-Type' = "application/json"
}

$bodyJSON = ConvertTo-Json $bodyHash

$bucketResult = Invoke-RestMethod -Uri $bucketsURI -Headers $bucketHeaders -Method Post -Body $bodyJSON

#Get a signed URL for upload
$filekey = [IO.Path]::GetFileName($zipFile).Replace(" ", "_")
$signedUploadURI = "https://developer.api.autodesk.com/oss/v2/buckets/$($bucketName)/objects/$($filekey)/signeds3upload?minutesExpiration=20"

$signedUploadHeaders = @{
    'Authorization' = "Bearer $($token)"
    'Accept-Encoding' = "gzip, deflate"
}


#Get a signed URL for upload
$signedURLResponse = Invoke-RestMethod -Method Get -Uri $signedUploadURI -Headers $signedUploadHeaders

$uploadKey = $signedURLResponse.uploadKey
$contentUploadSignedURL = $signedURLResponse.urls[0]

#Upload the file
$uploadHeaders = @{
    'Accept-Encoding' = "gzip, deflate"
}


$uploadResponse = Invoke-RestMethod -Method Put -Uri $contentUploadSignedURL -Headers $uploadHeaders -InFile $zipFile

#finalize the upload
$finalizeUploadURI = "https://developer.api.autodesk.com/oss/v2/buckets/$($bucketName)/objects/$($filekey)/signeds3upload"
$finalizeUploadHeaders = @{
    'Authorization' = "Bearer $($token)"
    'Accept-Encoding' = "gzip, deflate"
    'Content-Type' = 'application/json'
}

$finalizebodyHash = @{
    uploadKey = $uploadKey
}
$finalizebodyJSON = ConvertTo-Json $finalizebodyHash

$finalizeUploadResponse = Invoke-RestMethod -Method Post -Uri $finalizeUploadURI -Headers $finalizeUploadHeaders -Body $finalizebodyJSON

$sourceFileObjectKey = $finalizeUploadResponse.objectKey
$sourceFileURN = $finalizeUploadResponse.objectId

$bytes = [System.Text.Encoding]::UTF8.GetBytes($sourceFileURN)
$encodedURN = [Convert]::ToBase64String($bytes)
$encodedURNSafe = $encodedURN.TrimEnd("=").Replace("+","-").Replace("/","_")

#Convert to SVF
$convertHeaders = @{
    'Authorization' = "Bearer $($token)"
    'Content-Type' = "application/json"
    'x-ads-force' = "true"
}

$convertURI = "https://developer.api.autodesk.com/modelderivative/v2/designdata/job"

$convSVFBodyHash = @{
    'input' = @{
        'urn' = $encodedURNSafe
        'rootFilename' = $topAssemblyName
        'compressedUrn' = $true
    }
    'output' = @{
        'destination' = @{
            'region' = 'us'
        }
        'formats' = @(
            @{
                'type' = 'svf2'
                'views' = @('3d')
            }
        )
    }
}

$convSVFBodyJSON = ConvertTo-Json $convSVFBodyHash -Depth 4
$convertResponse = Invoke-RestMethod -Method Post -Uri $convertURI -Headers $convertHeaders -Body $convSVFBodyJSON
$convertResponse

#check the status of the job
$statusURI = "https://developer.api.autodesk.com/modelderivative/v2/designdata/$($encodedURNSafe)/manifest"
$statusHeaders = @{'Authorization' = "Bearer $($token)"}
$statusResponse = Invoke-RestMethod -Method Get -Uri $statusURI -Headers $statusHeaders
$statusResponse

已尝试的解决方法

  • 确保所有文件迁移至同一版本的Inventor
  • 消除建模错误
  • 验证装配体在Inventor中可正常打开且无问题
  • 暂未尝试完全重建装配体

内容的提问来源于stack exchange,提问作者Forrest Judd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 18:37:04