trim around text

Discussion in 'AutoCAD' started by dennis, Mar 3, 2005.

  1. dennis

    dennis Guest

    Hi, is there a lisp that could trim around text?

    thanks,

    dennis
     
    dennis, Mar 3, 2005
    #1
  2. Have you considered wipeout instead of trimming?
     
    Tony Tanzillo, Mar 3, 2005
    #2
  3. dennis

    lauren Guest

    textmask or wipeout
     
    lauren, Mar 3, 2005
    #3
  4. dennis

    Paul Turvill Guest

    In addition to others' suggestions, you'll find that the TRIM command will
    do what you ask, as well.
    ___
     
    Paul Turvill, Mar 3, 2005
    #4
  5. Use TRIM if you want to cut and delete a line under text. This will only
    work on entities that can be trimmed, such as lines, polylines, circles,
    arcs, etc. It will not trim a block or a hatch pattern.

    Use TEXTMASK to "hide" entities underneath the text. This will not cut
    and/or delete the entities. It only hides them on the screen and when
    plotting.

    WIPEOUT can also be used, but I prefer TEXTMASK for use on text. I use
    WIPEOUT to hide entities beneath blocks.
     
    Gary Lafreniere, Mar 3, 2005
    #5
  6. dennis

    dennis Guest

    thanks for the all the response! follow-up question, can i copy/modify
    textmask in r14, so i can use it in r2002? If so, how?

    thanks again!

    dennis
     
    dennis, Mar 3, 2005
    #6
  7. dennis

    Fatty Guest

    Try this:

    (vl-load-com)
    (prompt "\nType >>> testtrim <<< to load\n")
    (defun C:testtrim ()
    (setq adoc (vla-get-activedocument
    (vlax-get-acad-object)
    )
    mdsp (vla-get-modelspace adoc)
    util (vla-get-utility adoc)
    )
    (vla-getentity
    util
    'txt
    'pt1
    "\nSelect text:\n"
    )
    (vla-highlight txt :vlax-true)
    (vla-getentity
    util
    'lin
    'pt2
    "\nSelect object to trim:\n"
    )
    (vla-highlight txt :vlax-true)
    (vla-getboundingbox txt 'll 'ur)
    (setq p1 (trans (vlax-safearray->list ll) 1 0)
    p3 (trans (vlax-safearray->list ur) 1 0)
    p2 (trans (list (car p3) (cadr p1) (caddr p1)) 1 0)
    p4 (trans (list (car p1) (cadr p3) (caddr p1)) 1 0)
    pt_list (apply 'append (list p1 p4 p3 p2 p1))
    )
    (setq rect (vla-addpolyline
    mdsp
    (vlax-safearray-fill
    (vlax-make-safearray
    vlax-vbdouble
    (cons 0 (1- (length pt_list)))
    )
    pt_list
    )
    )
    )
    (setq int_pts (vlax-safearray->list
    (vlax-variant-value
    (vla-intersectwith lin rect acExtendNone)
    )
    )
    )
    (while (caddr int_pts)
    (setq
    trm_pts (cons
    (list (car int_pts) (cadr int_pts) (caddr int_pts))
    trm_pts
    )
    )
    (setq int_pts (cdddr int_pts))
    )
    (vl-cmdf "_.break"
    (vlax-vla-object->ename lin)
    ""
    "_f"
    (car trm_pts)
    (cadr trm_pts)
    ""
    )
    (vla-delete rect)
    (vlax-release-object rect)
    (vlax-release-object txt)
    (vlax-release-object lin)
    (vla-regen adoc acactiveviewport)
    (princ)
    )


    thank you
     
    Fatty, Mar 4, 2005
    #7
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.