Hi
I am creating a direct shape as a generic model.
When direct shape's made, it cant duplicate, rename or doing something normal like regular elements, so is it possible to create family type for it?
Appreciate for any comments.
Regards
Hi
I am creating a direct shape as a generic model.
When direct shape's made, it cant duplicate, rename or doing something normal like regular elements, so is it possible to create family type for it?
Appreciate for any comments.
Regards
Okey-doke, sorry to hear it, time to ask the development team to take a look.
Please provide an absolutely minimal reproducible case:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Presumably, a minimal structural model containing only one or two structural connections that export perfectly well driven manually will suffice, with a (Python?) SharpDevelop macro attempting to export them in the same way that fails.
Thank you!
Cheers,
Jeremy
Dear John,
Thank you for your confirmation and congratulations to hear it is working now, however bizarre the resolution.
Cheers,
Jeremy
If you wish to make direct use of DirectShape element in your model, you can use a category to classify it.
It has no family type, since it is not a family instance.
If you insist on having a family type for it, you can use the direct shape to create a family definition and insert instances of that family that contain the shape.
Please note, however, that one of the main purposes of direct shape was to avoid the need to create a family definition for each and every shape required in the model, and that using the DirectShape element directly is much more efficient than creating a family in some workflows.
Cheers,
Jeremy
I am am not aware of any such check.
Maybe your customers should take some basic Revit product usage training before you let them loose on a real projects.
Cheers,
Jeremy
Depending on your use case, extensible storage may be a better choice than a shared parameter:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.23
Cheers,
Jeremy
You can look at the Analysis Visualisation Framework AVF. It has been around for a while:
http://thebuildingcoder.typepad.com/blog/avf
A relatively new addition is the DirectContext3D for display of externally managed 3D graphics:
http://thebuildingcoder.typepad.com/blog/2017/04/whats-new-in-the-revit-2018-api.html#3.26
Cheers,
Jeremy
Welcome to the Revit API!
When programming in Revit, you implement either an embedded macro or an add-in DLL.
Both of these are built using .NET and any language you choose.
Please check out the getting started materials for more info on the basics, and tutorials:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#2
Within your .NET add-in, you can set up the configuration in any way you please.
However, obviously, Revit is not going to do this for you, and I hardly expect that fiddling with the Revit configuration is going to affect this in any way.
At least not in the way you would like.
Cheers,
Jeremy
In theory, yes.
In practice, no.
Why?
To read and understand all the elements, their data and relationships stored in the BIM in order to transport it to an external database or another model, you would basically be rewriting the entire Revit engine.
I would not consider that a realistic undertaking.
I suggest you find some other way to solve your problem.
If you just need to move your entire model, or, looking at it differently, your entire coordinate system, you might be able to do something with the MoveElements method:
https://apidocs.co/apps/revit/2019/3cf8c9dc-f4d1-12f0-d7a9-e126331cd858.htm
Cheers,
Jeremy
Have you found a solution?
If not, you might want to attach a minimal reproducible case that clearly demonstrates the problem.
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Oh, before doing that, please verify that the non-vertical case works properly when driven through the user interface, and just fails when driven programmatically.
Thank you!
Cheers,
Jeremy
Hello,
It's working :-)
this is the solution:
IList<Element> GenericFamilySymbolList = new List<Element>(); FilteredElementCollector collector = new FilteredElementCollector(doc); collector.OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_GenericModel).ToElements(); ElementId id = new ElementId(BuiltInParameter.ALL_MODEL_TYPE_NAME); ParameterValueProvider provider = new ParameterValueProvider(id); FilterStringRuleEvaluator evaluator = new FilterStringContains(); FilterRule rule = new FilterStringRule(provider, evaluator, "test", false); ElementParameterFilter filter = new ElementParameterFilter(rule); GenericFamilySymbolList = collector.WherePasses(filter).ToElements();
If you can access the data, you can export it.
To check whether and how to access it, you can use RevitLookup:
https://github.com/jeremytammik/RevitLookup
Cheers,
Jeremy
Hello,
I am trying to Place a FamilySymbol using PromptForFamilyInstancePlacement method using C# while developing an add-in for Revit. The placement of components using this method disables most of the menu options while placement (as shown in picture 1). While if I try to place the same component directly from Project Browser, the same menu options remain enabled (as shown in picture 2) . Can someone point out something that I should do to match the behavior with Project Browser?
Picture1
Picture2
Here's my code snippet that I am using,
FamilySymbol symbol = HelperMethods.LoadFamilySymbol(familyFilePath, familySymbolName, revitUIApp.ActiveUIDocument.Document); BCCSCore.Instance.RevitUIApp.ActiveUIDocument.PromptForFamilyInstancePlacement(symbol);
Any help in this regard would be much appreciated.
Thanks,
Umar
Thank you very much for the nice little sample and solution.
It prompts me to reiterate for the umpteenth time:
There is generally no need to call ToElements on a filtered element collector.
You can use and iterate over the collector directly.
The conversion costs time and memory and brings no advantage whatsoever.
I mentioned it here and many, many other places:
Here is a version that skips the conversion:
ElementId id = new ElementId( BuiltInParameter .ALL_MODEL_TYPE_NAME ); ParameterValueProvider provider = new ParameterValueProvider( id ); FilterStringRuleEvaluator evaluator = new FilterStringContains(); FilterRule rule = new FilterStringRule( provider, evaluator, "test", false ); ElementParameterFilter filter = new ElementParameterFilter( rule ); FilteredElementCollector genericSymbolsNamedTest = new FilteredElementCollector( doc ) .OfClass( typeof( FamilySymbol ) ) .OfCategory( BuiltInCategory.OST_GenericModel ) .WherePasses( filter );
I added your sample code to The Building Coder samples and optimised it there, so you can see the difference:
https://github.com/jeremytammik/the_building_coder_samples/compare/2019.0.143.8...2019.0.143.9
Cheers,
Jeremy
como puedo solucioar este problema? El parámetro compartido "049391e0-c9b7-4d13-bcfb-84c309686c1f" no se puede añadir con el nombre "Nominal width" y el tipo "Número" porque entra en conflicto con el nombre "Nominal width" y el tipo "Longitud", ya existentes.
Hello Jeremy,
I will try to gather all required things if possible.. (I do whole import, so process is more complicated..) But for now I have here a bit detailed description.
There is some simple structure with walls and floors. When I am creating FabricArea, all passes but one wall with XY direction (0.7, 0.7) fails.
There is error message box: Unable to add major direction. Parameter name: majorDirection
in GUI there is little difference - I can't pick line (at once) for major direction, but I can pick two points to create line.. then it is visible.
now I have 2 attachements.
(1) Revit project,
(2) few lines of info log, that write out info about data (inly IDs) to be then called by FabricArea.Create()
In fact is seems also in that wall farbic area is created, but not visible in the view..
So if I will have some script that would do these calls I will let it here.
Thanks for now,
Let me know if you can do something based on that additional info.
Greetings,
Jaroslav
Thank you. I have checked the .dll's properties and it has not been flagged by windows. I have tried with a namespace, without a namespace, with a different class name, with the .dll in the same folder as the addin, and tried doing it all from scratch without renaming the .vb file. Unfortunately it still did not work. It keeps on showing this message, no matter what class name I write:
Failed to initialize the add-in "HelloWorld" because the class "HelloWorld" cannot be found in the add-in assembly.
The FullCassName provides the entry point for Revit to call the add.in application. For Revit to run the add-in, you must ensure this class implements the "Atuodesk. Revit.UI.IExternalCommand" interface.
I think the problem is that it is not finding the class in the assembly.
Hi
From Google translate,I understood that you are trying to give same name for two shared parameters.
Revit won't allow duplicate parameters with same name even if the types are different.
Better solution would be to add some numbers to the parameter name(e.g)"Nominal width 2"
You can also try using names like "Nominal width name" and "Nominal width Number".
I just started creating a simple add-in application in VB .net for Revit 2019 by following the tutorial:
https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2014/EN... (from Apr 18 2014).
I have completed all steps successfully, however, when clicking on the button to execute my add-in, this message appears:
Failed to initialize the add-in "HelloWorld" because the class "HelloWorld" cannot be found in the add-in assembly.
The FullCassName provides the entry point for Revit to call the add.in application. For Revit to run the add-in, you must ensure this class implements the "Atuodesk. Revit.UI.IExternalCommand" interface.
I have checked the .dll's properties and it has not been flagged by windows. I am sure the IExternalCommand is implemented. I have tried with a namespace, without a namespace, with a different class name, with the .dll in the same folder as the addin, and tried doing the tutorial again from scratch without renaming the .vb file. Unfortunately it still did not work: it keeps on showing this message, no matter what class name I write.
I have attached some printscreens of the project and the manifest file.
I think the problem is that it is not finding the class in the assembly because the message is tittled "Wrong Full Class Name". so I must have written this wrong in the manifest file. What should I write them?
Many Thanks.
Hi
In your addin manifest file,
<Assembly>HelloWorld.dll</Assembly>
This won't work because Revit won't be able to find out the HelloWorld.dll file.
The correct way to mention the full path of your .dll file is as shown below
For example
<Assembly>D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll</Assembly>