Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I put multi lines of text into Drawinginfo comments?

3 REPLIES 3
Reply
Message 1 of 4
SrPiper
248 Views, 3 Replies

How do I put multi lines of text into Drawinginfo comments?

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???

3 REPLIES 3
Message 2 of 4
Southernamp
in reply to: SrPiper

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?")

 

 

Message 3 of 4
pbejse
in reply to: SrPiper

 


@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
  )

Message 4 of 4
SrPiper
in reply to: pbejse

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost