TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: sballew on December 13, 2018, 01:54:59 PM

Title: Copy Mtext content then paste in Attribute Editor
Post by: sballew on December 13, 2018, 01:54:59 PM
Hello,

This is my first post so I will try not to be too long winded.  I have searched the forums and can not find what I am looking for.  It may be that I am just searching the wrong thing.  I wrote a script some years ago and would like to add a new feature to it if possible.  Basically, I have two layout tabs with title blocks.  The first tab was made up of a title block that has no attributes and multiple lines of dtext.  I converted the title portion to mtext.  This is the only mtext element on this tab.  The second layout is a title block that has attribute elements.  I would like to know if there is a way to copy the contents out of the mtext, then switch the layout tab open the Enhanced Attribute Editor and drop the content into an attribute value. I read about Doslib, and I have been messing with it, but I am still not able to mimic that Ctrl+C function. 

Title: Re: Copy Mtext content then paste in Attribute Editor
Post by: CAB on December 13, 2018, 02:00:11 PM
One of these will likely do the job.
--------------  Clone / Copy / Merge Text  ----------------
Clone Text Object by CAB - Clone one text string from dText mText
or Attribute to other selected dText mText or Attribute object
http://www.theswamp.org/index.php?topic=6874.0
http://www.theswamp.org/index.php?topic=30368.0  CopyText.lsp v1.3 by Alan J. Thompson (alanjt)
http://www.theswamp.org/index.php?topic=28685.0  SwapText by Joe Burke
http://www.theswamp.org/index.php?topic=19805.msg241476#msg241476  Copy 2 Clipboard VVA
http://www.theswamp.org/index.php?topic=21764.0   Copy 2 Clipboard
http://www.theswamp.org/index.php?topic=21764.msg263566#msg263566
http://www.theswamp.org/index.php?topic=30451.0  txt2mtxt w/ copy option LeeMac
http://www.theswamp.org/index.php?topic=36265.msg414554#msg414554 LeeMac
http://www.theswamp.org/index.php?topic=36265 LeeMac
http://www.theswamp.org/index.php?topic=35607.0  t2mt RonJonP
Title: Re: Copy Mtext content then paste in Attribute Editor
Post by: sballew on December 17, 2018, 12:21:55 PM
Here is where I am stuck.  Unfortunately some of the lisps that were provided did not work.  The routine that I have worked out is below with the section that I am stuck at is in all CAPS.

;sets FILEDIA system variable to 0
filedia
0
;begin layout command and add 4W-11X17.dwt template
layout
T
4W-11X17.dwt
Layout1
;sets FILEDIA system variable to 1
filedia
1
;Sets View to Layout1
layout
s
layout1
;Lock Title Layer
-layer
lo
title

;Copy window Viewport
copybase
0,0
window
-0.02,10.66
14.72,-0.02

;Sets View to layout2-layout1
layout
s
layout2-layout1
;Pastes original Viewport into new layout
pasteclip
0.099572,0
;Copy title info from original title block
layout
s
layout1
(load " T:/Lisp Routines/txtpre.lsp")
txtpre
window
14.725,4.55
16.25,4.35

-
txt2mtxt
window
14.725,5.0625
16.25,4.35

;THIS IS THE SECTION WHERE I NEED TO COPY THE CONTENTS OF THE MTEXT.  I WOULD LIKE TO WINDOW AT 14.725,5.0625 DOWN TO 16.25,4.35 (SIZE OF MTEXT FIELD) THEN COPY THE CONTENTS OF THE MTEXT TO CLIPBOARD.
;NEXT I WOULD SWITCH TO LAYOUT2-LAYOUT1 AND -ATTEDIT THE TITLE BLOCK (NAME: 4W-11X17)
;LAST STEP WOULD BE TO PASTE THE CONTENTS OF THE CLIPBOARD INTO VALUE (TAG: TITLE_1)

;Delete original Title Block
-layout
d
layout1
;Rename new Title Block
-layout
r
Layout2-layout1
Layout1
;Unlock TITLE layer
-layer
u
TITLE

;Regenerate Drawing
regen
;Zoom to Extents
zoom
e
qsave

Thanks!

Shaun