Shared Views + Forge access - Can I push an Inventor model as a shared view and then access the bucket in a forge app - autodesk-forge

I would like to use the Shared Views feature of Vault/AutoCAD/ACADE/Inventor to push models and such (in particular larger Inventor assemblies) up to the cloud, where I assume they land in an OSS bucket. I think that they are only valid up there for 30 days, but that length of time is fine for my purpose. What I would like to know is there any way I can get the ID of the bucket, and then use that to view or pull that SVF file into an APP back inside my firewall for further use? I have some extensions planned in a viewer app back on premises, but I don't have a good way to get the models into the cloud and generated in the first place because of the references in the model - I would have to checkout the model and all references, zip them up, and then send it to the model derivative and such. I am hoping that since the shared views feature already does that part, I can just leverage that to start my process.
MORE INFO:
So, using Fiddler I can see several interesting calls related to this. I went into Vault and created a shared view for a DWG file, then just watched the traffic. I see calls in a pattern that could be maybe leveraged.
Call 1:
GET https://360.autodesk.com/Viewer/GetViewerTranslationById?viewerId=dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u
Call 2:
GET https://360.autodesk.com/Viewer/GetAccessToken
Call 2 returns a token:
token_type: "Bearer"
expires_in: "3599"
expires_at: "2020-07-17T17:02:15.1187374+00:00"
access_token: "eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpzZWFyY2giXSwiY2xpZW50X2lkIjoiVmZNQ3U1NDg2U3hLQXVRaGRVMU9aYTJuTHdqR1VXcEciLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiI5NVFQYnhGWjlmZ1p0YWxzbXg2OW1oUWczck9WbWRKeDRtZjdtdUY0Z0xBME01TmNqZjJCT1hoa3RiRHdlVm04IiwiZXhwIjoxNTk1MDA1MzQ2fQ.tRQYz7PP-_NIDrZFrWbXvxiP4NfooBHAIC89eQuelkw"
bucket: "a360viewer"
Then Call 3 to the derivatives service:
GET https://developer.api.autodesk.com/derivativeservice/v2/manifest/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u
.....
Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpzZWFyY2giXSwiY2xpZW50X2lkIjoiVmZNQ3U1NDg2U3hLQXVRaGRVMU9aYTJuTHdqR1VXcEciLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiI5NVFQYnhGWjlmZ1p0YWxzbXg2OW1oUWczck9WbWRKeDRtZjdtdUY0Z0xBME01TmNqZjJCT1hoa3RiRHdlVm04IiwiZXhwIjoxNTk1MDA1MzQ2fQ.tRQYz7PP-_NIDrZFrWbXvxiP4NfooBHAIC89eQuelkw
....
Call 3 returns lots of information:
guid: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
owner: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
hasThumbnail: "true"
startedAt: "Fri Jul 17 16:06:29 UTC 2020"
type: "design"
urn: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
success: "100%"
progress: "complete"
region: "US"
status: "success"
children:
0:
guid: "aa85aad6-c480-4a35-9cbf-4cf5994a25ba"
hasThumbnail: "true"
role: "viewable"
progress: "complete"
type: "folder"
status: "success"
version: "2.0"
urn: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
inputFileSize: 1059328
inputFileType: "collaboration"
name: "C-424305-036.dwg.dwf"
success: "100%"
children:
0:
guid: "87CBE465-EAB2-43C0-BA0A-D148B3418FF3_Sheets"
type: "folder"
name: "Sheets"
hasThumbnail: "true"
status: "success"
progress: "complete"
success: "100%"
children:
0:
guid: "933b32f8-830d-4861-6e81-294f5d07d4fc"
type: "geometry"
role: "2d"
name: "C-424305-036-Model"
status: "success"
size: 585718
hasThumbnail: "true"
progress: "complete"
success: "100%"
viewableID: "com.autodesk.dwf.ePlot_87CBE466-EAB2-43C0-BA0A-D148B3418FF3"
order: 0
children:
0:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/933b32f8-830d-4861-6e81-294f5d07d4fc_f2d/primaryGraphics.f2d"
role: "graphics"
size: 503288
mime: "application/autodesk-f2d"
guid: "c7624064-cb61-933b-787c-e02bef313ea4"
type: "resource"
status: "success"
1:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/933b32f8-830d-4861-6e81-294f5d07d4fc_f2d/section_properties.db"
role: "Autodesk.CloudPlatform.PropertyDatabase"
size: 24576
mime: "application/autodesk-db"
guid: "20392091-d0da-d74d-741f-904b078b9c0a"
type: "resource"
status: "success"
2:
guid: "a3a9ad7f-b9aa-451e-8bbc-da2972137d82"
type: "view"
role: "2d"
name: "INITIAL"
viewbox:
0: 0.67
1: 0.575
2: 16.330833
3: 10.423333
1:
guid: "d6e600db-d158-d84f-3101-0a654aa29df3"
type: "geometry"
role: "2d"
name: "C-424305-036-C-424305-036-00"
status: "success"
size: 617457
hasThumbnail: "true"
progress: "complete"
success: "100%"
viewableID: "com.autodesk.dwf.ePlot_87CBE467-EAB2-43C0-BA0A-D148B3418FF3"
order: 1
children:
0:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/d6e600db-d158-d84f-3101-0a654aa29df3_f2d/primaryGraphics.f2d"
role: "graphics"
size: 535065
mime: "application/autodesk-f2d"
guid: "441471cc-a249-1b4e-36dd-7ea4bff584cd"
type: "resource"
status: "success"
1:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/d6e600db-d158-d84f-3101-0a654aa29df3_f2d/section_properties.db"
role: "Autodesk.CloudPlatform.PropertyDatabase"
size: 24576
mime: "application/autodesk-db"
guid: "03334fbb-15ce-446d-ff80-111dc8616642"
type: "resource"
status: "success"
2:
guid: "69f50589-0774-4cf3-9b21-8164c1e71027"
type: "view"
role: "2d"
name: "INITIAL"
viewbox:
0: 3.958333
1: 0.4325
2: 16.330833
3: 10.565
Further research reveals that the ID used for calling is base64 encoded, decoding it reveals this:
urn:adsk.objects:os.object:a360viewer/t637305987811241148_41b173c5-5ff7-446d-b51d-80e85647657d.collaboration

