for families & shapes with same name.
can it override existing ones automatically?
|
for families & shapes with same name.
can it override existing ones automatically?
you may have to use event handler, something like:
application.DialogBoxShowing += new EventHandler<DialogBoxShowingEventArgs>(myDialogBoxShowing);
...
thanks Joe, you're way ahead of me in event handling...
what will this do?
this will supress dialogue box when you update your family, etc.
otherwise, you'll have to click your way out during your API running session.
cool thanks I will try that!
in 2011 you have argument options to overide the dialogue box in the familyload function, a nice new feature ADSK added. I dont think that exist in the 2010 API.
thanks I'll keep that in mind for the next code revision.
I managed to intercept the dialog events:
public static void mydialbox(object src,Autodesk.Revit.Events.DialogBoxShowingEventArgs rara )
{
}
and in the main function
app.DialogBoxShowing += new EventHandler<Autodesk.Revit.Events.DialogBoxShowingEventArgs>(mydialbox);
Using the overrideresult method in the delegate invariably yields a cancellation of the dialog box...whereas I want to simulate the user pressing OK.
bool overy = rara.OverrideResult(some number here, does it matter?);
Yes, it matters. Any non-zero quantity is equivalent to canceling the dialog.
However you'll want to use a build in constant instead as it's more descriptive and makes your code easier to maintain. Put the following in it's place instead. Intillisense will give you some other common result options like "YES" and "NO".
Code:bool overy = rara.OverrideResult(System.Windows.Forms.DialogResult.OK)
Thanks Abe, but it doesn't work says:
"Argument '1': cannot convert from 'System.Windows.Forms.DialogResult' to 'int'"