- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am exporting contour xrefs from a 3d program which spits out the labels as text. I have created a lisp which converts this text to mtext, adds a background mask, and justifys all the text to middle centre and this works great. What i have also created is a simple script which turns on ANNOAUTOSCALE then cycles through the CANNOSCALE of certain scales which essentially gives me somewhat automated annotative text scales.
The manual things i have to do
1. open and select all text to make it annotative
2. run the script which gives annotation scales to my text
3. run the lisp which turns all the txt to mtxt etc
4. change the background mask to 1.1 not 1.5 as that is set as the default.
Information im looking for.
1. is it possible to set the text objects to annotative? alternatively could set the a textsyle which is already annotative?
2. is it possible to change the background mask border offset via lisp? (have googled alot but no dice)
2. is it possible to add my lisp and script together to run all at once
Lisp txttomtext code
(defun C:ContourExport (/ ss1 en n)
;; Select all Text objects
(setq ss1 (ssget "_X" (list (cons 0 "TEXT"))))
(setq i -1)
(if ss1
(repeat (sslength ss1)
(setq elist (cdr (assoc -1 (entget (ssname ss1 (setq i (1+ i)))))))
(command "TXT2MTXT" elist "")
)
)
;; Select all MText objects
(setq ss1 (ssget "_X" (list (cons 0 "MTEXT"))))
(if ss1
(progn
(setq n (sslength ss1))
(repeat n
(setq n (1- n))
(setq en (vlax-ename->vla-object (ssname ss1 n)))
(if (vlax-property-available-p en 'BackgroundFill)
(vlax-put en 'BackgroundFill 1)
)
(vlax-put en 'AttachmentPoint 5) ; Set the attachment point to middle center
)
)
(prompt "\nNo MText found.")
)
(princ)
)
Script code
ANNOAUTOSCALE 1
CANNOSCALE "1:500 (M)"
CANNOSCALE "1:2000 (M)"
CANNOSCALE "Metres 1:1000"
Solved! Go to Solution.