Related

how do I validate a JSON payload in OpenAPI 3.0 with Mule 4.4 Runtime

I need to develop a Mule API ( 4.4 Runtime ) with openapi: 3.0.0
The endpoint is a POST with the following request payload :
{
"Employee": {
"Address": {
"City": "a",
"Country": "aaa"
}
}
}
Here is the relevant section of the OpenAPI 3.0 spec :
openapi: "3.0.0"
paths:
/search:
post:
tags:
- SearchUser
summary: Search for Users
operationId: getUser
requestBody:
description: User Request Object
content:
application/json:
schema:
$ref: '#/components/schemas/RequestComp'
required: true
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ResponseComp'
'400':
description: Bad request
content: {}
'404':
description: User not found
content: {}
'405':
description: Validation exception
content: {}
components:
schemas:
RequestComp:
type: object
properties:
Employee:
$ref: '#/components/schemas/EmployeeComp'
EmployeeComp:
type: object
properties:
Address:
$ref: '#/components/schemas/AddressComp'
AddressComp:
type: object
properties:
City:
type: string
required: true
nullable: false
minLength: 1
Country:
type: string
required: true
nullable: false
minLength: 1
ResponseComp:
type: object
properties:
City:
type: string
Country:
type: string
So I can validate individual elements like 'City' and 'Country' to not be null but how do I prevent following request ? ( presently its not being flagged as invalid : )
{
"Address": {
"City": "a",
"Country": "aaa"
}
}
You can define the Employee wrapper as a required property and also disallow unknown properties by adding additionalProperties: false. Note that required is not a property-level attribute, but an object-level attribute - it's a list of required properties.
components:
schemas:
RequestComp:
type: object
required: [Employee] # <-----
properties:
Employee:
$ref: '#/components/schemas/EmployeeComp'
additionalProperties: false # <-----
EmployeeComp:
type: object
properties:
Address:
$ref: '#/components/schemas/AddressComp'
additionalProperties: false # <-----
AddressComp:
type: object
required: [City, Country] # <-----
properties:
City:
type: string
# required: true # <-- remove this
nullable: false
minLength: 1
Country:
type: string
# required: true # <-- remove this
nullable: false
minLength: 1
additionalProperties: false # <-----

