AEC DevBlog

Web Name: AEC DevBlog

WebSite: http://adndevblog.typepad.com

ID:83513

Keywords:

AEC,DevBlog,programming,autodesk,AEC,Revit,BIM,developer,.NET

Description:

By Xiaodong LiangAs usual, SDK of Navisworks 2021 has been posted on ADNOpen:https://www.autodesk.com/developer-network/platform-technologies/navisworksThis SDK still keeps the similar contents like previous releases: materials of NET API, NWCreate API and COM API. Each of these materials includes samples and API documents:A few notes:Navisworks 2021 is built against .NET Framework 4.7, which means the application with NET API supports .NET Framework 4.7 and above. The program will need to be compiled by Visual Studio 2019 and .NET Framework 4.7 and above.The developer guide in NET API document has not been updated with the demo by latest Visual Studio and Framework, but the basic skeleton of plugin, net control and automation are not changed. The NET API samples can also be a reference on how the application is built.The samples of NWCreate API configures to link the NWCreate lib with general name(say nwcreate.lib), but SDK names it with specific version number `nwcreate_18.lib`. So it will need to change the names manually, either sample project configuration or file name in SDK.COM API samples are still available, but they base on raw COM API libraries. While some features of COM API are available with NET API already. If your program is also built by raw COM API, we encourage migrating to NET API , or plus COM Interop(if NET API has not supported), if they could fit the same requirement. As always, please raise any questions on Navisworks API forum, or through ADN portal, or leave a message with this post. By Xiaodong LiangThere is a parameter roll in UI [Edit Current Viewpoint]. It means rotating the camera around its front-to-back axis. A positive value rotates the camera counterclockwise, and a negative value rotates it clockwise.In API perspective, a rotation around world axes (WCS) is configured by Viewpoint.Rotation (Rotation3D) which is in 3D space defined as a quaternion. From quaternion, it can also tell something like roll, yaw, pitch. One post kindly provides the mathematical equations:https://answers.unity.com/questions/416169/finding-pitchrollyaw-from-quaternions.htmlThese are defined in aircraft principal axes. In Navisworks space, when the up vector is Y+, right vector is X+, and view direction is Z-, the roll can be calculated from quaternion (Viewpoint.Rotation) by the equations above. However, in other cases when the up vector is different, roll in UI means what it indicates: rotating the camera around its front-to-back axis. Unfortunately, I do not find any API which tells roll in UI.While in math, once we know the base up vector, current up vector, we can calculate the roll ourselves.Viewpoint.WorldUpVector: initial base up vector when user [Set Viewpoint Up]Viewpoint.GetCamera(): a json string which contains many information such ascurrent up vectorcurrent view direction (reversed vector of forward vector)since view direction will keep the same when setting roll, the roll value will be the angle from current right to the base right (aligned with initial up vector). The code below prints out the roll in aircraft principal axes and the roll in Navisworks UI. [Serializable] public class cameraInfoClass public double[] UpDirection { get; set; } public double[] WorldRightDirection { get; set; } public double[] ViewDirection { get; set; } public override int Execute(params string[] parameters) //current viewpoint Viewpoint oViewpoint = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentViewpoint; //current world up vector. The vector defined by user. //Same to UI [Edit Viewpoint] UnitVector3D worldUpVec = null; if (oViewpoint.HasWorldUpVector) worldUpVec = oViewpoint.WorldUpVector; else return 0; //A rotation in 3D space defined as a quaternion. Rotation3D rotation = oViewpoint.Rotation; //***** //Aircraft principal axes: X+: right, Y+: up, Z-: view direction // roll: around Z- // pitch: around X+ // yaw: around X+ //from https://answers.unity.com/questions/416169/finding-pitchrollyaw-from-quaternions.html //roll = Mathf.Atan2(2*y*w - 2*x*z, 1 - 2*y*y - 2*z*z); //pitch = Mathf.Atan2(2 * x * w - 2 * y * z, 1 - 2 * x * x - 2 * z * z); //yaw = Mathf.Asin(2 * x * y + 2 * z * w); double aircraft_roll = Math.Atan2((2 * rotation.B * rotation.D) - (2 * rotation.A * rotation.C), 1 - (2 * rotation.B * rotation.B) - (2 * rotation.C * rotation.C)); double aircraft_roll_degree = aircraft_roll * 180 / Math.PI; double aircraft_pitch = Math.Atan2((2 * rotation.A * rotation.D) - (2 * rotation.B * rotation.C), 1 - (2 * rotation.A * rotation.A) - (2 * rotation.C * rotation.C)); double aircraft_pitch_degree = aircraft_pitch * 180 / Math.PI; double aircraft_yaw = Math.Asin((2 * rotation.A * rotation.B) + (2 * rotation.C * rotation.D)); double aircraft_yaw_degree = aircraft_yaw * 180 / Math.PI; //***** //get camera parameters which contains more data we need to calculate roll of Navisworks UI string cameraStr = oViewpoint.GetCamera(); cameraInfoClass cameraStrJson = JsonConvert.DeserializeObject(cameraStr); //current up vector Vector3D currentUpVec = new Vector3D(cameraStrJson.UpDirection[0], cameraStrJson.UpDirection[1], cameraStrJson.UpDirection[2]); Vector3D currentViewDir = new Vector3D(-cameraStrJson.ViewDirection[0], -cameraStrJson.ViewDirection[1], -cameraStrJson.ViewDirection[2]); //current right vector Vector3D currentRightVec = currentUpVec.Cross(currentViewDir); //current world right vector is when the viewpoint //is aligned with an intial up vector.Initially, roll of UI is 0 Vector3D currentWorldRightVec = worldUpVec.Cross(currentViewDir); //get roll of UI in degree double UI_roll_degree = currentRightVec.Angle(currentWorldRightVec) * 180 / Math.PI; MessageBox.Show( aircraft_roll: + aircraft_roll + \naircraft_pitch: + aircraft_pitch_degree + \naircraft_yaw: + aircraft_yaw_degree + \nUI roll: + UI_roll_degree); By Xiaodong LiangIt has been known by how to Get primitive from solid of Navisworks. Because there is not native NET API, we will need to take advantage of COM Interop. While COM Interop means managed-native transitions, which will cause lot of the slowness when the model is huge. So geometry extraction should be faster if it is all pure COM code. In another word, some unmanaged COM code could potentially be quicker.So I tried to make some codes. These are two plugins, one is written C++/CLI code (by raw COM), another is NET code (by COM Interop). The stats of some sample Navisworks models and one customer specific model.https://github.com/xiaodongliang/Navisworks-Geometry-Primitives The projects are built on Visual Studio 2017 (v15.7.5), Navisworks 2018, Win 10 in Windows Parallel of macOS Sierra version 10.12.6Note: with pure COM project, build it and execute the button in release mode. This is typical for performance testing. If in debugging mode, it will be extremely slow. By Xiaodong LiangThis is an update on Persistent item ID of Navisworks objects:What IDs are available depend on the file format you’re loading into Navisworks. Some file formats don’t have any per objects ids, some have ids but they aren’t stable (edit the file in some unrelated way and the ids change). Most of these ids are only unique within a file. Whatever ids are there show up as object properties which are different depending on format – Entity Handle for Autocad, Element Id for Revit, etc.In addition Navisworks has support for a per object GUID which is a stable, globally unique id for an object: ModelItem.InstanceGuid. GUIDs exist for file formats which directly support GUIDs (e.g. IFC) and for some file formats where we can generate stable, globally unique ids based on the file format specific ids. This includes AutoCAD and Revit but not Catia, PDMS or Integraph. So, for such file formats: you would have to rely on custom properties that the creator of the design file has setup.The below is a demo of IFC file: Are you ready to learn aboutthenew technologies that will become available on theForgeplatform?Then you should not miss these webinars :)Date :26th April 2018Time :8.00 AM PSTDuration : 90 minutesTitle :The Future of Making Things on Forge: Sneak Peek at Forge NextGen (HFDM App Framework)Registration Link:https://attendee.gotowebinar.com/register/8209398405782333955Presenter: Lior Gerling, Sr. Product Manager Forge PlatformDate :May 9th 2018Time :8.00 AM PSTDuration : 90 minutesTitle :A technical introduction to Forge High Frequency Data Management (HFDM) SDK and Forge App FrameworkRegistration Link:https://attendee.gotowebinar.com/register/3624195224359611394Presenter: Kai Schroeder, Engineering Manager, Forge Platform The Forge team is accepting proposals for the upcoming Accelerator taking place in the Autodesk Boston office from April 30 - May 4, 2018.It is a great opportunity for your software development team to learn and work intensively on a Forge-based project with one-on-one support and advice from Autodesk Forge API experts. If you have an idea for a new web or mobile application based on Autodesk Forge APIs, or you need help getting an existing application working, then come along to the event. There is no cost to attend the Accelerator other than your own travel and living expenses. However, we do ask that you submit a proposal as part of your application so that we can verify that the intended use of the Autodesk Forge APIs in your project is feasible.Apply and submit your proposal here. For more information, please visit the Forge Accelerator website. Have you registered for Forge DevCon at AU 2017 Las Vegas? If you haven’t and planning to come, here are a few pointers to register. (It may not be obvious how to add DevCon afterward.):Register to Forge DevCon through the AU registration page.Combined ticket includes Forge DevCon – $2,175Forge DevCon standalone ticket – $295(AU is very expensive, isn’t it?)You can add to the AU full price ticket – $95Call customer service at call 888-371-1722 (toll-free in the United States) or 415-446-7717.Or send an email to customer service autodeskuniversity@autodeskevents.com.They will add for you.For more detail about what Forge DevCon is about, please take a look at this post. If you are interested in finding out list of AEC focused Forge classes, please take a look at my another post. By Virupaksha AithalADN team is hiring an DevTech engineer (C++, .NET) - based in Bangalore office. Main responsibility is to work directly with third party developers to help them solve their problems using AutoCAD or Inventor or Revit API.Requirement: Strong programming experience (C++/.NET). Knowledge of developing applications for AutoCAD or Revit or Inventor.Location: Bangalore, IndiaIf interested, send your resumes to Virupaksha Aithal We are excited to announce the Autodesk® App Store BIM 360 Hackathon – a virtual web based event. This hackathon is a great way to quickly climb the BIM 360+Forge API integration learning curve with Autodesk engineers close at hand (virtually).Now is a great time to get started working on integration with BIM 360 – with the new ability to create your own folders in BIM 360 using Forge just enabled in the last week. You can now quickly and easily build a “presence” for your company and apps data within BIM 360. During the hackathon introduction webinar on August 15th, we’ll be talking about what you can do right now to integrate with BIM 360. The Autodesk® App Store BIM 360 Hackathon consists of two segments:A series of web training sessions related to the Autodesk Forge platform and BIM 360 - open to anyone interested in learning about these APIs.An online hackathon where developers can develop new apps that integrate with BIM 360 for submission to Autodesk App Store.This is an online hackathon so you can participate from anywhere in the world on your own schedule. There’s no cost to participate—but there is a reward! You may find yourself quickly building an app that works with BIM 360—and if you submit it to the App Store by September 30 and it is accepted for publication by October 31 you will receive $500 for one eligible app per entrant. Another reason to work on BIM 360 integration sooner rather than later is that we’ll be launching a BIM 360 app “Showcase” on www.autodesk.com plus a BIM 360 app storefront in the Autodesk App Store in the next few weeks. Both offer a great way to get maximum exposure for your business with Autodesk BIM 360 customers (when there are just a few dozen apps so you don’t risk getting lost in the crowd later when there are hundreds of apps).You may attend the educational webinars without publishing an app. Click here for Webinar only registration or get full details and register for the Hackathon at https://bim360hackathon.devpost.com/. If you register for the Hackathon you be will automatically registered for the webinars. Webinar s will be recorded so that you can view them at your convenience.Visit the pages on the Hackathon website to learn more about the opportunities, resources and publishing in the Autodesk App Store and if you have questions send us an email. By Madhukar MoogalaWhile I was learning Revit API through SDK samples, I see there is a huge Samples folder with about 180 project files.I thought it will be good idea to quickly update the references of each project to correct Revit install folder.There is an executable which does this and is included in SDK samples folder, for some reason it is not working for me.I created a simple python script, which creates an .User object file having Projects references directed to Revit path. #This simple app creates .user file corresponding to every .csproj | .vbproj##With following text# ?xml version="1.0" encoding="utf-8"?># Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"># PropertyGroup># ReferencePath>D:\Program Files\Autodesk\Revit 2018\ /ReferencePath># /PropertyGroup># /Project>#Created by moogalm(@galakar), ADN, Autodesk.import os,shutilimport xml.etree.ElementTree as ETrevitSampleDir = input("Revit SDK Samples Folder, for E.g \"D:\Revit2018\Samples\" :")#"D:\\Revit 2018 SDK\\Samples"userFile = revitSampleDir+"\\user.txt"#"D:\\Revit 2018 SDK\\Samples\\user.txt"revitInstallDir = input("Revit Install Folder :")#"D:\\Program Files\\Autodesk\\Revit 2018\\"project = ET.Element("Project",ToolsVersion="14.0",xmlns="http://schemas.microsoft.com/developer/msbuild/2003")propertyGroup = ET.SubElement(project,"PropertyGroup")referencePath = ET.SubElement(propertyGroup,"ReferencePath").text = revitInstallDirtree = ET.ElementTree(project)tree.write(userFile, encoding='utf-8',xml_declaration=True,method= 'xml')for root, dirs, files in os.walk(revitSampleDir): for filename in files: if filename.endswith(('.csproj', '.vbproj')): shutil.copy(userFile,os.path.join(root,filename +".user")) print(os.path.join(root,filename +".user")) ADN DevBlog - AECOur DevBlog for Revit, Navisworks, AEC and BIM technology APIs. ADN DevBlog - AutoCADOur DevBlog for AutoCAD and other platform technology APIs. Forge Developer BlogOur DevBlog for Cloud and Mobile technologies with a strong emphasis on the Autodesk Forge APIs. ADN DevBlog - Infrastructure ModelingOur DevBlog for Infrastructure Modeling technology APIs. ADN DevBlog - ManufacturingOur DevBlog for Design, Lifecycle and Simulation technologies. Around the CornerCyrille Fauvel's Maya platform developer blog - Autodesk Media and Entertainment technology. Civilized DevelopmentIsaac Rodriguez's AutoCAD Civil 3D developer blog Dances with ElephantsJim Quanci's blog on partnering with large companies. It's All Just Ones and ZerosDoug Redmond's Vault developer blog Mod the MachineBrian Ekins' and Adam Nagy's Inventor developer blog The 360 View Mikako Harada's BIM 360 developer blog The 3D Web CoderJeremy Tammik's web and mobile programming blog The Building CoderJeremy Tammik's Revit developer blog Through the InterfaceKean Walmsley's AutoCAD developer blog Yet more on autodesk.com ...Central blog list on autodesk.com

