Issue:
You have a drawing containing point objects and you would like to convert these to another entity type like a circle or crossing lines.
Causes:
This can be useful when you need to import your DWG file in a different CAD program that cannot view or does not enable snapping to point objects (i.e. Revit).
Solution:
The following
Lisp code will locate any point object in the drawing and draw a circle at its location where the centre of the circle coincides with the point location:
(setq
ss (ssget "X" '((0 . "POINT")))
ct 0
)
(repeat (sslength ss)
(setq inspt (cdr (assoc 10 (entget (ssname ss ct)))))
(command "_circle" inspt 0.5)
(setq ct (1+ ct))
)
The following
Lisp code will locate any point object in the drawing and draw a cross (4 line objects) at its location where the centre of the cross coincides with the point location:
(setq
ss (ssget "X" '((0 . "POINT")))
ct 0
)
(repeat (sslength ss)
(setq inspt (cdr (assoc 10 (entget (ssname ss ct)))))
(command "_line" inspt "@0.5,0.5" "")
(command "_line" inspt "@-0.5,0.5" "")
(command "_line" inspt "@0.5,-0.5" "")
(command "_line" inspt "@-0.5,-0.5" "")
(setq ct (1+ ct))
)
If you wish to delete the point objects following the creation of the circles or crosses created using the code above, simply run the following
Lisp code stright after having created the circles or crosses:
(command "_erase" ss "")
To run
Lisp code simply copy the code to the clipboard, then paste it in the AutoCAD command line and press Enter.
Products:
AutoCAD Products; Revit Product Family;
Versions:
2012; 2013; 2014; 2015;