Avoid additional fields in json apart from the fields defined in the swagger to fail the validation in WSO2 APIM 3.1.0

We are trying to validate a json in APIM 3.1.0 by defining the validation conditions in swagger definition and by enabling the schema validation under runtime configurations. PFA the Swagger definition.
When additional fields are passed in the request json apart from the fields defined in the swagger, the validation must fail or gateway should ignore those additional fields and shouldn't be passing it to the backend. But this is not happening currently, Could you please suggest us if we are missing anything here.
Sample Request JSON
Note : In this JSON, "test" field is an additional parameter sent in the request.
{​​​​​​​
"applicationId": "Test123_3211",
"name": "Bala krishna",
"dateOfBirth": "1981-04-11",
"gender": "FEMALE",
"phonenumber": "9039283630",
"altphonenumber": "9979979971",
"panCard": "AAAAV1234N",
"nomineeName": "Ramji Ambedkar",
"nomineeDOB": "1976-04-14",
"source": "ONLINE",
"process": "Canara HSBC",
"callDate": "2018-08-24",
"callTime": "17:00",
"merType": "VIDEOMER",
"instantCall": true,
"test": "abcd"
}​​​​​​​
Below is the swagger API :
swagger: "2.0"
info:
version: v1.0.0
title: MedicalBookAppointmentAPI
description: "This API is for booking medical appointments. \n\nSupported operations :\n\n\t1. Docs APP "
schemes:
https
http
produces:
application/json
paths:
/docs-app:
post:
summary: This API will be used to add cases and to schedule appointments.
description: This API will be used to add cases and to schedule appointments.
parameters:
- in: body
name: Payload
description: Request Body
required: true
schema:
$ref: "#/definitions/docs-app-request"
responses:
"200":
description: OK
schema:
$ref: "#/definitions/docs-app-response"
"400":
schema:
$ref: "#/definitions/book-appointment-api-error"
description: Bad Request. Invalid request or validation error.
"415":
schema:
$ref: "#/definitions/book-appointment-api-error"
description: " Unsupported Media Type. The entity of the request was in a not supported format."
"500":
schema:
$ref: "#/definitions/book-appointment-api-error"
description: Internal Server Error
produces:
- application/json
consumes:
- application/json
x-auth-type: "Application & Application User"
x-throttling-tier: Unlimited
definitions:
docs-app-request:
type: "object"
required:
- "applicationId"
- "process"
properties:
applicationId:
type: "string"
name:
type: "string"
dateOfBirth:
type: "string"
pattern: "^\d{​​​​​​​4}​​​​​​​-\d{​​​​​​​2}​​​​​​​-\d{​​​​​​​2}​​​​​​​$"
gender:
type: "string"
phonenumber:
type: "number"
altphonenumber:
type: "number"
panCard:
type: "string"
nomineeName:
type: "string"
nomineeDOB:
type: "string"
pattern: "^\d{​​​​​​​4}​​​​​​​-\d{​​​​​​​2}​​​​​​​-\d{​​​​​​​2}​​​​​​​$"
source:
type: "string"
process:
type: "string"
planDetails:
type: "string"
priorityStatus:
type: "string"
callDate:
type: "string"
pattern: "^\d{​​​​​​​4}​​​​​​​-\d{​​​​​​​2}​​​​​​​-\d{​​​​​​​2}​​​​​​​$"
callTime:
type: "string"
metaInfo:
type: "string"
instantCall:
type: "boolean"
merType:
type: "string"
enum:
- "TELEMER"
- "VIDEOMER"
- "OTHERS"
docs-app-response:
type: object
properties:
data:
type: object
properties:
approved:
type: boolean
isInternational:
type: boolean
id:
format: int64
type: integer
applicationId:
type: string
name:
type: string
dateOfBirth:
type: string
gender:
type: string
phonenumber:
type: string
altphonenumber:
type: string
panCard:
type: string
nomineeName:
type: string
nomineeDOB:
type: string
merType:
type: string
vendor:
type: string
updatedAt:
type: string
createdAt:
type: string
success:
type: integer
book-appointment-api-error:
title: Error object returned with HTTP status
type: object
properties:
fault:
type: object
properties:
code:
format: int64
type: integer
type:
type: string
message:
description: Error message.
type: string
description:
description: A detail description about the error message.
type: string
required:
- code
- message
You can use either additionalProperties or minProperties/maxProperties in the swagger file and restrict the additional properties in the payload.
If you know the property count to be limited then use minProperties/maxProperties
If you don't know the property count to be limited then use additionalProperties
For more details please refer https://m-saranki.medium.com/unboxing-json-schema-validator-320-2dd944dae6c0

