Hi Dynamo Community,
I have 9 polylines touching each other as shown, imported from DWG inside dynamo, and I want to group each ployline in a sublist in dynamo, BUT unfortunately dynamo read them as one group of lines
is there anyone can help to put each polyline in a sub-list and still keeping all lines in the same layer?
(I know that if i put them in different layers it will work but for some reasons i have to put all the lines in the same layer)
i tried all the possible nodes to use as shown in the photo but in vain.
Thanks in advance.
Hey,
I think BiMorph has some good nodes for dealing with DWGs…
Hope that helps,
Mark
Thanks Mark for your concern,
But i already used it but it doesn’t give me what i want . it also give me all the lines in one list not sublist for each polyline.
I really tried to find a solution for that case.
What kind of results are you expecting? Seems like all curves are joined together so 1 sublist is a logical output.
If you want to group the curves by their direction only you should use the node List GroupByKey, using the directions as keys, before using the node from archilab
Thanks Daan,
I just need to group the lines according to each polyline in the DWG (without changing the layer of lines in DWG)
Hi @hanywillim …not sure at all, are a little bit confused how you wanna group them…but probably something…
or
@hanywillim look into DynaMEP package:
Remember, if you see nulls or errors in exploded polylines, fix and cleanup them in autocad (overkill command etc.), or you’ll lose that polylines. Later you can make polycurves from sublists of exploded polylines.
Okay, you should use the layer of each line, instead of the direction I proposed, as keys instead. You will have to group them by layer first otherwise you will never be able to group them by layer & distance.
Thanks Sovitek,
Actually what i am looking is to collect each square (which represented as one polyline in DWG) to be in a square.
In face I am just simplify my question but in fact i have many polylines touching each other and all of them are in the same layer and i want to separate them in sub-lists.
Many Thanks Bro for your help,
It worked perfectly but i faced two problems
1- Only choose the file path (not a linked DWG from Revit file)
2- Only workd for .dxf files not .dwg files?
So, how can i used for the DWG files and get the same results?
Thanks in advance.
- Try to use some tool like Convert DWG to DXF Multiple Files Autocad with one click - YouTube
We can run it from Pyhon, i’ll help with this code. - Retrive linked DWGs path.
- Replace .dwg names with .dxf when reading files with DynaMEP.
Use the Camber package if you want to work with dwg’s without opening them manually.
However, please mark this topic as solved and create a new for this since this is deviating quite a bit from the original question.
also you can try just get Element.Geometry of dwg import instance, it reads DWG Polylnes as Dynamo Polycurves:
Many thanks VIadimir,
I really do appreciate your concern bro, but there is an issue here that it will import all the layer do you have any idea how can i filter the layers before or after using Element.Geometry?
Many thanks again in advance
To be honest I’d just get your CAD users to isolate the needed lines and copy to a new file versus trying to wrangle them from the overall file. That way you only get what you need. Hopefully theyre putting them on a consistent layer for isolate/copy anyway, doesnt take long.
Vladimir has solved the original problem. If you wish to pursue layer specification and/or getting link geometry please begin a new topic as these are different issues. This helps others find specific solutions to a problem in future when they search.
I’t rather do the automate dxf export in Dynamo from current revit file, so we’ll have dxf import and make use of DynaMep layers reading.
P.S. Have some idea, i’ll edit post.
Many Thanks @GavinCrump for your response and i am one of your fans on YouTube and Thanks again on all of useful videos, God bless you always