« Key Concepts of the Family Editor | Main | Family API Create Type, Select and Modify Instances »

June 28, 2013

Comments

Jeremy,

I have run into an issue a few times while attempting to PromptForFamilyInstancePlacement, when there are multiple types (symbols) for a family, occasionally a user attempts to select a different symbol.

Seems like the easiest way to solve this is to create a dialog with a list of symbols for that specific family (for easy selection). It just seems like there should be an easier way to load a different type "on the fly" if a user decides to select something different after the fact. Am I expecting too much? Thanks.

Dear Sir,
I am placing family instance using below method:

FamilyInstance fi = Document.Create.NewFamilyInstance(pCurve, symbol,pipe.ReferenceLevel, StructuralType.NonStructural);

but fi is getting null & it is not placing in Document.
please Help
Regards
Dhiraj.

Dear Sir,
I am placing family instance using below method:

FamilyInstance fi = Document.Create.NewFamilyInstance(pCurve, symbol,pipe.ReferenceLevel, StructuralType.NonStructural);

but fi is getting null & it is not placing in Document.
please Help
Regards
Dhiraj.

Dear Dhiraj,

Can you place the symbol manually?

You need to find out which NewFamilyInstance overload is suitable for your specific family:

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

http://thebuildingcoder.typepad.com/blog/2011/06/placing-a-line-based-detail-item-instance.html

http://thebuildingcoder.typepad.com/blog/2012/02/hosting-a-light-fitting-on-a-reference-plane.html

Cheers, Jeremy.

Dear Nick,

Yes, sorry, currently there is no way that I know of to programmatically control default type that gets placed by this method. We are working on it, though :-)

Cheers, Jeremy.

Dear Sir,
Yes i can place instance manually.
My goal is to break pipe as soon as union get placed on it.
I have tried placing on XYZs but it is not breaking pipe.
Regards
Dhiraj.

Dear Dhiraj,

You can try going the other way:

Instead of starting by placing the pipe, and then adding fittings, you could place the fittings at the correct locations without any pipes at all.

Then when you call the API methods to connect the fittings with each other, the intermediate pipes may be placed automatically.

Cheers, Jeremy.

Hi Jeremy,
I wish to place the instance of a family object once i click a button. I need some replacement for the method "PromptForFamilyInstancePlacement" . It should not prompt user in UI to place the instance on a phase. It should prompt the user to select the 2 or more multpile phase and then it should place it in the joining point of the selected phases. Is this possible in API programming?

Hi Jeremy
Another interesting and very useful article.
I have utilised some of your code above to create an icon/image driven system where families are presented in a dialogue. I have everything working almost exactly as I need it with the exception of one thing. When I select an image in my dialogue my dialogue form has focus. I then need to click in my Revit model twice (once for it to regain focus, again to place the family) Is there any way I can programmatically give focus back to the Revit Model/document.

Revit API newcomer
Paul M

ear Paul,

Thank you for your update and appreciation.

I am very glad you find it useful.

For one thing, your form should set Revit as its parent window.

To see how, search for JtWindowHandle

http://lmgtfy.com/?q=JtWindowHandle

Here is a current implementation of this trivial wrapper class:

https://github.com/jeremytammik/RoomEditorApp/blob/master/RoomEditorApp/JtWindowHandle.cs

As you can see, it is used in my RoomEditorApp.

With that in place, I think your problem should disappear immediately.

If not, the RoomEditorApp also includes code to explicitly set the foreground window.

Try not to use it, though, since that is something the user should retain control over.

Cheers, Jeremy.

Jeremy,
I want to load some mass instances from one file(the store file) to another file(the proj. file) in revit arch. 2013. I know there is a new method copy and paste between open documents in the same session however i would have to reference the 2014 api, which I cant at the moment. I think that I would have to do this by loading mass families (12 of them) onto the same x,y coordinates simultaneously. Is this even possible? Could you provide tips to achieve this?
Many thanx,
Nik

Dear Nik,

Yes indeed, the copy and paste API sounds appropriate and was introduced in Revit 2014.

The other approach you suggest sounds perfectly feasible as well for this simple case.

Yes, I believe this is possible.

As usual, you should try it out through the user interface first.

Placing multiple overlapping instances might cause errors or warnings, and you may have to use the failure API to handle those.

Cheers, Jeremy.

Thanx, Jeremy I will give it a shot.

Hi Jeremy,
Do you know of a method of obtaining the families file path without using editFamily method? this requires a transaction I believe and I have to work in a read only mode transaction within my external command.
cheers,
fabs

Hi Jeremy
Thanks for the code.One thing only where can I find the Util class. I got the error that Util is not in the current context. I am a biginner. :-)
thanks

Dear Frank,

Thank you for your appreciation.

Look in the archive file FamilyApi10.zip in the third and final part of the detailed discussion on use of the Family API:

http://thebuildingcoder.typepad.com/blog/2013/07/family-api-nested-type-instance-and-symbol-retrieval.html

Good luck getting started with the Revit API!

Have you worked through the getting started material, especially the 'My First Plugin' and DevTV tutorials?

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

Have you installed RevitLookup? An absolute must!

Merry Christmas and a Happy New Year to you!

Cheers, Jeremy.

Hi Jeremy,
I tried to place a Generic Model to a column face :
NewFamilyInstance(Reference reference, XYZ location, XYZ referenceDirection, FamilySymbol symbol);
the face normal is (0,1,0)
for each location XYZ (x,y,z) I putted, the location of the new familyinstance is (x, 0.34, z) !!
why y is not equal to my input value?
please Help ..

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource