RRS1987 Posted October 4, 2011 Posted October 4, 2011 Respected Sir/Madam, I have been using Autocad 2007, I would like to know, how to replace the from object (ex. point) to object (ex. donut) in Autocad. And Also, There is any software or Lisp or Command for above function to do in Autocad?. If please suggest me. That will helpful and needful for me. Thank you verymuch, Regars, Raman, Quote
CyberAngel Posted October 4, 2011 Posted October 4, 2011 Welcome to the forum! As far as I know, there is no simple command to replace one type of object with another. If this situation occurs often, you may want to use a block, which you can redefine to change all of its instances. In other words, you originally define the block as a point and insert it in several places. Edit the block so that it contains a donut instead of a point. All of the inserted copies of that block will change to donuts. Quote
BIGAL Posted October 6, 2011 Posted October 6, 2011 Using a lisp and ssget you create a list of every point via some form of secondary filter ALL polygon window pick etc Then you work through the list one by one and get the co-ords of the point either erase it or now add/replace with a donut. By your number of posts this would be a good starting point to learn lisp check help for SSGET selection set SSLENGTH how many in selection set REPEAT Y how many times to replace point SSNAME ss X where x is the nth item in the list ASSOC 10 this is the centre pt of the point ENTMAKE this is used to create your donut or just use Command Donut Quote
SLW210 Posted October 6, 2011 Posted October 6, 2011 I moved this to the AutoLISP, Visual LISP & DCL forum for you. Quote
Lee Mac Posted October 6, 2011 Posted October 6, 2011 Modifying some of my existing code: ;; Point 2 Donut - Lee Mac 2011 - www.lee-mac.com (defun c:pt2dnut ( / cn en in r1 r2 r3 ss ) (if (and (setq ss (ssget "_:L" '((0 . "POINT")))) (setq r1 (getdist "\nSpecify Inside Diameter of Donut: ")) (setq r2 (getdist "\nSpecify Outside Diameter of Donut: ")) (setq r3 (abs (/ (- r2 r1) 2.0)) r1 (+ (/ (min r1 r2) 2.0) (/ r3 2.0)) ) ) (repeat (setq in (sslength ss)) (setq en (entget (ssname ss (setq in (1- in)))) cn (trans (cdr (assoc 10 en)) 0 (cdr (assoc 210 en))) ) (if (entmakex (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (assoc 8 en) (cond ((assoc 6 en)) ('( 6 . "BYLAYER"))) (cond ((assoc 39 en)) ('(39 . 0.0))) (cond ((assoc 62 en)) ('(62 . 256))) (cons 90 2) (cons 70 1) (cons 43 r3) (cons 10 (polar cn pi r1)) (cons 42 1.0) (cons 10 (polar cn 0. r1)) (cons 42 1.0) (assoc 210 en) ) ) (entdel (cdr (assoc -1 en))) ) ) ) (princ) ) Quote
VVA Posted October 6, 2011 Posted October 6, 2011 more general version ;;; Command changes the set of primitives for the selected primitive. ;;; Examples: ;;; Replacement of some other blocks. ;;; Replacement blocks or dots circles. ;;; Replacement of some other titles. ;;; ;;; First you need to select a sample, and then specify replaceable objects. ;;; Box is in the center is restricted (bounding) rectangle of old objects. ;;; New objects are inserted into the layers that Belonged to which the old objects. ;;; Supports pre-selection. Quote
Recommended Posts
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.