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: 

Hosted elements creation

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

Hosted elements creation

I have to create a column with brackets, here my steps:

1) open a new empty project by hands
2) load an rfa family for column named 'PILASTRO'
3) load an rfa family for braket named 'M_Mensola'
4) define dimensions parameters and position XYZ for the column
5) create column with NewFamilyInstance method with these parameters:
p: XYZ
s: familySymbol
l: level
StructuralType.Column: StructuralType
The column is created successfully.

5) define column face string A, B, C, D to append the bracket
6) consequently of face string I get the Face Element by column GeometryObject
7) create hosted bracket with NewFamilyInstance method with these parameters:
fObj: Face
posEle: XYZ from column centroid for X,Y and Z from my elevation input
dir: XYZ for face direction vector
s: familySymbol of bracket.

My problems:

-1-
The column and all brackets (on A, B, C, D faces) are correctly generated, only if posEle is 0, 0, 0
If I place column at another point, the brackets do not follow the column, but

bracket on A and C follows only X coord
bracket on B and D follows only Y coord
while the other coord remains at 0.
This problem raise only with api ops.

-2-
If I move column, all brackets remains at first position
This problem raise only with api ops.

-3-
If I delete the column, all brackets are still in project
this problem raise in both api and manual ops

-4-
If I inspect the Host ObjectId of a bracket, it is id of the face and not of the column
this problem raise with api ops.

I've tried also with other NewFamilyInstance methods, but nothing happens.

There is somebody that can help me, to understand how I can link brackets hosted to column?
Thanks for your suggestions.

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: Anonymous

One thing at least is certain: you need to use an overload of NewFamilyInstance that takes a host argument:

  

https://www.revitapidocs.com/2020/0c0d640b-7810-55e4-3c5e-cd295dede87b.htm

   

I see three options. Have you tried all three of those?

 

Maybe this old discussion from 2011 will help:

 

https://thebuildingcoder.typepad.com/blog/2011/01/newfamilyinstance-overloads.html

   



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
Anonymous
in reply to: jeremytammik

Mr. Tammik,

I follow your suggests but the behaviour is the same. I attach for your convenience my code with several tries of NewFamilyInstance method: only number 4 generate bracket correctly for all faces, but only in column position (0,0,0).

I appreciate your precious help.

Regards.

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

Post to forums  

Forma Design Contest


Rail Community