Create points in center of spheres and export their coordinates

Create points in center of spheres and export their coordinates

Anonymous
Not applicable
4,361 Views
21 Replies
Message 1 of 22

Create points in center of spheres and export their coordinates

Anonymous
Not applicable

Hello all!

 

I am new to Autodesk AutoCAD and want to create points in the center of spheres-like objects within a 3D .stp file and then export their coordinates.

 

Up to now I got my .stp model to import, but cannot find a way to modify the spheres. Every time I try to mark the spheres I get the message 'object with unchangable attributes'.

 

Is this an issue created by me due to the import of a non .dwg file format? Is there an easy way to get the coordinates of the sphere centers?

 

Thank you and best regards

 

0 Likes
Accepted solutions (1)
4,362 Views
21 Replies
Replies (21)
Message 2 of 22

Patchy
Mentor
Mentor

Let's see your .dwg it'll help.

Message 3 of 22

Anonymous
Not applicable

Thanks for your quick reply!

I attached a .png of some of the spheres below.

0 Likes
Message 4 of 22

Patchy
Mentor
Mentor

Can you attach the drawing in .dwg format

0 Likes
Message 5 of 22

Anonymous
Not applicable

I am afraid I can't due to copyright protection issues of the manufacturing company, sorry Smiley Sad

0 Likes
Message 6 of 22

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I see that you are visiting as a new member to the AutoCAD forum. Welcome to the Autodesk Community!

 

Can you strip out most of the content in your file and attach a sample?

 

I am guessing that you could insert a point or block at the center of each of your spheres and then use a dataextraction to create a list of their locations.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 7 of 22

Kent1Cooper
Consultant
Consultant

Are those spheres separate objects  from the rest of the connecting framework pieces?  If so, finding their centers is not difficult, by a simple calculation from their bounding boxes.  If the whole framework is one collective 3D Solid, I don't have any bright ideas....

Kent Cooper, AIA
Message 8 of 22

Anonymous
Not applicable

Set osnap to CENTER, use the POINT command to place points at the center of the spheres and uses DATAEXTRACTION to extract the geometry of the point for the coordinates.  That's a little slopy, but it'll get it done.  If you do this a lot check with the guys in the Autolisp forum for a programmatic solution. 

Message 9 of 22

leeminardi
Mentor
Mentor

Since you say the are sphere-like and not really spheres it would help to know what they are.  For example, are they a meshed surface or a NURBS object, or something else?  Can you post an AutoCAD file with just one of the spheres?

lee.minardi
Message 10 of 22

Anonymous
Not applicable

Hello @Kent1Cooper and @leeminardi,

 

just to give you an impression of the form of the objects I attached a screenshot. The objects are constructed using circles but the interfaces with the rods destroy the  "true sphere like" geometry.

The original file was a .stl file, showing only the surface constructed using vertices and faces. Now I am working with a .stp file imported into AutoCAD and converted to .dwg.

 

Thanks... 

0 Likes
Message 11 of 22

Anonymous
Not applicable

Hello @Anonymous,

 

thank  you for your reply. I am working through your instructions right now. I set onsnap to center. Then I called the point command and it seemed like I created a point. Now I called the Dataextraction command and here I am a little lost. How can I extract only these point coordinates? It offers me to highlight a region which I can export but as soon as I use the lasso function the complete structure is highlighted. How can I only select one point? Could I also extract multiple points at once - the file contains at least 200 spheres...

 

At the end I will create a DXE file, correct? I would have to use a program like FileViewPro or  Amiga Emulator to work with that?

 

Best

 

Kassandra

 

0 Likes
Message 12 of 22

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> an impression of the form of the objects I attached a screenshot

If that blockreference (and the others too) has the insertion point at the center of the sphere you don't need points, you can extract the block insertion points to get your coordinate list.

Command _DATAEXTRACTION

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 13 of 22

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> How can I extract only these point coordinates? It offers me to highlight a region

In case (and I hope you are working well with layers) you don't need to select anything manually, just use "all points" (or all block-insertions if you read the other post I sent a few seconds ago) and in the list of results you can filter to that specific layer to get only that points from this layer.

 

>> At the end I will create a DXE file, correct?

No, please don't just click and try ... use the help, it describes exactly what _DATAEXTRACTION is doing, what for the DXE is needed and which types of results you can have. >>>click<<<

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 14 of 22

leeminardi
Mentor
Mentor

