DevDays in Milano, Links, Textures, UR4 vs R2

Today we are holding the last Western European DevDays conference in Milano before the winter break.

The Milano meetups last night met with great interest and enthusiasm, so I will probably be returning here next year to present and conduct workshops on the Autodesk View and Data API in more depth.

Right now, we are in the middle of Jim's morning session:

DevDays conference in Milano

Independently of that, here are a few other miscellaneous topics that cropped up in the past few days:

Loading and Unloading Revit Links

Question: How can I 'reload from' or 'remove' a link?

All I can see is ReloadLatest.

Answer: I would suggest starting by looking at the Revit API help file RevitAPI.chm. Have you done that?

I looked at the Document.ReloadLatest method that fetches changes from central (due to one or more synchronisations with central) and merges them into the current session.

That has to do with central files, not links.

Searching a bit further for 'link', 'load', etc., I discovered the RevitLinkType.Load method that loads or reloads the Revit link from its currently-stored location.

It also provides the RevitLinkType.Unload method that unloads the Revit link.

Could that be what you are looking for?

This functionality was introduced in the Revit 2014 API; search for 'enhancements to interactions with links'.

Here is another aspect of removing RVT links.

You might also want to take a look at the link API additions in the Revit API 2015 news.

Currently No Programmatic Texture Assignment

I recently discussed DirectShape texture assignment, leading to this obvious follow-up query:

Question: Thanks for the answer, it was very helpful!

I used the TessellatedFace.MaterialId method and it works well.

I now have a few follow-up questions: How can I rotate and scale a material (texture) on a face? Is there a way to map a texture to a face, like mapping texture coordinates [u,v] to face coordinates [x,y,z]? How does Revit map a material (texture) to a face?

Answer: In the UI, you can affect the texture mapping by selecting the material asset in the Materials dialogue, clicking the Appearance tab, clicking the pull-down to the right of the Image display, clicking Edit Image, and editing the properties of that image.

I am sorry to report that there is currently no API support for setting these properties, just as there is no API support for editing visual material properties in general.

Unfortunately, material manipulation is currently programmatically inaccessible.

By the way, talking about DirectShape elements, you absolutely have to check out DirectObjLoader, my new OBJ to DirectShape import utility add-in.

Revit 2015 R2 and UR API Updates

The Revit 2015 R2 subscription release included both new product functionality and some API enhancements, which led to the updated SDKs for Revit 2015 R2 and UR4 and the following query:

Question: How do I tell which SDK to choose for download?

Answer: Which SDK you choose is pretty irrelevant. It only contains documentation and sample code.

The Revit API .NET assembly DLLs provide the actual API, and they are all included with the Revit installation.

There are only some minute enhancements in Revit 2015 R2 over Revit 2015, e.g. access to the Workflow.Create and modification methods, as discussed in the Revit API discussion forum threads on worksets and R2 vs. UR4.

All the rest is identical.