I am creating coordinate systems to orient block instances on different locations. I have tried to build the coordinate systems with different methods, civil3Dtoolkit & python, most of the time the orientations are not working, giving a warning about the block “Warning: The block requires uniform scaling”. If slightly rotate the coordinate system, the outcome is valid. in the images, the green lines are the block reference.
Hola Amigo @Francisco.OrtizN86AJ buenas. Check well the structure of the Coordinate System is quite complex, I do not read phyton I can not help you with that, another node that does exactly the same but with separate imputs is BlockReference.Create I would not waste much time creating a phyton to make it work the one whit Coordinate System but I leave it to your criteria, I hope it helps!
Hi Gilberto, thanks for your feedback. I know this native component works under specific circumstances, but when I try to do something more complicated, it wont perform properly, that’s why I have tried different methods to create Coordinate Systems having no success so far.
In the image you can see how the coordinates system are created along the polycurve, but if I want to insert block instances on them, some are not valid.
What is the warning? Likely best to start there as if the OOTB node fails your Python code may fail the same way if the issue isn’t taken into account.
The warning is about the uniform scaling of the block, I checked already in the properties of the block. The funny thing is that the Coordinate System works in some orientations and not in others, the block to be inserted is the same. I have tried creating the coordinate system with different methods, native components, and custom components, yet the conditions where the coordinate system is valid or not are not clear. In the first image you can see how if the rotation of the element just 0.01 degree more, it will be valid. If the line is straight, it would not be an issue, the problem is when the line has different orientations, like in the previous screen shot.
Can you provide a simple DWG with just a single curve to populate coordinate systems on, and the block to populate?
I’m wondering if this is a floating point error caused by converting from a Dynamo coordinate system to an AutoCAD coordinate system, where one of the axis has a length of 1.0000000000000000000000001 or something like that.
Uniform Scaling on and off gives the same outcome. I tried to simplify the block to a simple polygon but I am still getting the same outcome. I rotated the block in Civil3D model space to an invalid rotation value, on the model space of course there’s no issue with it, once I input that block into the script, and after extracting the coordinate system to use it as new orientation point, it turns out invalid as well. So based on that I can tell that there is something happening with the orientation.
You’ve got the best Dynamo for Civil 3D gurus in the world in the forum, many of whom are already active in this thread; however if we can’t reproduce your issue we can’t help you beyond guessing. Please post a DWG so that we can reproduce the problem.
I have manually bumped your trust level so you can post files, but if it still doesn’t work you can utilize a 3rd party service such as OneDrive, Dropbox, Google Drive, Box, etc…
Thank you so much @jacob.small, I attached the files with the script shared in the video, some orientations get valid output, other locations are not valid insertion points, with the warnings regarding the block scale.
So it appears to be the floating point error I noted before.
Utilizing the AutoCAD API (via a zero touch node or Python) to generate a BlockReference.ByCoordinateSystemAtParameter node would be a good idea (this is a common use case as I understand), but that’s a bigger lift than I have time for at the moment.