I have a set of “areas” in C3D where I want to place objects (this will be a second step). To be able to do that, I need to know a point of reference in these areas and am trying to export the coordinates of their centres (x,y,z or latidute, longitude, elevation) to an Excel file.
Any suggestions on how to get this done? I am totally new in Dynamo and have looked at dozens of tutorials but nobody seems to address this.
However… I might be newer to Dynamo than expected…
The error message says:
Warning: Your inputs lie outside of the allowable modeling range, consider choosing the Large setting with a modeling range between 0.01 and 1,000,000 from the “Settings => Geometry Working Range” dialog
You can ignore that warning - it’s letting you know that the geometry Dynamo is calculating is greater than it was configured for.
If you really want to avoid the warnings you can shift everything closer to your internal origin point (either in AutoCAD or in Dynamo by using vectors and inverting). Alternatively you could combine all of these items into a single function (remove all the inputs other than the 0.5 values you have in the code block and wire them into a Function.Compose node in a matching sequence), and then send that into use a Function.Apply node as the function, and the list of objects as the object.
Both of these solutions are more advanced than ignoring the warning for now, and may introduce other issues which wouldn’t be seen (ie: passing the Function would suppress any issues with pulling the geometry of the object, building the polycurve, making the surface, or pulling the point…).
Going a step further, if you wanted to say place a block at that location… there is a BlockReference.ByCoordinateSystem node, which means you may want to use a Surface.CoordinateSystemAtParamter node instead of a Surface.PointAtParameter node.
Don’t forget to mark solutions so the next person with a question like yours can find good info faster!
I believe I ran into a problem - please see the messages I got from your solution that led to a “null” output fromt he last block (I am sure it is me, not you!):
Warning: Data.ExportExcel expects argument type(s) (string, string, int, int, var, bool), but was called with (System.IO.FileInfo, string, int, int, Autodesk.DesignScript.Geometry.Curve, bool).
Can you post the DWG with just those few rectangles as well? I’ll pop into this later tonight as it may require the translation thing I mentioned before.
Please notice that what I am trying to achieve is a 2-step automation of a process.
1st: I want to extract coordinates from 2D/3D (x,y,z) from DWGs and save them in XLS (they migh be useful in this format); and
2nd: I want to read those coordinates and replace them by blocks (I already managed to find a solution for this step).
In the present case, a “planner” gave me the places where cable reels will be provisionally stored and I wish to place the 3D models there using Dynamo so I don’t have to move them every time the reels move place.
If you want the X,Y and Z-Values of those start- and endpoints you’ll have to extract them by using the StartPoint/ EndPoint nodes together with the Point.X, Point.Y and Point.Z nodes.