PromptForF​amilyInsta​ncePlaceme​nt to allow adding in an enclosed space

PromptForF​amilyInsta​ncePlaceme​nt to allow adding in an enclosed space

Anonymous
Not applicable
599 Views
2 Replies
Message 1 of 3

PromptForF​amilyInsta​ncePlaceme​nt to allow adding in an enclosed space

Anonymous
Not applicable

Hi

We are using Revit 2015 API in our addin.

PromptForFamilyInstancePlacement method that gives nice drop family icon does not seem to allow restriction of the drop area to say a Room or a department. Is that possible? If not, are there any other similar alternatives that can be used to insert family within an enclosed volume.

Regards,

Raman

0 Likes
600 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

Dear Raman,

 

Thank you for your query.

 

That is indeed an interesting question.

 

As far as I am aware, the Revit API does not provide any direct support for this out of the box.

 

Maybe some ingenious workaround can be devised anyway.

 

One rather drastic approach to prevent the user from placing objects in invalid locations will be to simply collect all the newly added elements as described here:

 

http://thebuildingcoder.typepad.com/blog/2010/06/place-family-instance.html

 

After the PromptForFamilyInstancePlacement method has completed, you can test each of the newly placed instances, report errors to the user, and even automatically delete the instances, if you like.

 

Please also be aware of the more modern and flexible placement functionality provided by the new PostRequestForElementTypePlacement method.

 

As far as I know, that does not provide the kind of control you are requesting either.

 

Another possibility that comes to mind is this:

 

Before calling the method, temporarily hide all the invalid location objects in the view.

 

Then the user will only be able to place instances on the remaining valid objects.

 

I hope this helps.

 

Please let us know how you end up resolving this!

 

Thank you!

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi,

 

1. Take bounding box of the enclosed volume.

2. Take bounding box of the family.

3.Check if the bounding box of the family is within the bounding box of the enclosed volume.

4.If its not within mark them or delete them.

 

Thanks & Regards

Sanjay Pandey

0 Likes