+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23
  1. #1
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2012
    Posts
    47

    Default how trim many line inside multi circle on one step

    Registered forum members do not see this ad.

    iam need lsp for trim or erase many lines inside many circle or block circle on one at one time
    Attached Files

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2015
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    40,720

    Default

    Your so called drawing contains the path to an untitled bitmap file that was not included as part of the file therefore we are unable to view anything. Try posting just the bitmap itself.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2012
    Posts
    47

    Default lsp for trim line inside many circle

    lsp for trim line inside many circle
    Attached Files

  4. #4
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2015
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    40,720

    Default

    Maybe you did not understand me. Your drawing file is blank. All one sees is the "path" to the untitled bitmap that was NOT included with the DWG file.

    Post the actual BMP file not a DWG. Clear?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  5. #5
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2015
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    40,720

    Default

    ExTrim.jpg
    Let's say you start with what is shown in circle #1. What do you want the results of this custom lisp routine to look like after it is run? Circle #2 or #3?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  6. #6
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2012
    Posts
    47

    Smile trim circle

    thank you sir
    i want lsp that when i select all circle in drawing automiticly trim or erase inside this circle as no.2 in your example

  7. #7
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2015
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    40,720

    Default

    OK. By the way, that was done using the EXTRIM command. I only tried it on a single circle so I can't tell you, at this time, whether or not it would work on multiple circles.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  8. #8
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,739

    Default

    Quote Originally Posted by ReMark View Post
    OK. By the way, that was done using the EXTRIM command. I only tried it on a single circle so I can't tell you, at this time, whether or not it would work on multiple circles.
    Nope, that Express Tool is a lisp command, so you can't even call it from another lisp in multiple instances. Although the actual working function in that file is a normal defun requiring the ename and the point. So this might work:
    Code:
    (load "extrim.lsp")
    (defun c:MExTrim (/ ss n en ed)
      (prompt "\nSelect Circles: ")
      (if (setq ss (ssget '((0 . "CIRCLE"))))
        (progn
          (setq n (sslength ss))
          (while (>= (setq n (1- n)) 0)
            (setq en (ssname ss n) ed (entget en))
            (etrim en (cdr (assoc 10 ed))))))
      (princ))
    This only works for circles, it's possible to extend for polylines as well - but more difficult.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  9. #9
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2012
    Posts
    47

    Default thank you sir

    thank you sir its ok

  10. #10
    Super Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2014
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    744

    Default

    Registered forum members do not see this ad.

    Here is complete MEXTRIM.lsp... Thanks to Irneb, and my previous post for algorithm for randomize picking points inside closed entity I've managed to create complete MEXTRIM command...

    Code:
    (defun rnd (/ modulus multiplier increment rand)
      (if (not seed)
        (setq seed (getvar "DATE"))
      )
      (setq modulus    65536
            multiplier 25173
            increment  13849
            seed  (rem (+ (* multiplier seed) increment) modulus)
            rand     (/ seed modulus)
      )
    )
    
    (defun GroupByNum ( lst n / r)
      (if lst
        (cons
          (reverse (repeat n (setq r (cons (car lst) r) lst (cdr lst)) r))
          (GroupByNum lst n)
        )
      )
    )
    
    (defun ptonline ( pt pt1 pt2 / vec12 vec1p d result )
      (setq vec12 (mapcar '- pt2 pt1))
      (setq vec12 (reverse (cdr (reverse vec12))))
      (setq vec1p (mapcar '- pt pt1))
      (setq vec1p (reverse (cdr (reverse vec1p))))
      (setq vec2p (mapcar '- pt2 pt))
      (setq vec2p (reverse (cdr (reverse vec2p))))
      (setq d (distance '(0.0 0.0) vec12) d1 (distance '(0.0 0.0) vec1p) d2 (distance '(0.0 0.0) vec2p))
      (if (equal d (+ d1 d2) 1e-8) (setq result T) (setq result nil))
      result
    )
    
    (defun ptinsideent ( pt ent / msp ptt xlin int k kk tst result )
      (vl-load-com)
      (setq msp (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
      (setq ptt (vlax-curve-getclosestpointto ent pt))
      (setq xlin (vla-addxline msp (vlax-3d-point pt) (vlax-3d-point ptt)))
      (setq int (GroupByNum (vlax-invoke (if (eq (type ent) 'ENAME) (vlax-ename->vla-object ent)) 'intersectwith xlin acExtendBoth) 3))
      (setq int (vl-sort int '(lambda (a b) (< (vlax-curve-getparamatpoint xlin a) (vlax-curve-getparamatpoint xlin b)))))
      (setq k 0)
      (while (< (setq k (1+ k)) (length int))
        (if (and (eq (rem k 2) 1) (ptonline pt (nth (- k 1) int) (nth k int))) (setq tst (cons T tst)) (setq tst (cons nil tst)))
      )
      (setq tst (reverse tst))
      (setq k 0)
      (mapcar '(lambda (x) (setq k (1+ k)) (if (eq x T) (setq kk k))) tst)
      (vla-delete xlin)
      (if kk
        (if (eq (rem kk 2) 1) (setq result T) (setq result nil))
        (setq result nil)
      )
      result
    )
    
    (load "extrim.lsp")
    (defun c:MExTrim ( / ss n en ed enA minpt maxpt dx dy pt dxx dyy ) (vl-load-com)
      (prompt "\nSelect closed entities: ")
      (if (setq ss (ssget (append (list '(-4 . "<or") '(0 . "CIRCLE") '(-4 . "<and") '(0 . "*POLYLINE") '(70 . 1) '(-4 . "and>") '(-4 . "<and") '(0 . "SPLINE") '(70 . 11) '(-4 . "and>") '(-4 . "<and") '(0 . "ELLIPSE") '(41 . 0.0)) (list (cons 42 (* 2 pi))) (list '(-4 . "and>") '(-4 . "or>")))))
        (progn
          (setq n (sslength ss))
          (while (>= (setq n (1- n)) 0)
            (setq en (ssname ss n) ed (entget en) enA (vlax-ename->vla-object en))
              (vla-getboundingbox enA 'minpoint 'maxpoint)
            (setq
             minpt (vlax-safearray->list minpoint)
             maxpt (vlax-safearray->list maxpoint)
            )
            (setq dx (- (car maxpt) (car minpt)))
            (setq dy (- (cadr maxpt) (cadr minpt)))
            (setq pt '(0.0 0.0 0.0))
            (while (not (ptinsideent pt en))
              (setq dxx (* dx (rnd)))
              (setq dyy (* dy (rnd)))
              (setq pt (list (+ (car minpt) dxx) (+ (cadr minpt) dyy) 0.0))
            )
            (etrim en pt)
          )
        )
      )
      (princ)
    )
    M.R.

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

Similar Threads

  1. select objects inside circle
    By mauro in forum AutoCAD General
    Replies: 26
    Last Post: 28th Aug 2008, 06:04 pm
  2. Cannot Trim Circle between tangents
    By Bane in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 17
    Last Post: 7th Mar 2008, 02:13 am
  3. Trim inside circle
    By Cube3 in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 12th Sep 2007, 07:26 am
  4. Text inside a circle
    By ebjco in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 22nd Nov 2005, 07:38 pm
  5. Text inside a circle
    By ebjco in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 22nd Nov 2005, 04:27 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts