>> Anyway, it works now
Brilliant! Congratulations. So, what is your final solution? Idling event without SetRaiseWithoutDelay + Poke? Is the full code provided somewhere, e.g., GitHub? Thank you!
>> Anyway, it works now
Brilliant! Congratulations. So, what is your final solution? Idling event without SetRaiseWithoutDelay + Poke? Is the full code provided somewhere, e.g., GitHub? Thank you!
I am using `accoreconsole.exe` to run a script file on .dwg files to automate the export of NWC files. Is there an equivalent tool for Revit? My goal is to generate NWC files from RVT files without manually opening Revit. For Civil 3D, I achieve this using `accoreconsole.exe`. How can I accomplish this in Revit?
@cdiggins escreveu:No it doesn't, you can try it for yourself using the Bowerbird scripting solution. What happens is that you get a few messages and then it stops sending Idle events. So work inside of the queue, remains unprocessed.
I tested an standalone plugin and works fine without PokeRevit, I use the BackgroundProcessor in the code: https://github.com/ara3d/revit-background-processor. The Idling event never stops.
Don't know what process you are running the in Idling, I only tested with Thread.Sleep and still triggers normally. I tested with a 1 second delay, which makes Revit really slow/laggy, and it works fine with Revit minimized/unfocused.
Hi @Pei_LiuQ5B9P,
This is tricky, I solved it a couple of years ago with a lot of testing.
First advise is to print out the points used for the outline and see where they are located inside the llinked file, will it clash with anything and does it correctly represent the elements in the host file (untransformed).
I ended up using a Solid (SolidUtils) and generating 2 directshapes (to visualize it) one transformed (for the link) and one normal (to check if host elements positions were correctly taken.)
It might be off due to: The min/max coordinates from the BoundingBoxXYZ box are propably not representing the viewed element. See it's documentation ("Coordinates determined by it's transform"), this will also depend on how the BoundingBoxXYZ is retrieved.
So I ended up using the Box transform to edit the min/max point. (because the box is always aligned with the x/y, using the Transform.origin to correct the min/max would be enough)
Using BoundingBoxIntersectsFilter is correct, but not enough. (btw Inverse of the Linkinstance transform is correct to use)
Using BoundingBoxIntersectsFilter is only usefull to reduce the elements to check for interference, after this you actually need a Solid of the host element to detect actual intersecting elements in the link.
Use ElementIntersectsSolidFilter for this, with a inverse transformed solid of the host element
Use SolidUtils.CreateTransformed to create a transformed solid of the host solid element
First using BoundingBoxIntersectsFilter and then ElementIntersectsSolidFilter speeds up the addin as the elements BoundingBox is fast.
Hope it makes sense...
- Michel
ps. My own intersection detect with a link went from 30min to seconds with this optimalization.
Also, with the Outline creation I always take a little extra (a Fuzz) to make sure it doesn't just miss something.
Hi @emaguilera,
Maybe update the post with the correct code giving the error?
Maybe the override includes a pattern, which can't be applied to a import category?
And if only some sub-categories give a error, print their name/id and inspect it and see what's different about it.
Ps. a "better" way to retieve import top-category is by using it's Id.
with this code "if (cat.Name.EndsWith(".dwg", StringComparison.OrdinalIgnoreCase))" you could miss imports as the main import category can be renamed and ".dwg" removed (or dxf?)
I get the ID of all top categories, and all with a Id above 0 are imports, as top categories are all builtin categories with negative id's.
Hi @MuirEng ,
In Revit where the level "hides" is different between categories, even family types (facebased, levelbased etc) and between how elements are hosted (workplane a floor or level) and even between Revit versions.
The Dynamo node will propably have a extensive code behind it checking for the family placement type and some categories and using certain builtinparameters based on those (and more) conditions.
I've tried to built a global util that can read the level from any element but doesn't always come up with the correct Level if any.
Some parameters return a ElementId as host (which can be a level) but some only return a text value, with the prefix "Level : " (also depending revit version)
Use RevitLookup to inspect which parameters read out the level, specially if you are only concerned about one family category. If lucky the LevelId property of element will do it, else there are several parameters like:
- SCHEDULE_LEVEL_PARAM
- FAMILY_LEVEL_PARAM
- INSTANCE_FREE_HOST_PARAM
- HOST_ID_PARAM
- Etc...
- Michel
Dear longt61
Thank you for your response. By focusing on the part you mentioned and making the necessary corrections, I was able to successfully generate the rebar model! I'm still considering how to define the centerline of the rebar, but it looks like I can move on to the next phase. Thank you very much.
Hello
I'm trying to get the path of the conduit fitting by reading the center line geometry.
There is a way to do this in LookUp.
I followed the same logic:
First, I access all the instances of the Conduit Fittings in the model through element collector, then get their geometries. Using GetDependentElements I can reach the conduit fittings centerlines, which were supposed when I read their geometries (as done in LookUp) is to get the IEnumerable of the composing Arcs and Lines.
In line 20 of my code, I tried to cast to GeometryElement/GeometryObject/IEnumerable<GeometryObject> but they all return no objects.
Any ideas?
I'm feeling proud to reply your query, Since you're one of the prime contributors in Autodesk Forums. You have written everything correct I have made small correct by adding View to options on extracting curves. Kindly check the below code snippet for additional reference.
Reference Code
Hope this will Helps 🙂
Hi all,
I have a problem with (re)loading a family symbol.
When I use the debug function, the first familysymbol i try to reload is reloading well.
The parameters are change and everything is fine.
The second family type that I try reload fails, the result is true but the IFamilyLoadOptions doesn't activate.
Here is my IFamilyLoadOptions, the first time the debug is writing this line:
OnFamilyFound _ FamilyInUse: True - overwriteParameterValues True"
The second time there is no debug.
I found this example in the SDK:
@jeremytammik is there a specific reason that this example is creating a temp file?
KG
Jan Willem
I did not read all your code.
However, just looking at this line:
fs = new FilteredElementCollector(doc)
I would assume that the resulting variable fs will never be null, even if the resulting collection is empty. If so, that might explain why the following statement will never be true, and the code in the if-scope will never execute:
else if(fs != null)
I would suggest always running your dubious code in the debugger to step through it line by line and see what happens.
Thanks for the reply...Link file and the electrical file share the same basepoint and trure north angle.. Even after transforming the points remain same..The building is tilted a bit but rooms in the building are normally placed. So the poitns are not getting placed correctly.
Revit does not provide a core console application like that. You can achieve what you ask for using the Autodesk Platform Services APS and its Design Automation API for Revit to drive the Document Export method taking an NavisworksExportOptions argument:
Thanks for the response @jeremy_tammik
The fs started as : FamilySymbol fs = null;
That's the weird thing, the result is true.
But the IFamilyLoadOptions is not activated. Is that because the modify date of the family isnt change?
@Mohamed_Arshad Thanks mate, and I appreciate your nice words. Adding the view did the trick. Sometimes you need to refresh your memory and sometimes you are busy with other stuff. 😅
But thanks anyway.
If possible can you please share the sample models so that I will work
I wonder the reason you created the method TransformPoint instead of using the Transform.OfPoint, pretty sure that does the same thing.
There are the Transform.OfVector as well that is used for vector, basically the origin is not used in the calculation only the rotation.