I am able to insert multi line text into the Drawing Properties Summaryinfo standard field "comments" by using string concatenation in VBA by using "mytext" & vbLF & vbCR "mytext".
But I can't find a way that works in autolisp.
This code does not work.
(defun c:FillComments (/) (vl-load-com) (setq acadObj (vlax-get-acad-object)) (setq acDoc (vlax-get-property acadObj 'ActiveDocument)) (setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo)) (setq *customer* "MyCustomerName") (setq *location* "MyLocation") (setq *project* "MyProject") (setq *comments* (strcat *customer* ", " (chr 10) (chr 13) *location* ", " (chr 10) (chr 13) *project* ) ;_ end of strcat ) ;_ end of setq (vlax-put-property acDocSumInfo "Comments" *comments*) (princ) ) ;_ end of defun
the text comes in but all on one line.
any ideas???
During the STRCAT use \n to call for carriage return/new line..
(strcat "This is all on one line in this example," "though your already seeing these results...")
(strcat "This however, should yield results\n"
"closer to what you are hoping to\n"
"accomplish if I am understanding\n"
"your true motivations correctly\n"
"\n"
"\ncorrect?")
@SrPiper wrote:But I can't find a way that works in autolisp.
This code does not work.
the text comes in but all on one line.
any ideas???
(setq *comments* (vl-princ-to-string (strcat *customer* ",\n" *location* ",\n" *project* ) ) )
or
(setq *comments*
(strcat *customer*
", " (chr 13)(chr 10);<--- 13 before 10
*location*
", "(chr 13)(chr 10)
*project*
) ;_ end of strcat
)
or even
(setq *comments*
(strcat *customer*
",\r\n" *location* ",\r\n" *project*
) ;_ end of strcat
)
THANKS
That works, so simple, but I didn't think to try that before asking for help, just get the order correct with the CR and LF. wow
thanks again to all