Describing properties in swagger example

Try to add multiline example in definition of JSON response in swagger. Need to get structure like
{
"result": {
"urls": {
"site/index": true,
"site/create": true,
"site/update": true,
"site/delete": true,
"site/types": true,
"site/save": false
}
}
}
but now everything I've got only
{
"result": {
"urls": [
{
"site/index": true
},
{
"site/create": true
},
{
"site/update": true
},
{
"site/delete": true
},
{
"site/types": true
},
{
"site/save": false
}
]
}
}
My YAML file looks like
swagger: "2.0"
info:
description: "xxx"
version: 1.2.8
title: "xxx"
host: "xxx"
basePath: "xxx"
schemes:
- "https"
consumes:
- application/json
produces:
- application/json
/site/check:
post:
summary: ""
description: ""
parameters:
- in: body
name: urls
required: true
schema:
$ref: '#/definitions/CheckAccess'
responses:
200:
description: OK
schema:
$ref: '#/definitions/CheckAccessOKResponse'
definitions:
CheckAccess:
properties:
urls:
type: string
example:
- "site/index"
- "site/create"
- "site/update"
- "site/delete"
- "site/types"
- "site/save"
required:
- urls
CheckAccessOKResponse:
properties:
result:
type: object
properties:
urls:
type: object
example:
- "site/index": true
- "site/create": true
- "site/update": true
- "site/delete": true
- "site/types": true
- "site/save": false
Strings in example can be different, it's just a block of paths.
How can I fix my example or structure of CheckAccessOKResponse to get the needed view of JSON?
Thank you.
Remove the leading dashes from the example value list. Dashes indicate array items, you don't need that.
Also, result.urls is currently defined as a free-form object, but you probably want a string-to-boolean map instead.
CheckAccessOKResponse:
properties:
result:
type: object
properties:
urls:
type: object
additionalProperties: # <--- this means the object is
type: boolean # a string-to-boolean map
example:
"site/index": true # <--- no leading dashes
"site/create": true
"site/update": true
"site/delete": true
"site/types": true
"site/save": false

How can I fix the 'sha' undefined error for my Netlify site?

