ghosting text

Discussion in 'AutoCAD' started by chemlab, Jan 9, 2004.

  1. chemlab

    chemlab Guest

    hi,
    i was wondering if anyone knew of a way to ghost
    text when writing something that places text in a dwg.
    (kinda like the donut command)
     
    chemlab, Jan 9, 2004
    #1
  2. chemlab

    BillZ Guest

    What you want could be very complex.
    Grvecs can be used to draw in xor ink to coordinates in a list.
    Grread can read the cursor position.
    I don't have what you want but I'll paste a small routine here that might help you get started:

    ;Bill Zondlo
    ;program to get input
    ;and show drag.
    ;
    ;----------------;
    (defun fig_pts ()
    (setq nm 5
    ct (cadr pt3)
    d1 1.0
    an1 (/ 6.28319 nm) ;360d divided by number of points.
    an2 (/ an1 2.0) ;different angle for high & low points.
    an3 1.5708 ;start star at 90d from center point.
    an4 (+ an2 an3) ;angle of first low point
    d2 (* d1 0.382) ;distance of first low point.
    pt1 (polar ct an3 d1) ;first point.
    pt2 (polar ct an4 d2) ;next point.
    )
    ;----------------------------------------------------;
    (repeat nm ;
    (setq lst (append lst (list pt2))
    an4 (+ an4 an2) ;increase angles.
    pt1 (polar ct an4 d1) ;& reset points.
    an4 (+ an4 an2) ;
    pt2 (polar ct an4 d2) ;
    lst (append lst (list pt1 pt1 pt2))
    )
    ) ;end repeat.
    (setq lst (cons 256 lst) ;add color to list
    lss lst
    )
    )
    ;----------------;
    (defun c:show_drag_star (/ )
    (initget 1)
    (setq pt1 (getpoint "\nSelect Base Point:") ;select
    dif 0
    )
    ;--;
    (prompt "\nNext point:")
    (while (/= (car (setq pt3 (grread 'T 1 0))) 3)
    (setq dif (1+ dif)
    )
    (cond ((= dif 1)
    (fig_pts)
    (grvecs lst) ;draw lines
    (setq lst nil)
    )
    ((= dif 2)
    (grvecs lss) ;cover lines
    (setq lss nil
    dif 0)
    )
    )
    ) ;end while
    (grvecs lss) ;cover lines
    (princ)
    ) ;end defun

    Bill
     
    BillZ, Jan 9, 2004
    #2
  3. chemlab

    chemlab Guest

    thanks,
    i use grvecs already in the routine for showing linework,
    was just hoping for a way to show text for placement.
    maybe i can use what you have here with mtext and
    just draw a box based on the mtext size or something?
     
    chemlab, Jan 9, 2004
    #3
  4. chemlab

    Doug Broad Guest

    The donut command asks for complete specs on the donut
    and then asks just for the location. You could do the same.
    Just ask for all the text parameters and then put a dummy
    text entity somewhere and copy or move the text entity
    to the correct location. The move and copy commands
    automatically ghost. When finished delete the original
    (if copied).

    Would that work?
     
    Doug Broad, Jan 9, 2004
    #4
  5. chemlab

    chemlab Guest

    yes, but i don't like the rubberband move/copy has
     
    chemlab, Jan 9, 2004
    #5
  6. chemlab

    Doug Broad Guest

    The express tools lisp programs have some ghosting tools.
    Check them out. Try a google search on ghosting and
    this newsgroup and you should find what you need.
     
    Doug Broad, Jan 9, 2004
    #6
  7. chemlab

    chemlab Guest

    one of the commands on the menu does this?

    and speaking of express tools, i saw a post on
    here asking for a folder box and got a reply of
    one (acet-ui-something). are there any docs on
    stuff like that and what else might be avail.?
     
    chemlab, Jan 9, 2004
    #7
  8. chemlab

    Doug Broad Guest

    No. This is the customization group. I assumed you
    were writing your own command. You must look inside
    the acet*.lsp programs to find the functions that do the
    job. I vaguely remember something like acet-ss-drag-move
    and acet-ss-drag-copy and acet-ss-drag-rotate.
     
    Doug Broad, Jan 9, 2004
    #8
  9. Then you have to:

    1. Make your text entity
    2. Make Block from it
    3. Insert it (without rubber band!)
    4. Explode
    5. Purge!!!
     
    Alexander V. Koshman, Jan 10, 2004
    #9
  10. chemlab

    John Uhden Guest

    If it's plain Text, then you can use the Change command to ghost its
    repositioning from a point in outer space without a rubber band. If it's MText,
    then you could temporarily make an anonymous block and use the Change command.
     
    John Uhden, Jan 10, 2004
    #10
  11. Here is a sample of code I use to insert a box of the correct size of text
    for placement .
    There is a separate block for each text justification that is 1 unit by 1
    unit with origin in same location as justification.

    (setq TJUST "L")
    (setq TTEXT "TESTTEXT")
    (setq KL 1) ;number of lines of text
    (setq TB (textbox (list (cons 1 TTEXT))))
    (setq TXBOX (abs (- (caar TB) (caadr TB))))
    (princ "\nPick Text Location ? ")
    (command "INSERT" (strcat "NOTEBOX" TJUST) "XSCALE" TXBOX "YSCALE" (* 1.4
    TYBOX KL) "ROTATE" 0.0)
    (command PAUSE)
    (setq EG (entget (entlast)))
    (if (and (= (cdr (assoc 0 EG)) "INSERT") (= (substr (cdr (assoc 2 EG)) 1 7)
    "NOTEBOX"))
    (progn
    (setq P0 (cdr (assoc 10 EG)))
    (if (= TJUST "L")
    (command "TEXT" P0 "" "" TTEXT)
    (command "TEXT" TJUST P0 "" "" TTEXT)
    )
    (entdel (cdr (assoc -1 EG)))
    )
    )
     
    Alan Henderson, Jan 12, 2004
    #11
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.