Thursday, May 23, 2013

Applied Software Blog: Revit 2014 NEW Feature.... WOW!

Applied Software Blog: Revit 2014 NEW Feature.... WOW!: Controlling the Selection of Elements So what is one of the new features in Revit 2014 that made me think "Wow, I didn't know I w...

Wednesday, May 22, 2013

Google earth, Revit and a CSV for some quick geomancy topography for Revit

USGS Web Query VIA Google earth-

I had a request by a friend to update this- I need to get my programming skills more in tune with an independent app. If you make any changes or additions please email me back. This is not for distribution and is for reference purposes only : )

If anyone uses this, please drop me a line back. If you want to change it and adapt it please send the changes and adaptations back here so we can share it back!

https://docs.google.com/file/d/0B3kxZYz7z9XSS0VxX1RUSTVlbUk/edit?usp=sharing



buildz: Louvers that know their orientation

This could be helpful... Need to research if there is a programming component to this- would be relatively easy to set a model component with a hosted tag set to align with element in the tag to keep a tru north/magnetic north pointing the correct way...

Or for that matter - look for view ports and adjust the view title accordingly...

buildz: Louvers that know their orientation: "http://funxploration.blogspot.com/2011/08/self-adjusted-opening-panels.html"


Fun Xploration: Self Adjusted Panel Openings:

'via Blog this'

Monday, May 6, 2013

Friday, April 12, 2013

Revit On Startup (Internal macros)

For follow up looking for a way to run a command once an addin is loaded into Revit or Navis Works. It is possible through the revit macros- still searching for an API version:

From: http://boostyourbim.wordpress.com/2013/01/06/using-module_startup-to-run-macro-code-when-revit-starts/

January 6, 2013


Using Module_Startup to run macro code when Revit starts

Filed under: Error Handling, PerformanceAdviser — harrymattison @ 10:00 am

In previous posts, I have recommended staying away from this code that Revit creates in your macro file. Now I will explain a situation when we need to get into it.



private void Module_Startup(object sender, EventArgs e)

{

}The short summary is that code in Module_Startup runs automatically when Revit starts. It can be useful for subscribing to events, registering updaters for Dynamic Model Update, and for using the FailureDefinition.CreateFailureDefinition which is why it is relevant to this series of posts on PerformanceAdviser.



While working on a code sample to run a custom rule with the Performance Adviser, I ran the macro and Revit threw this exception:







The RevitAPI.chm help file tells us more about this restriction of FailureDefinition.CreateFailureDefinition:



The newly created FailureDefinition will be added to the FailureDefinitionRegistry. Because FailureDefinition could only be registered when Revit starting up, this function cannot be used after Revit has already started. Throws InvalidOperationException if invoked after Revit start-up is completed.



So we can’t start Revit normally and then, in the middle of our Revit session, run a macro that registers a FailureDefinition. Therefore we need a way to do this registration when Revit starts.



The Revit API Wiki provides the solution:



The Module_Startup method is called when a module loads and Module_Shutdown is called when a module unloads. For Application-level macro modules, Module Startup is called when Revit starts



So I move the code that calls CreateFailureDefinition from my RunRoomRule macro into Module_Startup. (RunRoomRule will be discussed in its own upcoming post). My Module_Startup now looks like this:



private void Module_Startup(object sender, EventArgs e)

{

// Get the one instance of PerformanceAdviser in the Application

PerformanceAdviser pa = PerformanceAdviser.GetPerformanceAdviser();



// Create an instance of the RoomNotEnclosed rule class. Calling the RoomNotEnclosed() constructor is what calls CreateFailureDefinition.

RoomNotEnclosed roomNotEnclosed = new RoomNotEnclosed();



// Add this roomNotEnclosed rule to the PerformanceAdviser

pa.AddRule( roomNotEnclosed.Id, roomNotEnclosed );

}But when I compile my macro code I get the same exception shown in the screenshot above! Why? Because, in addition to Module_Startup running when Revit starts, it is also called when the macro project is rebuilt.



This creates a bit of a puzzle. I need to move the code to Module_Startup to only have it run when Revit starts. But to do this I need to compile the macro in the middle of my Revit session. But compiling the code in the middle of the Revit session fails because it calls Module_Startup.



The way out of this situation is to add try/catch handling of this exception. I have written about try/catch before and noted that, in general, for this blog I am not going to catch every exception that might occur. But here I have no choice. The exception that occurs during compilation needs to be caught so that compilation can succeed. On startup, the exception will not occur because at that time it will be legal to call CreateFailureDefinition.



The final code is:



private void Module_Startup(object sender, EventArgs e)

{

try

{

// Get the one instance of PerformanceAdviser in the Application

PerformanceAdviser pa = PerformanceAdviser.GetPerformanceAdviser();



// Create an instance of the RoomNotEnclosed rule class

RoomNotEnclosed roomNotEnclosed = new RoomNotEnclosed();



// Add this roomNotEnclosed rule to the PerformanceAdviser

pa.AddRule( roomNotEnclosed.Id, roomNotEnclosed );

}

// Need to catch this exception because otherwise Revit will throw every time this is compiled because

// Module_Startup and Module_Shutdown are called when the macro project is compiled.

// And because the macro project will compile in the middle of the Revit session, calling RoomNotEnclosed()

// will throw because it calls CreateFailureDefinition

catch (Autodesk.Revit.Exceptions.ApplicationException)

{}

}

