pracslipkerm Posted April 25, 2006 Share Posted April 25, 2006 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) Quote Link to comment Share on other sites More sharing options...
good_m Posted April 26, 2006 Share Posted April 26, 2006 generally when you need "enter" to be inputed then in autolisp you would use double quotes "" Mike Quote Link to comment Share on other sites More sharing options...
hendie Posted April 26, 2006 Share Posted April 26, 2006 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 Quote Link to comment Share on other sites More sharing options...
randomnewb Posted August 5, 2010 Share Posted August 5, 2010 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.... Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 6, 2010 Share Posted August 6, 2010 replace (initcommandversion 2) with (initdia) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.