mfahadrazzaq Posted February 2, 2013 Share Posted February 2, 2013 Salaam to all Members, mujy ik problem darpash hy ma Lisp ki Command use kr raha hn PRL ki so mujy 3 digit chahiye bt ya command sirf 2 digit dy rahi hai so any one help me ...... Regards Fahad Razzaq Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 I'm afraid that your message is incomprehensible; didn't had luck with Google Translate either. Sorry, but really not sure how to help you. Can you try to post a picture of what you are talking about? Or, if is an AutoLISP issue, an excerpt of code? Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 Hi Dear, i have a problem when i applied Lisp command of PRL for this i required three digits bt this command shows 2 digits wht i can i do... ...... Regards Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 Do you have access to the code of said command? I mean the AutoLISP file. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 yeah bro i am using AutoLisp command Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 Then, are you allowed to post the code here? This way will be much easier to debug it. If not, what type of entity is the one that you want to increase the precision? Is a text/mtext label or is a dimension? Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 How can i change mtext precision. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 Hello bro plz tell me how Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 It depends of how the value of the label is created. For this reason it was helpful to see the code. If the number was passed to a command call as a real, then you may fix this by adjusting the LUPREC system variable. If was converted to a string, then search in code for a statement like below: (rtos [color=dimgray][b]...[/b][/color] 2) Where "..." part may be anything; when locate that try changing 2 with 3 and see if helps. Alternatively, please try to locate into the code a part that contains the string "MTEXT" (with quotes) and post at least that part here. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 thx a lot bro Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 This means that you got your issue solved? If yes, can you please describe how? Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 this not work bro Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 Until will take a look on your code, please edit the above post and add the required code tags. Thank you. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 ;;; 12345678901234567890123456789012345678901234567890 ;;; VERTEXT.LSP A program to extract the xyz ;;; coordinates from any polyline and export them ;;; to an ascii file. (defun ERR (S) (if (= S "Function cancelled") (princ "\nVERTEXT - cancelled: ") (progn (princ "\nVERTEXT - Error: ") (princ S) (terpri)) ;_ progn ) ; if (RESETTING) (princ "SYSTEM VARIABLES have been reset\n") (princ) ) ; err (defun SETV (SYSTVAR NEWVAL) (setq X (read (strcat SYSTVAR "1"))) (set X (getvar SYSTVAR)) (setvar SYSTVAR NEWVAL) ) ; setv (defun SETTING () (setq OERR *ERROR*) (setq *ERROR* ERR) (SETV "CMDECHO" 0) (SETV "BLIPMODE" 0) ) ; end of setting (defun RSETV (SYSTVAR) (setq X (read (strcat SYSTVAR "1"))) (setvar SYSTVAR (eval X))) ; restv (defun RESETTING () (RSETV "CMDECHO") (RSETV "BLIPMODE") (setq *ERROR* OERR)) ; end of resetting (defun DXF (CODE ENAME) (cdr (assoc CODE (entget ENAME)))) ; dxf (defun VERTEXT (/ EN VLIST) (setq EN (GET-EN)) (if (= (DXF 0 EN) "LWPOLYLINE") (setq VLIST (GET-LWVLIST EN)) (setq VLIST (GET-PLVLIST EN)) ) ; if (WRITE-IT VLIST EN) ) ;_ vertext (defun GET-EN (/ NO-ENT EN MSG1 MSG2) (setq NO-ENT 1 EN NIL MSG1 "\nSelect a polyline: " MSG2 "\nNo polyline selected, try again." ) ; setq (while NO-ENT (setq EN (car (entsel MSG1))) (if (and EN (or (= (DXF 0 EN) "LWPOLYLINE") (= (DXF 0 EN) "POLYLINE")) ; or ) ; and (progn (setq NO-ENT NIL)) ; progn (prompt MSG2) ) ; if ) ; while EN ) ; get-en (defun GET-LWVLIST (EN / ELIST NUM-VERT VLIST) (setq ELIST (entget EN) NUM-VERT (cdr (assoc 90 ELIST)) ELIST (member (assoc 10 ELIST) ELIST) VLIST NIL ) ; setq (repeat NUM-VERT (setq VLIST (append VLIST (list (cdr (assoc 10 ELIST)))) ; append ) ; setq (setq ELIST (cdr ELIST) ELIST (member (assoc 10 ELIST) ELIST) ) ; setq ) ; repeat VLIST ) ; get-lwvlist (defun GET-PLVLIST (EN / VLIST) (setq VLIST NIL EN (entnext EN) ) ; setq (while (/= "SEQEND" (DXF 0 EN)) (setq VLIST (append VLIST (list (DXF 10 EN)))) (setq EN (entnext EN)) ) ; while VLIST ) ; get-plvlist (defun WRITE-IT (VLST EN / NEWVLIST MSG3 FNAME) (setq NEWVLIST (mapcar '(lambda (X) (trans X EN 0)) ;_ lambda VLST ) ;_ mapcar MSG3 "Polyline vertex file" ;FNAME (getfiled MSG3 "" "txt" 1) F1 (open "FNAME" "w") ) ; setq (WRITE-HEADER) (WRITE-VERTICES NEWVLIST) (setq F1 (close F1)) ) ;_ write-it (defun WRITE-HEADER (/ STR) (setq STR " POLYLINE VERTEX POINTS") (write-line STR F1) (setq STR (strcat " X " " Y " " Z") ;_ strcat ) ;_ setq (write-line STR F1) ) ;_ write-header (defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR) ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** ;Change The Text Height in Next Row Figure (setq httt "1.5") ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** (setq gptx (getpoint "\nBasepoint for X axis: ")) (setq gpty (getpoint "\nBasepoint for Y axis: ")) (foreach ITEM NEWVLIST (setq XSTR (rtos (nth 0 ITEM) 3 3) YSTR (rtos (nth 1 ITEM) 3 3) ZSTR (rtos (nth 2 ITEM) 3 3) STR (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat ) ; setq ; (write-line STR F1) (command "Mtext" (list (+(atof xstr)(/ (atof httt) 3.0)) (cadr gptx)) httt "90" (strcat xstr)) (command "Mtext" (list (+(atof xstr)(/ (atof httt) 3.0)) (cadr gpty)) httt "90" (strcat ystr)) ) ; foreach ) ; write-vertices (defun SPACES (STR / FIELD NUM CHAR SPACE) (setq FIELD 15 NUM (- FIELD (strlen STR)) CHAR " " SPACE "" ) ;_ setq (repeat NUM (setq SPACE (strcat SPACE CHAR))) ;_ repeat ) ;_ spaces (defun C:prl () (SETTING) (VERTEXT) (RESETTING) (princ)) ; c:nsl (prompt "\nwritten Azmat Ali 03317605164") (prompt "\nCommand: PRL to Start ") Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 ;;; 12345678901234567890123456789012345678901234567890 ;;; VERTEXT.LSP A program to extract the xyz ;;; coordinates from any polyline and export them ;;; to an ascii file. (defun ERR (S) (if (= S "Function cancelled") (princ "\nVERTEXT - cancelled: ") (progn (princ "\nVERTEXT - Error: ") (princ S) (terpri)) ;_ progn ) ; if (RESETTING) (princ "SYSTEM VARIABLES have been reset\n") (princ) ) ; err (defun SETV (SYSTVAR NEWVAL) (setq X (read (strcat SYSTVAR "1"))) (set X (getvar SYSTVAR)) (setvar SYSTVAR NEWVAL) ) ; setv (defun SETTING () (setq OERR *ERROR*) (setq *ERROR* ERR) (SETV "CMDECHO" 0) (SETV "BLIPMODE" 0) ) ; end of setting (defun RSETV (SYSTVAR) (setq X (read (strcat SYSTVAR "1"))) (setvar SYSTVAR (eval X))) ; restv (defun RESETTING () (RSETV "CMDECHO") (RSETV "BLIPMODE") (setq *ERROR* OERR)) ; end of resetting (defun DXF (CODE ENAME) (cdr (assoc CODE (entget ENAME)))) ; dxf (defun VERTEXT (/ EN VLIST) (setq EN (GET-EN)) (if (= (DXF 0 EN) "LWPOLYLINE") (setq VLIST (GET-LWVLIST EN)) (setq VLIST (GET-PLVLIST EN)) ) ; if (WRITE-IT VLIST EN) ) ;_ vertext (defun GET-EN (/ NO-ENT EN MSG1 MSG2) (setq NO-ENT 1 EN NIL MSG1 "\nSelect a polyline: " MSG2 "\nNo polyline selected, try again." ) ; setq (while NO-ENT (setq EN (car (entsel MSG1))) (if (and EN (or (= (DXF 0 EN) "LWPOLYLINE") (= (DXF 0 EN) "POLYLINE")) ; or ) ; and (progn (setq NO-ENT NIL)) ; progn (prompt MSG2) ) ; if ) ; while EN ) ; get-en (defun GET-LWVLIST (EN / ELIST NUM-VERT VLIST) (setq ELIST (entget EN) NUM-VERT (cdr (assoc 90 ELIST)) ELIST (member (assoc 10 ELIST) ELIST) VLIST NIL ) ; setq (repeat NUM-VERT (setq VLIST (append VLIST (list (cdr (assoc 10 ELIST)))) ; append ) ; setq (setq ELIST (cdr ELIST) ELIST (member (assoc 10 ELIST) ELIST) ) ; setq ) ; repeat VLIST ) ; get-lwvlist (defun GET-PLVLIST (EN / VLIST) (setq VLIST NIL EN (entnext EN) ) ; setq (while (/= "SEQEND" (DXF 0 EN)) (setq VLIST (append VLIST (list (DXF 10 EN)))) (setq EN (entnext EN)) ) ; while VLIST ) ; get-plvlist (defun WRITE-IT (VLST EN / NEWVLIST MSG3 FNAME) (setq NEWVLIST (mapcar '(lambda (X) (trans X EN 0)) ;_ lambda VLST ) ;_ mapcar MSG3 "Polyline vertex file" ;FNAME (getfiled MSG3 "" "txt" 1) F1 (open "FNAME" "w") ) ; setq (WRITE-HEADER) (WRITE-VERTICES NEWVLIST) (setq F1 (close F1)) ) ;_ write-it (defun WRITE-HEADER (/ STR) (setq STR " POLYLINE VERTEX POINTS") (write-line STR F1) (setq STR (strcat " X " " Y " " Z") ;_ strcat ) ;_ setq (write-line STR F1) ) ;_ write-header (defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR) ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** ;Change The Text Height in Next Row Figure (setq httt "1.5") ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** (setq gptx (getpoint "\nBasepoint for X axis: ")) (setq gpty (getpoint "\nBasepoint for Y axis: ")) (foreach ITEM NEWVLIST (setq XSTR (rtos (nth 0 ITEM) 3 3) YSTR (rtos (nth 1 ITEM) 3 3) ZSTR (rtos (nth 2 ITEM) 3 3) STR (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat ) ; setq ; (write-line STR F1) (command "Mtext" (list (+(atof xstr)(/ (atof httt) 3.0)) (cadr gptx)) httt "90" (strcat xstr)) (command "Mtext" (list (+(atof xstr)(/ (atof httt) 3.0)) (cadr gpty)) httt "90" (strcat ystr)) ) ; foreach ) ; write-vertices (defun SPACES (STR / FIELD NUM CHAR SPACE) (setq FIELD 15 NUM (- FIELD (strlen STR)) CHAR " " SPACE "" ) ;_ setq (repeat NUM (setq SPACE (strcat SPACE CHAR))) ;_ repeat ) ;_ spaces (defun C:prl () (SETTING) (VERTEXT) (RESETTING) (princ)) ; c:nsl (prompt "\nwritten Azmat Ali 03317605164") (prompt "\nCommand: PRL to Start ") Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 This not working dear bro Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 Please be patient. I will take a look on your code, but this will take a while. Maybe someone else will investigate it too and post a solution sooner. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 oky i will wait Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2013 Share Posted February 2, 2013 Please tell me, what do you expect this program to do? It seems that it should list the vertex coordinates of a polyline, but what should be made with those data? At this time it is just writing a header to a file named "FNAME" saved into current folder (but no other data) and attempts to draw a kind of table (but with overlapped lines) operation which fail due to poor syntax. Quote Link to comment Share on other sites More sharing options...
mfahadrazzaq Posted February 2, 2013 Author Share Posted February 2, 2013 wait i send again ;;; 12345678901234567890123456789012345678901234567890 ;;; VERTEXT.LSP A program to extract the xyz ;;; coordinates from any polyline and export them ;;; to an ascii file. (defun ERR (S) (if (= S "Function cancelled") (princ "\nVERTEXT - cancelled: ") (progn (princ "\nVERTEXT - Error: ") (princ S) (terpri)) ;_ progn ) ; if (RESETTING) (princ "SYSTEM VARIABLES have been reset\n") (princ) ) ; err (defun SETV (SYSTVAR NEWVAL) (setq X (read (strcat SYSTVAR "1"))) (set X (getvar SYSTVAR)) (setvar SYSTVAR NEWVAL) ) ; setv (defun SETTING () (setq OERR *ERROR*) (setq *ERROR* ERR) (SETV "CMDECHO" 0) (SETV "BLIPMODE" 0) ) ; end of setting (defun RSETV (SYSTVAR) (setq X (read (strcat SYSTVAR "1"))) (setvar SYSTVAR (eval X))) ; restv (defun RESETTING () (RSETV "CMDECHO") (RSETV "BLIPMODE") (setq *ERROR* OERR)) ; end of resetting (defun DXF (CODE ENAME) (cdr (assoc CODE (entget ENAME)))) ; dxf (defun VERTEXT (/ EN VLIST) (setq EN (GET-EN)) (if (= (DXF 0 EN) "LWPOLYLINE") (setq VLIST (GET-LWVLIST EN)) (setq VLIST (GET-PLVLIST EN)) ) ; if (WRITE-IT VLIST EN) ) ;_ vertext (defun GET-EN (/ NO-ENT EN MSG1 MSG2) (setq NO-ENT 1 EN NIL MSG1 "\nSelect a polyline: " MSG2 "\nNo polyline selected, try again." ) ; setq (while NO-ENT (setq EN (car (entsel MSG1))) (if (and EN (or (= (DXF 0 EN) "LWPOLYLINE") (= (DXF 0 EN) "POLYLINE")) ; or ) ; and (progn (setq NO-ENT NIL)) ; progn (prompt MSG2) ) ; if ) ; while EN ) ; get-en (defun GET-LWVLIST (EN / ELIST NUM-VERT VLIST) (setq ELIST (entget EN) NUM-VERT (cdr (assoc 90 ELIST)) ELIST (member (assoc 10 ELIST) ELIST) VLIST NIL ) ; setq (repeat NUM-VERT (setq VLIST (append VLIST (list (cdr (assoc 10 ELIST)))) ; append ) ; setq (setq ELIST (cdr ELIST) ELIST (member (assoc 10 ELIST) ELIST) ) ; setq ) ; repeat VLIST ) ; get-lwvlist (defun GET-PLVLIST (EN / VLIST) (setq VLIST NIL EN (entnext EN) ) ; setq (while (/= "SEQEND" (DXF 0 EN)) (setq VLIST (append VLIST (list (DXF 10 EN)))) (setq EN (entnext EN)) ) ; while VLIST ) ; get-plvlist (defun WRITE-IT (VLST EN / NEWVLIST MSG3 FNAME) (setq NEWVLIST (mapcar '(lambda (X) (trans X EN 0)) ;_ lambda VLST ) ;_ mapcar MSG3 "Polyline vertex file" ;FNAME (getfiled MSG3 "" "txt" 1) F1 (open "FNAME" "w") ) ; setq (WRITE-HEADER) (WRITE-VERTICES NEWVLIST) (setq F1 (close F1)) ) ;_ write-it (defun WRITE-HEADER (/ STR) (setq STR " POLYLINE VERTEX POINTS") (write-line STR F1) (setq STR (strcat " X " " Y " " Z") ;_ strcat ) ;_ setq (write-line STR F1) ) ;_ write-header (defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR) ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** ;Change The Text Height in Next Row Figure (setq httt "1.5") ;*************************************************************************** ;*************************************************************************** ;*************************************************************************** (setq gptx (getpoint "\nBasepoint for X axis: ")) (setq gpty (getpoint "\nBasepoint for Y axis: ")) (foreach ITEM NEWVLIST (setq XSTR (rtos (nth 0 ITEM) 2 2) YSTR (rtos (nth 1 ITEM) 2 2) ZSTR (rtos (nth 2 ITEM) 2 2) STR (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat ) ; setq ; (write-line STR F1) (command "text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gptx)) httt "90" (strcat xstr)) (command "text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gpty)) httt "90" (strcat ystr)) ) ; foreach ) ; write-vertices (defun SPACES (STR / FIELD NUM CHAR SPACE) (setq FIELD 15 NUM (- FIELD (strlen STR)) CHAR " " SPACE "" ) ;_ setq (repeat NUM (setq SPACE (strcat SPACE CHAR))) ;_ repeat ) ;_ spaces (defun C:prl () (SETTING) (VERTEXT) (RESETTING) (princ)) ; c:nsl (prompt "\nwritten Azmat Ali 03317605164") (prompt "\nCommand: PRL to Start ") 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.