Set Family Parameter in instance

Set Family Parameter in instance

thannaingoo.api
Advocate Advocate
1,353 Views
1 Reply
Message 1 of 2

Set Family Parameter in instance

thannaingoo.api
Advocate
Advocate

Dear All,

 

I am trying to place a generic family into wall.

 

How should I set the parameter in family before insert into wall?

 

Should I set the familySymbol?

 

 

 FamilyInstance instance = doc.Create.NewFamilyInstance(face, location, refDir, familySymbol);

 

 

Thanks Advance,

Naing Oo

0 Likes
1,354 Views
1 Reply
Reply (1)
Message 2 of 2

thannaingoo.api
Advocate
Advocate

Answer Found. 

 

 

FamilyInstance instance = doc.Create.NewFamilyInstance(f, intersection, refDir, familySymbol);                                  

                                    foreach (Parameter p in instance.Parameters)
                                    {
                                        if (p.Definition.Name == "Depth")
                                        {
                                            p.Set(ww.Width * 1.1);
                                        }
                                        if (p.Definition.Name == "h")
                                        {
                                            p.Set(DuctHeight + DuctClearance);
                                        }
                                        if (p.Definition.Name == "b")
                                        {
                                            p.Set(DuctWidth + DuctClearance);
                                        }
                                    }
0 Likes