TAGS:AEC DevBlog programming autodesk AEC Revit BIM developer .NET

<<< Thank you for your visit >>>

The resource for software developers working with Revit, Navisworks and other AEC and BIM technologies from Autodesk.

Websites to related :
Welcome to www.rowand.net!

  This website is for hosting the various pieces of information the Rowand clan has deemed interesting enough to put up on a web site. Each link below i

Tout sur le trip-hop, de l'actua

  Les dernières "grosses" sortiesMounika. - I need spaceDe la tendresse bordel ! A l'heure o le monde repart comme il s' tait arr t , toute allure. A l

Не удается подкюч

  Не удается подкючиться к базе данных фронтол - Узнать город по номеру моб - ENMIFORGE.MAGI

InternetActu.net | Pour compren

  ArticlesChine : l intelligence artificielle, porte d entrée de la dictature de surveillance ? Dans leur livre (voir notre critique), La nouvelle guer

Glassless Dance Mirrors | DanceM

  Mirrorlite™ Genuine Glassless Mirrors The Ultimate Choice for Mirrored Ceilings & Walls(and the only brand of Glassless Mirror to receive a UL safety

tabsir.net

  Sat 7 Apr 2018Blogging on MENA TIDNINGENPosted by tabsir under UncategorizedComments Off on Blogging on MENA TIDNINGEN Dear Friends of Tabsir,If you w

Lambda the Ultimate | Programmin

  Mar Hicks. Built to Last. Logic. Issue 11, "Care". It was this austerity-driven lack of investment in people—rather than the handy fiction, peddled b

Poetry @ ELCore.Net

  Webpage 2000-2002 ELCLane Core Jr. (lane@elcore.net)http://poetry.elcore.net/index.htmlCreated November 21, 2000; revised December22,2002.

TrawlerPictures.net

  Javascript Disabled Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functi

AECOM | Asociación Española pa

  Desde la Asociación Española para el Estudio de los Errores Innatos del Metabolismo (AECOM) y la Sociedad Española de Errores Innatos del Metabolis

ads

Hot Websites