Giter Site home page Giter Site logo

autodesk-forge / learn.forge.designautomation Goto Github PK

View Code? Open in Web Editor NEW
39.0 16.0 40.0 10.8 MB

Learn Forge Tutorial: Modify your models using Design Automation (AutoCAD, Inventor, Revit & 3dsMax). Available in .NET and Nodejs.

Home Page: http://learnforge.autodesk.io

License: MIT License

C# 84.05% HTML 7.52% JavaScript 8.43%

learn.forge.designautomation's Introduction

learn.forge.designautomation

Description

This sample is (will be) part of the Learn Forge tutorials.

It includes 5 modules:

  • .NET Framework plugins for AutoCAD, Inventor, Revit and 3dsMax. See each readme for plugin details.
  • .NET Core web interface to invoke Design Automation v3 and show results. See readme for more information.

The designautomation.sln include all 4 bundles and the webapp, you may unload those project that are not of interest. The BUILD action copy all files to the bundle folder, generate a .zip and copy to the webapp folder. It requires 7-zip tool.

learn.forge.designautomation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn.forge.designautomation's Issues

if using Forge SDK 0.9.0, uploadObject failed with the error "The "chunk" argument must be of type string or an instance of Buffer"

from SO post: https://stackoverflow.com/questions/72420952/forge-design-automation-revit-tutorial-error

In current version, the tutorial uses version 0.8.5 of Forge SDK (https://www.npmjs.com/package/forge-apis). if upgrading to 0.9.0, the exception will occur at
https://github.com/Autodesk-Forge/learn.forge.designautomation/blob/nodejs/routes/DesignAutomation.js#L508-L511

i.e. if createeadStream, it will cause exception. After switching to readFileSync, it works now.

` // 2. upload inputFile

  const inputFileNameOSS = `${new Date().toISOString().replace(/[- 
    T:\.Z]/gm, '').substring(0, 
   14)}_input_${_path.basename(req.file.originalname)}`; // avoid overriding

try {

    //let contentStream = _fs.createReadStream(req.file.path);

    let fileContent =  _fs.readFileSync(req.file.path);

    await new ForgeAPI.ObjectsApi().uploadObject(bucketKey, 
   inputFileNameOSS, req.file.size, fileContent, {}, req.oauth_client, 
   req.oauth_token);

    }

`

Upload bundle code needs to propagate exception

If our tutorial can handle errors and report back to the customer that the app bundle could not be uploaded, the developer would know where the error would help them troubleshoot quickly.

.NET code needs review

Need to investigate how Nodejs is handling it.

README in nodejs branch should be branch-aware in the git instructions

This suggestion could help people who aren't familiar with the branches that exist in this repo. Following the instructions here
https://github.com/Autodesk-Forge/learn.forge.designautomation/tree/nodejs

I run the git clone invocation as suggested. This generates files on my machine for the master branch. I can't complete the next npm install instruction.

I suggest for the README in the nodejs branch, we add something like instructions to type
git checkout origin/nodejs
git branch nodejs

This helped me follow all the instructions until I started looking for the sample files. They are in the master branch.
I don't know if there's a way to simplify this for people to ease the beginner path to success.

About text

The About text for this repo doesn't mention nodejs. Perhaps it should say:

About
Learn Forge Tutorial: Modify your models using Design Automation (AutoCAD, Inventor, Revit & 3dsMax). Available in .NET and nodejs.

This might seem like a small detail but having navigated from the nodejs link on this page,
https://learnforge.autodesk.io/#/tutorials/modifymodels
the About text made me wonder if I had landed in the right place.

Deploy Project Instructions

When customers want to Deploy this project to AWS, Azure or Heroku, we are missing information on what kind of ENV are needed for it. Locally we use ngrok but what about when deploying?

Response status code does not indicate success: 401 (Unauthorized).

Hello!
When I launch the application I see in my browser in the Configure window the list of AppBundles but I do not see the list of engines
I tried to debug it and as it turned out in this row:

Page engines = await _designAutomation.GetEnginesAsync()

in Value column of the Watch window I see this:

"The function evaluation requires all threads to run".

When I step over\into this row it miss next rows of the code but the application runs anyway. In the black window I see an error:

Hosting environment: Development
Content root path: C:\Users\admin\Documents\GitHub\learn.forge.designautomation\forgesample
Now listening on: http://localhost:3000
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLOEQ022D0V4", Request id "0HLOEQ022D0V4:00000001": An unhandled exception was thrown by the application.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).

As I told when I tap Configure the window opens but there is no the list of engines..
Could you comment on this, please

Best regards,
Pavel

Created DirectShape is not extracted through forge.

Hello,
I generated (in debug mode an addin) DirectShape as a Volume of a Room as in:
https://github.com/jeremytammik/RoomVolumeDirectShape

Rooms are generated and REVIT file is saved correctly, then I send it to FORGE for processing and I extract Model View Metadata Properties (mvmp) and the OBJ.

The issue is that MVMP does not contain any information of recently generated room volumes, the object is:

DirectShape ds = DirectShape.CreateElement(doc, _id_category_for_direct_shape);

                    ds.ApplicationId = id_addin;
                    ds.ApplicationDataId = r.UniqueId;
                    ds.SetShape(geo.ToList<GeometryObject>());
                    ds.get_Parameter(_bip_properties).Set(json);
                    ds.Name = "Room_Max_is_an_okayish_dev_" + r.Name;

The question here is: how should I modify it so it will be included in the extraction mvmp.json?
I suspect I need to tag it somehow or add it to some sort of collection.

Please help.
Thank you in advance.

EDIT:
I suspect this is highly related to my issue:
https://thebuildingcoder.typepad.com/blog/2019/05/generate-directshape-element-to-represent-room-volume.html#9.3
But I dont know how to change this phase. This might be what I need?

Also autodesk viewer will not display this DirectShapes created through addin.

Workitem works randomly and sometimes dont upload file

Hi,

I've made the tutorial and used this code (.net core), sometimes it works fine, but then it just stop working :

  1. got message "Uploading input file..." then nothing happends
  2. sometimes the file uploads then nothing happends

Any idea ? thanks in advance

gitignore should ignore uploaded binaries

Just a small issue, this one. Maybe a typo to fix in gitignore.

I'm following the nodejs tutorial and seeing binary files get added to a folder on my machine called 'uploads'.
The gitignore file names a folder to ignore called 'upload'.

Perhaps either the gitignore file should be changed, or this line in DesignAutomation.js?
router.post('/forge/designautomation/workitems', multer({
dest: 'uploads/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.