So I've built a Jekyll site with the theme [Moon](Failed to persist entry: TypeError: Cannot read property 'sha' of undefined) and I've uploaded it to my GitHub repository. Then I want to add Netlify's admin panel to my site so I follow this guide which I modify the config.yml to the following code:
backend:
name: git-gateway
publish_mode: editorial_workflow
media_folder: "files"
display_url: https://ccsource.org
slug:
encoding: "ascii"
clean_accents: true
collections:
- name: "story"
label: "Story"
folder: "_posts"
extension: "md"
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
create: true
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "post"}
- {label: "Title", name: "title", widget: "string"}
- label: "tags"
name: "tags"
widget: "list"
allow_add: true
default: ["story"]
- {label: "Summary", name: "excerpt", widget: "string", required: false}
- {label: "comments", name: "comments", widget: "hidden", default: true}
- label: "Publish date"
name: "date"
widget: "datetime"
default: ""
format: "MMM Do YY"
- {label: "Body", name: "body", widget: "markdown", required: true}
Since I got markdown sample file like:
---
layout: post
title: "Sample"
date: 2016-03-15
excerpt: "Hello..."
tag:
- sample
- post
- video
comments: true
---
# Sample
But after all things setup and deployed I visit my site's admin panel and try to create a new post I keep getting the following error.
Failed to persist entry: TypeError: Cannot read property 'sha' of undefined
And I've googled and modified the branch value to site which match to my github repository, but the error keeps showing, how can I fix it?
For anyone else experiencing this, the issue was that Netlify Identity was enabled, but Git Gateway, a sub-feature of Netlify Identity, was not. Instructions for enabling Git Gateway here: https://www.netlify.com/docs/git-gateway/#getting-started

Autodesk setreference for child assemblies not working

