Modifying placed families causes 'serious error'

Modifying placed families causes 'serious error'

Anonymous
Not applicable
401 Views
3 Replies
Message 1 of 4

Modifying placed families causes 'serious error'

Anonymous
Not applicable

I'm writing an application which reads text XYZ coordinates and generates a Revit model.

The application works perfectly; levels, floors, walls, doors, rooms, etc. are created/placed.

 

However, when I try to move something (a door, a wall) I get "a serious error has ocurred..."

When I undo up to the door placement transaction (meaning that now I only have levels and walls) I can now easily modify the walls that were automatically placed.

 

It seems that there is something about the door placement that I perceive as being 'over-constrained', which does not allow modification.

Am I on the right track? What should be my next steps to ensure that once doors are automatically placed, they can be easily modified by the user?

 

The following is a snippet of the door placement transaction, in case it helps.

 

                t.SetName("Place Doors"); t.Start();
                            for (int i = 0; i < m_Walls.Count; i++)
                            {
                                //Note that each DoorPts object holds extra information, not just XYZ points. (See DoorPts class)
                                doorGeo.DoorPlacementPts(application, m_Walls[i], i);
                                foreach (DoorPts thesePts in doorGeo.DoorXYZ)
                                {
                                    if (thesePts.wallHost == i && thesePts.isHosted == true)
                                    {
                                        FamilyInstance instance = doc.Create.NewFamilyInstance(thesePts.Pt_Place, SelectedOptions.SelectedDoor, m_Walls[i], thesePts.Arc_Level, StructuralType.NonStructural);
                                        if (thesePts.isflippedFacing == true) instance.flipFacing();
                                        if (thesePts.isflippedHand == true) instance.flipHand();
                                    }
                                    else continue;
                                }
                            }
                t.Commit();

 

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

gopinath.taget
Alumni
Alumni

Hello SantiagoDiaz,

 

I am not able to find an obvious problem with your code but it does seem that you need to use the right overload method for NewFamilyInstance when placing hosted elements. Please take a look at the blog posts:

 

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

http://thebuildingcoder.typepad.com/blog/2010/06/set-tag-type.html

 

If this does not help, can you please provide a complete, non-confidential sample I could use to test?

 

Best Regards,

Gopinath

0 Likes
Message 3 of 4

Anonymous
Not applicable
Gopi !

We just met at the DevDays workshop.
I'll try the other overloads and see what happens.
Thanks again for your assistance at the DevDays, hope to meet with you again.

Santi
0 Likes
Message 4 of 4

gopinath.taget
Alumni
Alumni

Hi Santi,

 

Glad to be of help :-). Please do let us know if the problem persists.

 

Thanks

Gopinath

0 Likes