Results 1 to 2 of 2

Thread: Create MTEXT with Lisp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2003-12
    Posts
    18
    Login to Give a bone
    0

    Cool Create MTEXT with Lisp

    I am trying to create MTEXT using “entmake” in my lisp routine. The routine is list below, please look at this routine and please point me in the right direction.

    Thank you


    Code:
     (defun C:PARKING ()
      (setq |CMDECHO| (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setvar "osmode" 512)
      (setq PT1 (getpoint "Select mid point of text: "))
      (setq PT2 (getpoint "\nSelect direction of text: "))
    ;;;Text data
      (setq TAG (strcat "ASPHALT PARKING LOT" ))
      (setq ang (angle PT1 PT2))
      ;;;TEXT TO PRINT ON SCREEN
      (entmake (list
    	     (cons 0 "MTEXT")
    ;;;	     (cons 100 "ACDDMTEXT")
    	     (cons 7 "LEROY")
    	     (cons 8 "E_TEXT_L080")
    	     (cons 71 2)
    	     (cons 72 5)
    	     (cons 73 1)
    	     (cons 10 PT1)
    	     (cons 50 ANG)
    	     (cons 41 19.35)
    	     (cons 40 (* (getvar "dimscale") 0.08))
    	     (cons 1 (princ TAG))
    	   )
      )
      (setvar "osmode" 0)
      (setvar "cmdecho" 1)
      (redraw)
      (princ)
    )
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]
    Last edited by Opie; 2005-11-09 at 02:12 PM. Reason: [CODE] tags added

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Create MTEXT with Lisp

    Hi jjacoby

    Try this one:

    Code:
    (defun C:PARKING ()
      (setq |CMDECHO| (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setvar "osmode" 512)
      (setq PT1 (getpoint "Select mid point of text: "))
      (setq PT2 (getpoint pt1 "\nSelect direction of text: "))
    ;;;Text data
      (setq TAG (strcat "ASPHALT PARKING LOT" ))
      (setq ang (angle PT1 PT2))
      ;;;TEXT TO PRINT ON SCREEN
      (entmake (list
    	     (cons 0 "MTEXT")
    	     (cons 100 "AcDbEntity")
    	     (cons 100 "AcDbMText")
    	     (cons 7 "LEROY")
    	     (cons 8 "E_TEXT_L080")
    	     (cons 71 5)
    	     (cons 72 5)
    	     (cons 73 1)
    	     (cons 10 PT1)
    	     (cons 11 (list 1.0 0.0 0.0))
    	     (cons 50 ANG)
    	     (cons 41 19.35)
    	     (cons 40 (* 19.35 (strlen TAG)))
    	     (cons 44 1.0)
    	     (cons 1 TAG)
    	   )
      )
      (setvar "osmode" 0)
      (setvar "cmdecho" 1)
      (redraw)
      (princ)
    )
    Thank you

    f.

Similar Threads

  1. Mtext in LISP
    By ticad02 in forum AutoLISP
    Replies: 4
    Last Post: 2009-04-21, 01:59 PM
  2. Mtext Command in Lisp
    By bowtle in forum AutoLISP
    Replies: 12
    Last Post: 2009-01-12, 05:47 PM
  3. Create Mtext with entmake
    By TobyKanoby in forum AutoLISP
    Replies: 7
    Last Post: 2007-06-07, 08:19 AM
  4. Create a Table from mtext and lines
    By tbedrich in forum AutoCAD Tables
    Replies: 8
    Last Post: 2006-10-18, 03:50 PM
  5. Create mtext (with alter properties)
    By gis.68227 in forum AutoCAD Map 3D - General
    Replies: 0
    Last Post: 2005-04-14, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •