Jump to content

How to position 3D circles onto the coordinates imported from excel file


alinazem123

Recommended Posts

Hi everyone,

I have a huge 3D coordinate data base being imported into Cad. I have used 3D polyline to connect all those points together. So technically I have a line composed of almost 20000 points. In fact, I want to draw a 3D circle on every point on the line to come up with something similar to a cylinder. Since the number of points are too much, I figured that there should be a way to use a command or something for once to create that cylinder! :shock::shock:

Besides, I would be really grateful if anyone could help me out on how to draw a circle in 3D space in Cad. I was thinking about using normal vector and center (pretty much like what happens in Matlab!) though!

Thank you so much

Link to comment
Share on other sites

A short program could place circles at specific coordinates. Also it is possible to align them to a normal vector. How does the database look like? can you post a line (meaning the records for one circle)?

Link to comment
Share on other sites

In fact, each point on the line is going to be a center for a circle. Plus, the normal vector starts from the center of the circle extending to the next point. Basically the data base is 3 columns for Easting, Northing, and Elevation including 20,000 points.

Due to the upload limitation, I just trimmed the data based as much as it was possible to upload it.

Basically you are looking at E, N, Z from left to right. There are two sets of coordinates separated by an empty column. they have the same order in terms. In other words, they are like: E N Z , E', N', Z'.

Survey.txt

Link to comment
Share on other sites

I am sure someone will offer a slick LISP program to do this but this is an easy task to do with Excel to make a script file.

 

Here’s how to create a script file that will create a circle at a point on a plane perpendicular to a normal vector point.

 

Copy and paste your data into cell A1 of a blank Excel file so that columns A,B,C contain the xyz coordinates of the circle center and columns E,F,G contain the xyz of a normal vector relative to the circle center.

 

In cell I1 write the follow statement,

 

=CONCATENATE("ucs za ",A1,",",B1,",",C1," ",E1,",",F1,",",G1," circle ",A1,",",B1,",",C1," 1.234 ucs w")

 

Use fill-down to copy this statement for all 20000 points. Note, I have set the radius of the circle to 1.234 but you can use any value.

 

Copy and paste the contents of column I to Notepad and save the file as “circles.scr”.

 

In AutoCAD give the script command and reference the circles.scr file.

 

Here’s a sample of the first few lines of the script file:

ucs za 305639.6437,64657.41275,85.79345482 305632.2229,64663.17114,85.47779987 circle 305639.6437,64657.41275,85.79345482 1.234 ucs w
ucs za 305639.6489,64657.41171,85.79485486 305632.2321,64663.1312,85.47602777 circle 305639.6489,64657.41171,85.79485486 1.234 ucs w
ucs za 305639.6478,64657.41094,85.79473042 305632.2321,64663.13162,85.47521908 circle 305639.6478,64657.41094,85.79473042 1.234 ucs w
ucs za 305639.6332,64657.42378,85.79817644 305632.2587,64663.16944,85.48178578 circle 305639.6332,64657.42378,85.79817644 1.234 ucs w
ucs za 305639.6468,64657.40424,85.79623424 305632.2841,64663.16098,85.48709774 circle 305639.6468,64657.40424,85.79623424 1.234 ucs w
ucs za 305639.6503,64657.40128,85.8034256 305632.287,64663.15092,85.48608222 circle 305639.6503,64657.40128,85.8034256 1.234 ucs w

 

You can modify this to create cylinders if you wish. ~ lrm

Link to comment
Share on other sites

Here's the format for the Excel formula for creating cylinders from a list of vertices with x,y,z coordinates in the columns A,B,C. Fill down this cell for all points except the last point then copy and paste the results into Notepad and save with a .scr file name extension.

 

=CONCATENATE("cylinder ",A1,",",B1,",",C1," 0.0001 a ",A2,",",B2,",",C2)

 

Here I have set the cylinder radius to 0.0001 since the distance between successive points in your data is as small as 0.001 and often less than 0.01. Please note that it is not good practice to use such small numbers with geometry position far away from the AutoCAD origin. The x coordinate for all of you data is 305639.xxxx. I suggest moving all your points by -305639 in x, -64657 in y, and -85 in z.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...