It is a bit unclear how you got the data representation you are using. You stated that the file started as an .stl file. Stl files represent 3D geometry as a tessellated (faceted) model. That is, all surface are modeled as triangular facets that define a completely enclosed volume. Somewhere along your workflow this model was changed to circles and defined as blocks as shown in your image Sphere.png. IF, as @Alfred.NESWADBA notes, the block insertion point is at the center of the sphere you do not need to add point objects to the AutoCAD file. Just extract the block locations. If you find you need to add point objects then:


1. Create a layer for the points (e.g., Sphere Centers) and make it active.
2. Set the point style to something you can see with the ptype command (I don't know why the default point style is something you can hardly see).
3. With osnap set to center, add points at the center of the "great circles" that are part of the sphere (from the image you supplied it looks like they are in your model). 
4. With all layers frozen except the layer with the points give the dataextraction command. Note, you can easily freeze all layers except the current active layer with:
-layer [Enter]
f [Enter]
* [Enter] [Enter]
5. Follow the steps presented by the dataextraction dialog. You probably only want the Geometry Category filter.  The dataextractrion process is fairly user friendly.

 

AutoCAD has many idiosyncrasies that take time to learn.  For example, a hyphen in front of a command invokes a command  without dialog boxes.  This allows you to use the keyboard exclusively without need of the mouse. That is why my instruction above have you give the -layer command and not just layer.  Regarding layers, there is a difference between a layer that is frozen and one that is off.  It's generally better to freeze layers than just to turn them off as off layers may still be affected by AutoCAD operations.

 

Good luck.

lee.minardi
Message 15 of 22

Anonymous
Not applicable

Data is extracted from all objects or just model space objects, you control that in the Settings dialog box on page 2

 

dataextraction2.JPG

 

 

The DXE file created during the dataextraction is merely a method to save a particular set of dataextraction instructions for later retrieval and use.  Your end product output will be either a table in your drawing or a separate file or both, that separate file can be an Excel XLS file, a CSV file, am MDB file or a simple TXT file.  So you won't need any special applications to view/share the output.
dataextraction.JPG

 

 

 

Check the screencast below for a quick overlook at selecting specific data that is extracted and creating the output.  I output to both a drawing table and an XLS file in the screencast, see the XLS attached

 

Message 16 of 22

Anonymous
Not applicable

Thank you @Alfred.NESWADBA

I checked out the data extraction again and chose "show only blocks with attributes" on page 3 of 8 (got the German version, should be something like this). This would mean that I have no insertion points available?

 

The file I have got has only one Layer - seems like I have to add layers and then follow the point adding procedure suggested by lminardigmail and then extract the newly created points as shown by rculp...

0 Likes
Message 17 of 22

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> show only blocks with attributes

If your blocks don't have attributes (which I don't know) then all could be filtered out, so you don't get a list. Let there the option "Alle Objekttypen anzeigen" (in German), but in the upper list uncheck (with a right click) all, and check/activate only the blocknames you need to extract.

 

20171130_195300.png

 

 

If you would send us a drawing with just 4 or 5 of that objects, it would have been handled already...

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 18 of 22

Anonymous
Not applicable

NOTE: if the spheres are not individual blocks with the insertion points at the centers of those spheres, extracting insertion point will not indicate the center of the sphere.  Extracting an insertion point will ONLY note the insertion point, which may or may not be anywhere near the center of the sphere.

 

List the sphere, or select it and check its properties if it returns a 3D solid it isn't a block with an insertion point.  If it is a block use DIST to determine the distance from the insertion point to the center of the sphere, it that returns 0, then the insertion point is in the center of the sphere.

Message 19 of 22

Anonymous
Not applicable

Hello @Anonymous and @Alfred.NESWADBA,

 

I tried to send you part of the structure following 

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-FD3AE262-FCDD-4BB8-B392-560852E23A9A-htm.html,

however it seems like the whole structure is a single block - the whole document consists of one block, I cannot select single objects (e.g. spheres) and the dataextraction only lists one single block aswell. 

 

I cannot select one single sphere thus. Every time I try the whole structure gets highlighted.

 

 

Seems like I have to go the brute force method, do you agree?

 

 

0 Likes
Message 20 of 22

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Seems like I have to go the brute force method, do you agree?

If you like you can upload the complete dwg to A360, DropBox, ... and send me the link to the download via private message (so it's not public)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)