TEXTBOX - LISP function

Discussion in 'AutoCAD' started by Bill DeShawn at Gregg Creghton's Office, Jan 21, 2005.

  1. With text objects, there is a textbox. How do you get the extents of MTEXT
    objects? Or the extents of Dimension text objects?

    --
    ____________________
    Bill DeShawn
    Please reply to group only
    Thank you
    http://my.sterling.net/~bdeshawn
     
    Bill DeShawn at Gregg Creghton's Office, Jan 21, 2005
    #1
  2. Bill DeShawn at Gregg Creghton's Office

    Doug Broad Guest

    Have you tried the getboundingbox method?
     
    Doug Broad, Jan 21, 2005
    #2
  3. (eval getboundingbox)
    nil

    --
    ____________________
    Bill DeShawn
    Please reply to group only
    Thank you
    http://my.sterling.net/~bdeshawn

    message news:41f155ce$1_3@newsprd01...
     
    Bill DeShawn at Gregg Creghton's Office, Jan 21, 2005
    #3
  4. Bill DeShawn at Gregg Creghton's Office

    Doug Broad Guest

    Bill,
    Its a method, not a function. Example:

    (vla-getboundingbox(vlax-ename->vla-object (car(entsel))) 'llc 'urc)
     
    Doug Broad, Jan 21, 2005
    #4
  5. Bill DeShawn at Gregg Creghton's Office

    Doug Broad Guest

    And the return values are stored in llc and urc.
    They can be returned with
    (safearray-value llc)
    and
    (safearray-value urc)
     
    Doug Broad, Jan 21, 2005
    #5
  6. Perhaps this will give you a starting point (no pun intended)
    Code:
    
    (defun GetBoundingBox ( object / p1 p2 )
    (vl-catch-all-apply
    'vlax-invoke-method
    (list object 'GetBoundingBox 'p1 'p2)
    )
    (if p1
    (mapcar 'vlax-safearray->list
    (list p1 p2)
    )
    )
    )
    
    
     
    Michael Puckett, Jan 21, 2005
    #6
  7. or
    Code:
    
    (defun GetBoundingBox ( object / p1 p2 )
    (vl-catch-all-apply
    'vlax-invoke-method
    (cons object '(GetBoundingBox p1 p2))
    )
    (if p1
    (mapcar 'vlax-safearray->list
    (list p1 p2)
    )
    )
    )
    
    
    if you prefer.

     
    Michael Puckett, Jan 21, 2005
    #7
  8. or
    Code:
    
    (defun GetBoundingBox ( object / p1 p2 )
    (vl-catch-all-apply
    '(lambda ()
    (vlax-invoke-method
    object
    'GetBoundingBox
    'p1
    'p2
    )
    )
    )
    (if p1
    (mapcar 'vlax-safearray->list
    (list p1 p2)
    )
    )
    )
    
    
    if you prefer.

     
    Michael Puckett, Jan 21, 2005
    #8
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.