Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to access familyInstance host and host face

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
884 Views, 2 Replies

How to access familyInstance host and host face

Here is the family file: Family File

 

However, after I insert it into ceiling, the familyInstance.host and familyInstance.hostface properties are NULL.  My question is how to access the host face?

 

Tags (1)
2 REPLIES 2
Message 2 of 3
efortune1699
in reply to: Anonymous

I am having this same issue.  If you figure it out please post.  Smiley Happy

Message 3 of 3
Anonymous
in reply to: Anonymous

The dropbox link isn't working for me so I can't look at the family for you. But here's some generic tips for solving this kind of problem.

 

  • If you are reading the Host and HostFace properties within the same transaction that the instance was created in, try doing a Document.Regenerate()  before accessing the properties.
  • Try reading the properties from a seperate API command (place using one command, read using another).
  • When you select the API created instance in the UI, see if there is a property that references the host element. Now place another instance of the same family using the UI, is the property of this one the same?
  • Read the host parameters of a UI placed instance using the API. Do they appear now?
  • Try different overloads of the NewFamilyInstance method.
  • Check the value of FamilySymbol.Family.PlacementType this will give you some insight into which overloads can be used and which parameters will be available once the instance is placed.
  • I've found than many ceiling related families such as lights and fire sprinkler heads are created using family templates that do not store the reference that you selected for placement, they instead store the location, level and height above level or offset.
  • Create test families using a few different templates, place them using both the API (using differring overloads of NewFamilyInstance) and the UI then read out as much placement info as you can for each, this will give you an idea of the different ways family instanes store thier location / host information depending on the family template and creation method.

 

 

Hopefully one of these helps you out, otherwise, update with a new link to the family an I'll check it out for you.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community