Generic model level reference

Generic model level reference

nayer.girgis
Participant Participant
903 Views
3 Replies
Message 1 of 4

Generic model level reference

nayer.girgis
Participant
Participant

Hi,

 

I am having a problem which I couldn't find a solution for. I have created an addon that creates instances of generic model families by using the familyinstance method:

 

FamilyInstance instance = CachedDoc.Create.NewFamilyInstance(insertpoint, FamilySymbol, StructuralType.NonStructural);

 

It works fine and the families are inserted in the exact location. However, when I select the instance, it shows that the host is None and it is not referenced to any floor level. Therefore its offset is always referenced to the project 0 level.

How can I link the family instance to the floor level of the active view?

 

I would really appreciate any help.

 

Cheers

 

Nayer

0 Likes
904 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Nayer,

 

You have to use a different overload of the NewFamilyInstance method.

 

The exact one to use depends on your family. It needs to take the level or floor or whatever as an input argument to make it the host.

 

Cheers,

 

Jeremy



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

0 Likes
Message 3 of 4

nayer.girgis
Participant
Participant

Dear Jeremy,

 

I think I have to read more on the other overloads of the Familyinstance method and I will keep you updated. BTW I love your blog, I have learned so much from it.

 

Cheers

 

Nayer

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk
0 Likes