MText in the strcat may be too long. Is there a solution?

MText in the strcat may be too long. Is there a solution?

evietmeier_1207
Enthusiast Enthusiast
451 Views
5 Replies
Message 1 of 6

MText in the strcat may be too long. Is there a solution?

evietmeier_1207
Enthusiast
Enthusiast

Once again, being a stickler for company standards, I'm trying to get a long mleader note into a LISP routine. However, after providing the requested inputs from the user, the resulting mleader is the leader only and no text. Review of the command line shows the LISP is accepting the inputs and performing the necessary math,. but no text. I hate to ask so soon after my last request, but there seems to be some very smart people on this forum.

(defun c:stmpump ( / ml_txt)
(setq top (getreal "\nWhat is the top or gorund elevation of the pump's wet well?"))
(setq flow (getstring "\nWhat is the flowline elevation of the incoming pipe?"))
(setq ml_txt (strcat "FLYHT NP 3085 SUBMERSIBLE PUMP (OR APPROVED EQUAL)\nAND 45in X 120in CONCRETE BASIN (OR APPROVED EQUAL)\nWITH SOLID H-20 RATED COVER\nT=" (rtos top 2 2) "\n6in PVC FL IN=" flow "\n3in DISCHARGE W/ GATE VALVE FL=" (rtos (- top 3.00) 2 2) "\nBOTTOM=" (rtos (- top 10.00) 2 2) "\n(DUPLEX PUMPS MAY BE INSTALLED AT OWNERS DIRECTION)\n(240v BACKUP GENERATOR OR BATTERY BACKUP WITH\n2 HOUSE MINIMUM RUNTIM IS RECOMMENDED FOR\nEMERGENCY USE DURING POWER FAILURE OR OUTAGE\n(NOTE: PUMP FAILURE MAY RESULT IN PONDING INTO THE\nGARAGE AND BASEMENT)\n(IF GROUND WATER IS ENCOUNTERED, CONTRACTOR TO\n ADJUST 'ON' FLOAT SWITCH TO BE AT OR ABOVE NORMAL\nWATER LEVEL"))
(command "_mleader" pause pause ml_txt)
)

 

Any help is greatly appreciated. And I am learning each time.

Thank you

0 Likes
Accepted solutions (1)
452 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend
If I may ask... since this is a static never-changes-text-in-an-mleader why not just drag/drop an instance of it to a user palette sources from a master file that's in your search paths, then use that all day long instead?
0 Likes
Message 3 of 6

komondormrex
Mentor
Mentor
Accepted solution

fill in text in mleader after it is created

(defun c:stmpump ( / ml_txt)
(setq top (getreal "\nWhat is the top or gorund elevation of the pump's wet well?"))
(setq flow (getstring "\nWhat is the flowline elevation of the incoming pipe?"))
(setq ml_txt (strcat "FLYHT NP 3085 SUBMERSIBLE PUMP (OR APPROVED EQUAL)\nAND 45in X 120in CONCRETE BASIN (OR APPROVED EQUAL)\nWITH SOLID H-20 RATED COVER\nT=" (rtos top 2 2) "\n6in PVC FL IN=" flow "\n3in DISCHARGE W/ GATE VALVE FL=" (rtos (- top 3.00) 2 2) "\nBOTTOM=" (rtos (- top 10.00) 2 2) "\n(DUPLEX PUMPS MAY BE INSTALLED AT OWNERS DIRECTION)\n(240v BACKUP GENERATOR OR BATTERY BACKUP WITH\n2 HOUSE MINIMUM RUNTIM IS RECOMMENDED FOR\nEMERGENCY USE DURING POWER FAILURE OR OUTAGE\n(NOTE: PUMP FAILURE MAY RESULT IN PONDING INTO THE\nGARAGE AND BASEMENT)\n(IF GROUND WATER IS ENCOUNTERED, CONTRACTOR TO\n ADJUST 'ON' FLOAT SWITCH TO BE AT OR ABOVE NORMAL\nWATER LEVEL"))
(command "_mleader" pause pause "")
(vla-put-textstring (vlax-ename->vla-object (entlast)) ml_txt)
)

 

Message 4 of 6

evietmeier_1207
Enthusiast
Enthusiast

The user inputs will be different for every project. I currently have a drag and drop solution in a custom tool palette but was hoping to automate it more and have a LISP ask the user for the elevations. This way they don't need to remember to go back and edit the note later. My idea is to limit my drafters plotting with blank elevations in a note. I hope this helps make sense of my request.

0 Likes
Message 5 of 6

evietmeier_1207
Enthusiast
Enthusiast

That's perfect. I still need to learn more about vla- and other related commands. Thanks for the solution.

0 Likes
Message 6 of 6

john.uhden
Mentor
Mentor

@evietmeier_1207 ,

I don't think I have ever tried your method of providing such a lengthy string within the MLEADER command, but an MLEADER shares the same kind of construction as MText.

First, I am just guessing that neither command can take such a long string (over 256 characters) on input.  And don't bother trying to use DXF codes and entmod.

If you can programmatically create an mleader, then you can change its Textstring property to anything you want via (vlax-put object 'Textsting my_long_string) wherein object must be a vla-object.

John F. Uhden

0 Likes