RevitTricks
A blog on everyday issues in revit and the solutions I have found to keep moving forward.
Thursday, May 23, 2013
Applied Software Blog: Revit 2014 NEW Feature.... WOW!
Wednesday, May 22, 2013
Google earth, Revit and a CSV for some quick geomancy topography for Revit
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
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
Do U Revit?: Revit Server goes Desktop
A good article on setting up a 'home' version of Revit Server without windows server.
Friday, April 12, 2013
Revit On Startup (Internal macros)
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
Wednesday, January 30, 2013
Powerpoint 2007 - saving to *.PPTX
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
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.
Tuesday, August 21, 2012
Saturday, July 14, 2012
Chronicle: Capture, Exploration, and Playback of Document Workflow Histories - Publications - Autodesk Research
Chronicle: Capture, Exploration, and Playback of Document Workflow Histories - Publications - Autodesk Research
Paper
Chronicle: Capture, Exploration, and Playback of Document Workflow Histories
UIST 2010 Conference Proceedings:
ACM Symposium on User Interface Software & Technology.
pp. 143 - 152.
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. |
Saturday, June 23, 2012
Officeless offices
Live Webcast: Work Anywhere: Collaboration and the Future of Technology| Webcasts | TechRepublic
http://www.techrepublic.com/webcasts/live-webcast-work-anywhere-collaboration-and-the-future-of-technology/4371661?promo=550&trial=25525660&tag=wpzd
Cost of server vs virtulization
The Voodoo Economics of Hypervisors | ZDNet
http://www.zdnet.com/blog/btl/the-voodoo-economics-of-hypervisors/79784?tag=nl.e539
Tuesday, June 12, 2012
Newforma
and Tricks
http://www.aecbytes.com/tipsandtricks/2012/issue62-newforma.html

