Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66665

PromptForFamilyInstancePlacement Keyboard Shortcut problem

$
0
0

 

I stumbled across a problem with using a Keyboard Shortcut.

 

Using the code basically from this orignal post:  http://thebuildingcoder.typepad.com/blog/2010/06/place-family-instance.html

In my case, I've changed one line to collector.OfCategory(BuiltInCategory.OST_LightingFixtures),  since I don't have any OST_Door family instances.

 

The code works fine if you are executing it from a menu button (Add-Ins), but if you assign a keyboard shortcut key to the new command, you get an error if you press the space bar to change the orientation of the family you are placing.  Pressing the spacebar when code is executed from a menu button works as expected.

 

The problem doesn't occur with BuiltInCategory.OST_GenericAnnotation, so it seems to be related to being a 3D model object.  I stumbled across the issue in my own code, and confirmed the issue isn't related to my code base by trying it out on the original 2010 place-family-instance code.

 

The placement doesn't totally die, it just pops up this error message.  If you press the space bar a 2nd time, it works as expected, and the error message goes away.  Just a pain to have the error message poping up all the time.

 

ErrorMessage.PNG

 

 


Viewing all articles
Browse latest Browse all 66665

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>