+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jul 2012
    Posts
    2

    Default How to Center text in Lisp :edit_box

    Registered forum members do not see this ad.

    I would like to find out if I can center text within a dialog edit box. I am populating this edit box from the result of a :popup_list. This information will not be edited and for display only.

    Here is my code currently.

    (write-line ":edit_box {" f)
    (write-line "edit_width = 10;" f)
    (write-line "edit_limit = 9;" f)
    (write-line "key = \"mill_disp\";" f)
    (write-line "}" f)

    If this is at all possible please help me out.

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,003

    Default

    If is just for display you may try to add spaces in front of the said string; the number of spaces will be correlated with the size of currently shown string. Or use a text tile instead.

    By the way, please edit your post and add the required code tags.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jul 2012
    Posts
    2

    Default

    Can you give an example of how you would use a text tile for this?

  4. #4
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,003

    Default

    This is what I was thinking about:
    Code:
    (set_tile "mill_disp" (strcat "        " "abc"))
    (set_tile "mill_disp" (strcat "  "       "dtsfan1976"))
    Based on your above example that's still pending code tags.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  5. #5
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    Registered forum members do not see this ad.

    A quick look at a old help book talks about right justified when edit_width is zero and goes on to talk about left & right justification only no centre option.
    A man who never made mistakes never made anything

Similar Threads

  1. Autocad Lisp For Scaling Down/up From Center
    By onzki in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 12th Dec 2012, 09:53 am
  2. about dcl edit_box
    By blueshake in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 18th Sep 2010, 03:26 pm
  3. Syntax for reading .TXT into an edit_box (DCL)
    By ajs in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 27th May 2008, 05:52 pm
  4. Syntax for reading .TXT into an edit_box (DCL)
    By ajs in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 25th May 2008, 12:22 am
  5. Need lisp to Align text to middle center of a box/rectangle?
    By Ste1978 in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 21st Nov 2007, 03:56 pm

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