Jump to content

Ending MText Lisp command


pracslipkerm

Recommended Posts

Hi everyone - I am trying to put multiple lines into an mtext object through the command line or transparently. I have gotten this to work but I can't get lisp to end the command. I keep ending up with the user needing to press enter, which seems to stop me from putting any commands after the mtext command. All the variables are strings. I am trying to explode the region used to calc area and perimeter after the mtext.

Thanks in advance for your help

Cheers

(setq partnameequals (strcat "PART_NAME=" partname))
   (setq misc1equals    (strcat "MISC1="))
   (setq thicknessequals (strcat "THICKNESS=" pl8thkstr))
   (setq numoff           (rtos nooff 2 2))
   (setq quantityequals (strcat "QUANTITY=" numoff))
   (setq materialequals (strcat "MATERIAL=" material))
   (setq customerequals (strcat "CUSTOMER=" customer))
   (setq referenceequals (strcat "REFERENCE=" reference))
   (setq remarksequals  (strcat "REMARKS="))
   (setq plateweight    (strcat "WEIGHT= " weightkgstr " K.g."))
   (setq primeta        (strcat "PERIMETER (inc. cutouts)= " perimmmstr "mm"))
   (setq areammsquared  (strcat "AREA = " areammsqrstr "mm2"))


     (command "-layer" "M" "bom" /n)
     (command "-mtext" centroid "J" "mc" "h" "5" centroid)
   (command partnameequals)
   (command misc1equals)
   (command thicknessequals)
   (command quantityequals)
   (command materialequals)
   (command customerequals)
   (command referenceequals)
   (command remarksequals)
   (command primeta)
   (command plateweight)
   (command areammsquared)
   ;(command " ")
   ;(command "explode" "previous" /n)
 (princ)
)    ;FINAL CLOSING PARENTHASES OF PROGRAM.
 (princ)

Link to comment
Share on other sites

the problem comes because you are calling the Mtext dialog box. You cannot close the box once it's open.

 

If you are entering everything programatically, why do you need the dialog box at all ?

I would get away from using "command" all the time and look at making the objects via code ~ much simpler and more effective.

 

Look into the VLA-ADDMTEXT method, then you don't need the dialog box

Link to comment
Share on other sites

  • 4 years later...

how is calling the mtext dialog box? thats what i want to do

 

(defun C:MTT()

(COMMAND "-LAYER" "S""2D_TEXT" "")

(initcommandversion 2)

(COMMAND "mtext")

(princ)

)

 

above code doesnt work, it does everything EXCEPT use the advanced text editor....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...