(In my initial code I was catching the InvalidOperationException which is the specific sub-class of Autodesk.Revit.Exceptions.ApplicationException that is thrown by CreateFailureDefinition. But there is also another exception to deal with, an ArgumentException that occurs when the failure definition id has already been used to register an existing failure definition. ApplicationException is the parent class of both InvalidOperationException and ArgumentException, so catching ApplicationException takes care of both cases)



jaw-dropping renderer: Indigo for Revit

Wonder how much CPU time it took to render?
http://www.indigorenderer.com/book/export/html/1239


Indigo 3.4 header image

Wednesday, January 30, 2013

Powerpoint 2007 - saving to *.PPTX

Ran into a hiccup in powerpoint 2007 when creating an automated import for navis works xml files- you can't save to pptx, and I didn't want the added macro stuff to go with each new file - so I dug and found this trick at +help.wugnet.com

Sub TestSaveas()
  SaveAs "c:\somefilepath\"
End sub

Private Sub SaveAs(fp As String)
   Dim dlgSaveAs As FileDialog
   Dim strMyFile As String

   Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
   With dlgSaveAs
       .InitialFileName = fp
       If .Show = -1 Then
           strMyFile = .SelectedItems(1)
           Application.ActivePresentation.SaveAs strMyFile
           'MsgBox strMyFile
           ''-- save your file to strMyFile here
       Else
           MsgBox "File not saved"
       End If
   End With
   dlgSaveAs.Execute
   Set dlgSaveAs = Nothing
End Sub

The execute is critical (and missing off microsoft's site) otherwise it throws a DLL error.


Wednesday, November 28, 2012

2013 Revit Server : Warping Constant

FROM:
http://www.appliedtg.com/techblog/index.php/2012/08/09/2013-revit-warping-error/


2013 Revit: Warping Constant: Troubleshooting Information Required

source : Autodesk Technical Support

Issue:

Revit 2013 message Warping Constant keeps popping up preventing the opening of a central file

excerpt from Autodesk Technical Support:

The error

Actually means “file not found”. The reason it displays improperly is a conflict between Revit and Windows. The most common cause for that error is that during the time period that the first Revit session creates the model on the server, but does not finish upload data yet, a second session of Revit tries to access it. Even though the user can see the file, it is not complete and should trigger a “File not found” error.

I have some questions that will help me troubleshoot this issue:

Does their server have DFS?

Are all machines accessing the central file the same way (same mapped driver letter vs. UNC)?

Does this happen in all files?

What operating system is their server running?

Please also reply with the journal file from a session where a user got that error.

Where are the workstations and servers physically located?

Are they on the same domain? If not, how are they connected?

What is the ping times to and from the workstations and server?

If you copy a file of similar size to and from the server using Windows Explorer, what is the actual throughput?



Other helpful files:
Provide the log files from the accelerators
Provide the project files

Observations and Analysis:

As I mentioned, there is a mismapping that can sometimes occur where Revit shouldsay “File Not Found” but instead says “Warping constant.” In both of the journals supplied by the user, there is a save to central that fails, followed by an attempt to sync with central. Since the central model on the server was not correctly saved, the SWC does not succeed. In both cases, the user should expect to receive a file not found message, but instead they get the warping constant one.
As for why the initial save failed; it looks like that in one case, it is because they are attempting to overwrite an existing central, which is not supported. In the other case, it looks like a network glitch in the middle of an operation.

If there is a network switch between the workstation and server, I would try resetting it. otherwise, when users get errors about not being able to save or sync, they should wait a minute or two then try the exact same operation again, not different operation.

Closing Remarks:

One thing we are starting to see with 2013 is that it has much more problems with WAN accelerators (Riverbed) than 2012 had. If you havea WAN accelerator, I would try exempting the Revit traffic from it to see if the behavior changes.

Saturday, July 14, 2012

Chronicle: Capture, Exploration, and Playback of Document Workflow Histories - Publications - Autodesk Research

A means for capturing workflow- a lot like
Chronicle: Capture, Exploration, and Playback of Document Workflow Histories - Publications - Autodesk Research


Paper

Chronicle: Capture, Exploration, and Playback of Document Workflow Histories
Tovi Grossman, Justin Matejka & George Fitzmaurice. (2010).
Chronicle: Capture, Exploration, and Playback of Document Workflow Histories
UIST 2010 Conference Proceedings:
ACM Symposium on User Interface Software & Technology.
pp. 143 - 152.

Active presenter does the same thing-http://atomisystems.com/activepresenter/ just need a means to organize the segments into a coherent database of help files.

Thursday, July 5, 2012

Fwd: New comment on "Is BIM (or more accurately, Revit) development really stagnating?"


LinkedIn Groups

 OSI (Open Systems Interconnection), similar to TCP-IP, is a communications model. < http://en.wikipedia.org/wiki/OSI_model > The Open Systems Interconnection (OSI) model is a product of the Open Systems Interconnection effort at the International Organization for Standardization. It is a prescription of characterising and standardising the functions of a communications system in terms of abstraction layers. Similar communication functions are grouped into logical layers. A layer serves the layer above it and is served by the layer below it.

How might this help us to make the world's building information easy to access? I'm not sure yet.

Posted by David "Joshua" Plager, AIA

Tuesday, June 12, 2012