I am having trouble referencing child assemblies that are required for a parent assembly translation.
First I POST to https://developer.api.autodesk.com/references/v1/setreference with the following body
{ master: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam',
dependencies:
[ { file: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-e3l7hokp0qxqn227b7qcjo47vi.iam',
metadata:
{ childPath: 'fuselage.iam',
parentPath: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam' } },
{ file: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-mhrb7um0of74iasv37nzh0k9.iam',
metadata:
{ childPath: 'motor_mount.iam',
parentPath: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam' } } ] }
After setting references, I request translation and get the following result of the translation:
{ Result: 'Success',
Scope: '25660970-8194-4de0-baa4-c8f1f132b2a7',
RegisterType: [ 'thumbnail', '2dviewing', '3dviewing' ] }
After that I get the manifest for the urn and it is as follows:
{ guid: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
owner: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
type: 'design',
hasThumbnail: 'false',
startedAt: 'Wed Jan 04 04:43:59 UTC 2017',
urn: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
region: 'US',
status: 'failed',
progress: 'complete',
success: '100%',
children:
[ { guid: 'aa85aad6-c480-4a35-9cbf-4cf5994a25ba',
messages:
[ { type: 'warning',
message: 'The drawing\'s thumbnails were not properly created.',
code: 'TranslationWorker-ThumbnailGenerationFailed' } ],
name: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam',
success: '100%',
hasThumbnail: 'false',
role: 'viewable',
version: '2.0',
urn: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
status: 'failed',
assetCount: 25,
type: 'folder',
progress: 'complete',
children:
[ { guid: '015896d9-e6d3-4be6-8f3d-96da5e64eed3',
type: 'folder',
name: 'Scenes',
status: 'success',
progress: 'complete',
success: '100%',
hasThumbnail: 'false',
children:
[ { guid: '451f7aab-1917-40dd-b117-5dd8f90ab6a7',
type: 'geometry',
role: '3d',
name: 'Scene',
status: 'success',
messages:
[ { type: 'warning',
code: 'ATF-1023',
message:
[ 'The file: {0} does not exist.',
'X:\\Google Drive\\SCAAD\\PRJ_HAARDCraft\\HAARDCraft_JFlight\\CAD\\Fuselage\\fuselage.iam' ] },
{ type: 'warning',
code: 'ATF-1023',
message:
[ 'The file: {0} does not exist.',
'X:\\Google Drive\\SCAAD\\PRJ_HAARDCraft\\HAARDCraft_JFlight\\CAD\\Engine mount\\motor_mount.iam' ] },
{ type: 'error',
code: 'ATF-1026',
message:
[ 'The file: {0} is empty.',
'C:/worker/viewing-inventor-lmv/tmp/job-1/68/output/1/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.svf' ] } ],
size: 27864,
progress: 'complete',
success: '100%',
hasThumbnail: 'false',
children:
[ { guid: '6dc4b244-8a47-4a75-bcb3-811dc7b4f294',
type: 'resource',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/1/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.svf',
role: 'graphics',
mime: 'application/autodesk-svf',
size: 27864 } ] },
{ guid: '9bb1adbe-d9d9-4482-ac03-1d60bb0aea36',
type: 'resource',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/1/properties.db',
role: 'Autodesk.CloudPlatform.PropertyDatabase',
mime: 'application/autodesk-db',
status: 'success',
size: 24576 } ] },
{ guid: '039c2bcf-beb7-426b-916c-4a5adb814593',
type: 'resource',
role: 'Autodesk.CloudPlatform.DesignDescription',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/xref/designDescription.json',
mime: 'application/json' } ] } ] }
Using the same code path I can successfully render an assembly with non-assembly child parts that have been set using setreference, but when rendering an assembly with child assemblies, setreference doesn't seem to set the references to the child assembly files successfully. Is there something wrong in my sequence for setting references to child assemblies?
I discussed with #sabrehage and finally got the working codes.
firstly, it is recommended to use Forge Derivative API v2 (zip + specify root file only), by which, the API user does not need to specify the references explicitly.
If you still want to use Forge Derivative API v1, the following is the note:
In local Inventor, the file references are managed by Inventor Project. Inventor will look for the ref files firstly in the specific folders of the Project, then look for the relative paths. Obviously, when the files are uploaded to bucket of Forge, no project file, all files are in the same level in physical perspective. So in v1, it depends on the reference file that the sender specifies.
If the hierarchy is like:
Top Assembly.iam
part1.ipt
part2.ipt
The reference file can be simply composed like what is mentioned in the blog:
http://adndevblog.typepad.com/cloud_and_mobile/2015/09/how-to-set-references-with-inventor-files-for-view-and-data-api.html.
In the dataset of #sabrehagen, the hierarchy contains nested assemblies, even in sub folder:
topassemb.iam
part in top assemb.ipt
subassem folder
subassem.iam
part1 in sub assem1.ipt
part2 in sub assem1.ipt
The correct way is to specify in one call (for top assembly only), and specify the subfolder in the reference map. In addition, we should define path name with original name, instead of that has been URL encoded. i.e.
{
"master" : "urn:adsk.objects:os.object:adsk2017-8/topassemb.iam",
"dependencies" : [
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/subassem.iam",
"metadata" : {
"childPath" : "subassem/subassem.iam",
"parentPath" : "topassemb.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part1%20in%20sub%20assem1.ipt",
"metadata" : {
"childPath" : "part1 in sub assem1.ipt",
"parentPath" : "subassem/subassem.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part2%20in%20sub%20assem1.ipt",
"metadata" : {
"childPath" : "part2 in sub assem1.ipt",
"parentPath" : "subassem/subassem.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part%20in%20top%20assemb.ipt",
"metadata" : {
"childPath" : "part in top assemb.ipt",
"parentPath" : "topassemb.iam"
}
}
]
}
If without specifying subfolder, Forge thinks all files are within the same level, but it conflicts to the hierarchy of the last saving (absolute path). So it failed to find the corresponding files in the bucket.
After Forge gets the files and correct reference, it will look at the reference file and create the subfolders if they are specified, then put those files to the subfolder from bucket, finally translate.
as I remember, you would also need to configure the parts in the web service of set reference. This is a blog: http://adndevblog.typepad.com/cloud_and_mobile/2015/09/how-to-set-references-with-inventor-files-for-view-and-data-api.html. probably it could help you to diagnose the issue.
But, I strongly suggest you migrate to v2, by which you do not need to set reference manually. you can just upload all dataset as a zip file and set which file is the top (root) file, Forge will analyze the hierarchy automatically. This is another blog: http://adndevblog.typepad.com/cloud_and_mobile/2016/07/translate-referenced-files-by-derivative-api.html