Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiple Points to Multiple Spheres

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
williams_cory_a
635 Views, 11 Replies

Multiple Points to Multiple Spheres

Hi,

 

I imported coordinates points and I am wondering how to convert all those points into small sphere. Thanks in advance.

11 REPLIES 11
Message 2 of 12
pendean
in reply to: williams_cory_a

There is no "conversion' option that does that in AutoCAD: you could try replacing points with spheres, but you'll want to identify sphere sizes, units you are using, and which point on the sphere is the coordinate.
Message 3 of 12
Patchy
in reply to: williams_cory_a

 

You can replace a point with a block of a sphere with Autolisp

Message 4 of 12

By "imported coordinates points" do you mean Point objects?  If not, in what form are the coordinates imported?

Kent Cooper, AIA
Message 5 of 12

Yes

Message 6 of 12


@williams_cory_a wrote:

Yes


Then it shouldn't be too hard to come up with a routine that will replace the Point objects with Spheres.  All Point objects in the drawing?  All Points on a certain Layer?  All Points only among a User selection?  Should the Spheres be 3D Solids, or would you want to use a Sphere defined into a Block, with its insertion point in the middle?  Make or Insert them all on a particular Layer, or on the Layer of the Points they replace?  Always the same Sphere radius, or ask the User for the radius, or designate different radii by Layer or some other criterion?  Etc.

Kent Cooper, AIA
Message 7 of 12

I would like to have the spheres as 3D solids and not blocks. The spheres can all be on the same layer and a determined radius for all. I’ve done it before but can’t remember how

Message 8 of 12

If yoou do not have the file with the original input data for creating the points you could use dataextraction to create an Excel (.xls) file and then use Excel to create the commands to add the spheres.

 

For example,  here's sample output from dataextraction (columns A through E). 

leeminardi_0-1718673833050.png

 

Cell F1 contains

=CONCATENATE("_sphere ",C2,",",D2,",",E2," ",1)

 

The ending 1 is the sphere radius. Change this as desired or reference a cell containing the radius.  Fill down F1 to the last row of data.

 

Copy column F to the clipboard then paste into the command line in AutoCAD.

 

 

lee.minardi
Message 9 of 12


@williams_cory_a wrote:

... the spheres as 3D solids and not blocks. The spheres can all be on the same layer and a determined radius for all. ....


In simplest terms, lightly tested:

(defun C:P2S (/ ss n pt); = Point(s) {to} Sphere(s)
  (if (setq ss (ssget '((0 . "POINT"))))
    (repeat (setq n (sslength ss)); then
      (setq pt (ssname ss (setq n (1- n))))
      (command "_.sphere" "_non" (getpropertyvalue pt "Position") 1.0);;;<--EDIT radius
      (entdel pt); <--optional
    ); repeat
  ); if
  (prin1)
)

 

Kent Cooper, AIA
Message 10 of 12

Might come in handy, too. Not only for this task.
There is an old program (not ours) FRTO - replace anything with anything.


Can try our experimental subproject XDPoint. With the XDPOINT_CREATE command can create point objects (blocks, points, 3DSolids, lines, etc.) on "basic" objects (points, polylines, splines, hatches etc.). Created point objects will be linked to their base objects. And when moving, changing objects, can restore the relative position and properties of the linked point objects with the XDPOINT_UPDATE command.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

Message 11 of 12
williamcAC49H
in reply to: leeminardi

This worked. Thank you!

Message 12 of 12

This worked! Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta