Author Topic: Insert MText with Dynamic Column and Fixed Column Height  (Read 1564 times)

0 Members and 1 Guest are viewing this topic.

Julian Smith

  • Guest
Insert MText with Dynamic Column and Fixed Column Height
« on: December 10, 2016, 07:01:07 PM »
Hello, first time posting here; been lurking, and now I want to ask for some help please.

I have created a lisp to insert mtext that is copied from the clipboard. The wall I have run up against is trying to insert the mtext with dynamic columns and a column height of 9.5. Does anyone have any suggestions? Many thanks.
Not all of the code is my own, but I have been working on it long enough that I have forgotten where I got the original code snippet from.

(Defun C:pasteSequences ( )
  (setvar "CMDECHO" 0)

  (setq result
    (vlax-invoke
      (vlax-get
        (vlax-get
          (setq htmlfile (vlax-create-object "htmlfile"))
          'ParentWindow
        )
        'ClipBoardData
      )
           'GetData
            "Text"
        )
    )

  (vlax-release-object htmlfile)

  (setq txtInsert text) result (setq meText (list result))

  (vl-load-com)

  (command "-style" "verdana"   "verdana"   "0.075"   "0.75" "0" ""   "" )

  ;Create an MText object in model space.
  (setq acadObj (vlax-get-acad-object))
  (setq doc (vla-get-ActiveDocument acadObj))

  ;Define the multiline text object
  (setq corner (vlax-3d-point 0.4831     10.2000     0.0000) width 4.5529)

  ;Create the mtext Object
  (setq modelSpace (vla-get-ModelSpace doc))
  (setq MTextObj (vla-AddMText modelSpace corner width result))

  (princ)

)

Julian Smith

  • Guest
Re: Insert MText with Dynamic Column and Fixed Column Height
« Reply #1 on: December 14, 2016, 07:36:50 PM »
Just as aside, I figured I could use the -mtext command and do the same thing. I can configure the dynamic columns and column height OK with the -mtext command, but then I run into some kind of character limit with -mtext. It must be somewhere around 1,200 or 1,550 characters, depending on if you count spaces that I can paste from the clipboard.