Results 1 to 1 of 1

Thread: How to determine if a family instance exists

  1. #1
    Member
    Join Date
    2014-03
    Posts
    3
    Login to Give a bone
    0

    Default How to determine if a family instance exists

    I am currently creating a family instance via Revit API. I need to determine if the same instance already exists in the given location. If it does, I do not wish to create a duplicate.
    What is the best way to determine via C# if it already exists?
    if (familyinstance.Exists) does not work in the Revit API

    Code:
    UIDocument uidoc = this.ActiveUIDocument;
    Document doc = uidoc.Document; Family webAngle = new FilteredElementCollector(doc).OfClass(typeof(Family)).FirstOrDefault(q => q.Name == "ConXWebAngle") as Family; FamilySymbol fs = webAngle.Symbols.Cast<FamilySymbol>().First(q => q.Name == "W24X68"); using (Transaction t = new Transaction(doc, "Insert Web Angle Clips")) { t.Start(); FamilyInstance fi = doc.Create.NewFamilyInstance(pt, fs, Autodesk.Revit.DB.Structure.StructuralType.NonStructural); //Need to determine if there is already an existing clip in this location. //If so, there is no need to create another one. t.Commit(); }
    Last edited by BlackBox; 2014-09-12 at 04:56 PM. Reason: Please use [CODE] Tags

Similar Threads

  1. 2015: FAMILY ALREADY EXISTS
    By gordolake in forum Revit Architecture - General
    Replies: 2
    Last Post: 2014-08-26, 11:29 PM
  2. 2013: Get family instance from instance parameter value
    By Dr. Emergence in forum Revit - API
    Replies: 5
    Last Post: 2014-02-03, 05:03 PM
  3. Replies: 0
    Last Post: 2012-07-04, 08:07 PM
  4. Instance void in family
    By t1.shep in forum Revit Architecture - Families
    Replies: 2
    Last Post: 2009-07-12, 02:32 AM
  5. Right-click an instance of a family, and reload the family.
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 1
    Last Post: 2009-02-02, 04:49 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
  •