I'm close but not there

Discussion in 'AutoCAD' started by J. Logan, Jul 15, 2004.

  1. J. Logan

    J. Logan Guest

    I've got this routine selecting a piece of text (a datestamp) and initiating
    the move command.
    I'm having trouble specifying the..

    basepoint for the move = insert or lower left justification.
    new location to move to = 1.375,.2 (this is a point in space not a
    distance.)

    (setq SS (ssget "x" (list (cons 8 "TIMEDATE"))))(command "_.move" something
    here and here? ss "")

    Do I need two more setq's to handle this?

    J. Logan
     
    J. Logan, Jul 15, 2004
    #1
  2. J. Logan

    ECCAD Guest

    You could just get the text, then do a 'relative' move:
    (command "_move" ss "0,0" "1.375,.2")

    ?

    Bob
     
    ECCAD, Jul 15, 2004
    #2
  3. J. Logan

    ECCAD Guest

    Oops, missed this:
    <<this is a point in space not a
    distance.>>
    So, fix the destination point.
    (setq pt (list 1.375 0.2 0.0))
    (command "_move" ss "" "@" pt)
    Should do it.

    Bob
     
    ECCAD, Jul 15, 2004
    #3
  4. J. Logan

    J. Logan Guest

    Thanks Bob,

    That got me going.

    J. Logan
     
    J. Logan, Jul 15, 2004
    #4
  5. J. Logan

    J. Logan Guest

    actually I got it to work without the (setq pt...) . Although your method
    below is more than likely better lisping.

    J. Logan
     
    J. Logan, Jul 15, 2004
    #5
  6. J. Logan

    J. Logan Guest

    I ran the command back to back and it moved the date stamp another 1.375,2.
    So, using setq pt is better.

    (setq SS (ssget "x" (list (cons 8 "TIMEDATE"))))(command "_.move" SS ""
    ".2,.2" "1.375,.2")

    J. Logan
     
    J. Logan, Jul 15, 2004
    #6
  7. J. Logan

    Doug Broad Guest

    J,
    Assuming there is only one time stamp (hopefully):

    (if
    (setq SS (ssget "x" (list (cons 8 "TIMEDATE"))))
    (setq e (ssname ss 0) einfo (entget e) ip (cdr (assoc 10 einfo)))
    (command "move" ss "" (trans ip e 1) "1.375,0.2")
    )

    or something like it. Of course, some text has an insertion point
    which is stored in dxf code 11 instead of 10. Perhaps a vlisp
    equivalent would be better, something like:

    (if
    (setq ss (ssget "x" (list (cons 8 "timedate"))))
    (vla-put-insertionpoint
    (vlax-ename->vla-object (ssname ss 0))
    (vlax-3d-point (list 1.375 0.2 0))))
     
    Doug Broad, Jul 15, 2004
    #7
  8. J. Logan

    ECCAD Guest

    (setq pt (list 1.375 0.2 0.0))
    (command "_move" ss "" "@" pt)
    .....won't do it..@ is undefined.
    Do:
    (setq a (ssname ss 0))
    (setq b (entget a))
    (setq ip (cdr (assoc 10 b)))
    (setq pt (list 1.375 0.2 0.0))
    (command "_move" ss "" ip pt)

    Bob
     
    ECCAD, Jul 15, 2004
    #8
  9. J. Logan

    J. Logan Guest

    Doug,

    in (trans ip e 1) what is trans doing or saying?
     
    J. Logan, Jul 15, 2004
    #9
  10. J. Logan

    Doug Broad Guest

    It may or may not be necessary, depending on
    how you use coordinate systems. It translates
    the insertion point coordinates from the entity
    coordinate system to the current user coordinate
    system.
     
    Doug Broad, Jul 15, 2004
    #10
  11. J. Logan

    J. Logan Guest

    That makes sense. Thanks for the help

    J. Logan

     
    J. Logan, Jul 15, 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.