Results 1 to 4 of 4

Thread: Class does not implement interface member!

  1. #1
    Active Member
    Join Date
    2009-04
    Posts
    85
    Login to Give a bone
    0

    Default Class does not implement interface member!

    Hi All,

    I am trying to implement the following code:

    Code:
    public class SampleFamilyLoadOptions : IFamilyLoadOptions
    {
        #region IFamilyLoadOptions Members
     
        public bool OnFamilyFound(bool familyInUse, ref bool overwriteParameterValues)
        {
            if (!familyInUse)
            {
                TaskDialog.Show("SampleFamilyLoadOptions", "The family has not been in use and will keep loading.");
     
                overwriteParameterValues = true;
                return true;
            }
            else
            {
                TaskDialog.Show("SampleFamilyLoadOptions", "The family has been in use but will still be loaded with existing parameters overwritten.");
     
                overwriteParameterValues = true;
                return true;
            }
        }
     
        public bool OnSharedFamilyFound(Family sharedFamily, bool familyInUse, ref FamilySource source, ref bool overwriteParameterValues)
        {
            if (!familyInUse)
            {
                TaskDialog.Show("SampleFamilyLoadOptions", "The shared family has not been in use and will keep loading.");
     
                source = FamilySource.Family;
                overwriteParameterValues = true;
                return true;
            }
            else
            {
                TaskDialog.Show("SampleFamilyLoadOptions", "The shared family has been in use but will still be loaded from the FamilySource with existing parameters overwritten.");
     
                source = FamilySource.Family;
                overwriteParameterValues = true;
                return true;
            }
        }
     
        #endregion
    }
    then I call it like this:

    Code:
    dbDoc.LoadFamily(file, new SampleFamilyLoadOptions(), out family);
    However, when I'm compiling, I got the following error messages:

    "Error 1 'FamilyContentExplorer.SampleFamilyLoadOptions' does not implement interface member 'Autodesk.Revit.DB.IFamilyLoadOptions.OnSharedFamilyFound(Autodesk.Revit.DB.Family, bool, out Autodesk.Revit.DB.FamilySource, out bool)'"

    "Error 2 'FamilyContentExplorer.SampleFamilyLoadOptions' does not implement interface member 'Autodesk.Revit.DB.IFamilyLoadOptions.OnFamilyFound(bool, out bool)'"


    What am I doing wrong?

    TIA,

    Buddy

  2. #2
    I could stop if I wanted to
    Join Date
    2007-07
    Location
    London, UK
    Posts
    361
    Login to Give a bone
    0

    Default Re: Class does not implement interface member!

    Using the ref modifiers instead of out?

  3. #3
    Active Member
    Join Date
    2009-04
    Posts
    85
    Login to Give a bone
    0

    Default Re: Class does not implement interface member!

    This is supposed to work like this for two reasons:

    1) Initially the call was:

    Code:
    dbDoc.LoadFamily(file, out family);
    and there was no problem.

    The Document.LoadFamily() method has also an overload supposed to accept the three arguments as stated in my initial post.

    2) This implementation attempt is the same as suggested on a Revit (and not only) API dedicated blog:

    http://spiderinnet.typepad.com/blog/...mentation.html

    There, the author suggests the same aproach:

    Code:
    CachedDoc.LoadFamily("c:/temp/fixed.rfa", new SampleFamilyLoadOptions(), out family);
    I respected everything, but it's not working

    Tanks for trying to help,

    Buddy

  4. #4
    Active Member
    Join Date
    2009-04
    Posts
    85
    Login to Give a bone
    0

    Default Re: Class does not implement interface member!

    OK, after searching a little bit more on the subject, finally I saw what you meant!

    Actually, when I wanted to contact the author of that blog about the issue, I've seen that it's already answered

    The classic mistake, haste makes waste.

    Thanks again,

    Buddy

Similar Threads

  1. trying to implement (mode_tile) into lisp
    By seth357792 in forum AutoLISP
    Replies: 1
    Last Post: 2014-05-01, 07:22 PM
  2. Implement drawing tools
    By Wish List System in forum Revit Structure - Wish List
    Replies: 0
    Last Post: 2012-07-04, 08:53 PM
  3. Replies: 4
    Last Post: 2011-03-04, 02:55 AM
  4. How to implement BIM ?
    By tomcarver in forum BIM Management - General
    Replies: 7
    Last Post: 2010-04-12, 11:07 AM
  5. Make Plot interface like the latest AutoCad interface
    By mschrand in forum Inventor Wish List
    Replies: 2
    Last Post: 2005-11-22, 05:57 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
  •