Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: RS2010 - automatically override existing families when loading new ones?

  1. #1
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default RS2010 - automatically override existing families when loading new ones?

    for families & shapes with same name.
    can it override existing ones automatically?

  2. #2
    All AUGI, all the time
    Join Date
    2006-08
    Posts
    636
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    you may have to use event handler, something like:
    application.DialogBoxShowing += new EventHandler<DialogBoxShowingEventArgs>(myDialogBoxShowing);
    ...

  3. #3
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    thanks Joe, you're way ahead of me in event handling...
    what will this do?

  4. #4
    All AUGI, all the time
    Join Date
    2006-08
    Posts
    636
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    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.

  5. #5
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    cool thanks I will try that!

  6. #6
    I could stop if I wanted to
    Join Date
    2007-12
    Location
    Las Vegas, NV
    Posts
    236
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    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.

  7. #7
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    thanks I'll keep that in mind for the next code revision.

  8. #8
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    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?);

  9. #9
    Active Member
    Join Date
    2008-02
    Posts
    58
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    Quote Originally Posted by mpruna View Post
    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)

  10. #10
    Active Member
    Join Date
    2008-02
    Location
    New York
    Posts
    81
    Login to Give a bone
    0

    Default Re: RS2010 - automatically override existing families when loading new ones?

    Thanks Abe, but it doesn't work says:

    "Argument '1': cannot convert from 'System.Windows.Forms.DialogResult' to 'int'"

Page 1 of 2 12 LastLast

Similar Threads

  1. 2012: inserting text into the text override field automatically?
    By MikeB6599 in forum AutoCAD General
    Replies: 28
    Last Post: 2014-12-23, 03:46 AM
  2. Loading a Lisp Automatically Only In Select Drawings
    By gabecottam428011 in forum AutoLISP
    Replies: 10
    Last Post: 2010-08-11, 01:03 AM
  3. disable / override existing Revit command
    By Ning Zhou in forum Revit - API
    Replies: 2
    Last Post: 2010-06-23, 07:20 PM
  4. Loading An Existing Air Terminal Family
    By elaforge in forum Revit MEP - General
    Replies: 0
    Last Post: 2007-12-06, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •