ssget and circles

Discussion in 'AutoCAD' started by Craig, Dec 6, 2004.

  1. Craig

    Craig Guest

    By searching the help & this newsgroup i managed to come up with this
    to create a selection set of all circles with a radius of 4.85.

    (ssget "X" '((0 . "CIRCLE")(40 . 4.85)))

    is there a way to then change all these circles to a radius of 4.765
     
    Craig, Dec 6, 2004
    #1
  2. Craig

    LUCAS Guest

    ;;--------------------------------------------------
    (setq SS (ssget "X" '((0 . "CIRCLE") (-4 . "=") (40 . 4.85)))
    N 0
    )
    (repeat (sslength SS)
    (setq ENT (entget (ssname SS N)))
    (entmod (subst (cons 40 4.765) (assoc 40 ENT) ENT))
    (setq N (1+ N))
    )
     
    LUCAS, Dec 6, 2004
    #2
  3. CCD.LSP - Change Circle Diameter

    defun c:CCD (/ osm num ss1 dia len et id dia ss1 rad qtde)
    (setvar "cmdecho" 0)
    (command "undo" "begin")
    (setq osm (getvar "osmode"))
    (setvar "osmode" 0)
    (setq num 0)
    (prompt "\n Select circle(s) to change diameter: ")
    (setq ss1 (ssget '((0 . "CIRCLE"))));;;;EXTRAINDO DADOS EM SSGET
    ;;;;;;;;;;;;;;;; (setq ss1 (ssget));;;;EXTRAINDO DADOS EM SSGET
    (setq num 0);;;;EXTRAINDO DADOS EM SSGET
    (setq ent (entget (ssname ss1 num)));;;;EXTRAINDO DADOS EM SSGET
    (setq rad (cdr (assoc 40 ent)));;;;EXTRAINDO DADOS EM SSGET
    (setq dia (* 2 rad))

    (setq qtde (sslength ss1))
    (if (= qtde 1)(progn (princ "\n Selected diameter:: ")(princ dia)))

    (setq qq1 (cons 40 ss1))
    (setq len (sslength ss1))
    (prompt "\n New diameter: ")
    (setq dia (/ (getdist) 2))
    (while (/= len 0)
    (setq et (entget (ssname ss1 (- LEN 1))))
    (setq id (assoc 0 et))
    (if (= (cdr id) "CIRCLE")
    (progn (setq num (+ num 1))
    (setq et (subst (cons 40 dia) (assoc 40 et) et))
    )
    )
    (entmod et)
    (setq len (- len 1))
    )
    (setvar "osmode" osm)
    (princ num)
    (princ " circle(s) modified(s).")
    (princ)(command "undo" "end")(princ))
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Rogerio
     
    Rogerio_Brazil, Dec 6, 2004
    #3
  4. Craig

    GaryDF Guest

    Command: ; error: no function definition: ACET-ERROR-INIT

    Need to be sure express tools are loaded. If not then these files at a minimum
    need to be......

    (defun ARCH:EXPRESS-TOOLS ()
    (if (not ACET-ERROR-INIT)
    (cond ((and (>= (distof (substr (getvar "acadver") 1 4)) 15.0)
    (< (distof (substr (getvar "acadver") 1 4)) 16.0))
    (ARCH:AUTOCAD-V_15))
    ((>= (distof (substr (getvar "acadver") 1 4)) 16.0)
    (ARCH:AUTOCAD-V_16))))
    (princ))

    (defun ARCH:AUTOCAD-V_16 ()
    (if (/= (findfile (strcat ARCH#SUPF "V_16\\acetutil.arx")) nil)
    (progn (load (strcat ARCH#SUPF "V_16\\acetutil.fas"))
    (load (strcat ARCH#SUPF "V_16\\acetutil2.fas"))
    (load (strcat ARCH#SUPF "V_16\\acetutil3.fas"))
    (load (strcat ARCH#SUPF "V_16\\acetutil4.fas"))
    (if (not (member "acetutil.arx" (arx)))
    (arxload (findfile (strcat ARCH#SUPF "V_16\\acetutil.arx"))))))
    (princ))


    Gary
     
    GaryDF, Dec 6, 2004
    #4
  5. Craig

    GaryDF Guest

    Sorry wrong post...see Mutiple Circle Extrim post

    Gary
     
    GaryDF, Dec 6, 2004
    #5
  6. Craig

    Craig Guest

    thanks
     
    Craig, Dec 7, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.