sanju2323 Posted December 10, 2014 Posted December 10, 2014 I want lisp to get at the beginning and end of each polyline of the Elevation Label Label Sample.dwg Quote
SLW210 Posted December 10, 2014 Posted December 10, 2014 I moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the appropriate forum most closely related to your question. Quote
BIGAL Posted December 11, 2014 Posted December 11, 2014 A start for you maybe have a go at writing a lisp using vl you can get co-ords of plines and their elevation (vl-load-com)(setq obj1 (vlax-ename->vla-object (car (entsel "\npick pline"))))(setq coords (vlax-safearray->list (vlax-variant-value(vla-get-coordinates obj1)))) ; 1st 2 variables are start last 2 are end pt(setq ht (vla-get-elevation obj1)) ; height of pline[code] Quote
sanju2323 Posted December 11, 2014 Author Posted December 11, 2014 i have got it already lisp file but in this lisp file little be mistake. this file was generate only start edge. i need generated with Polyline both of side edge. (defun C:MCL () (setq ss (ssget'((0 . "LWPOLYLINE")))) (setq sslngth (sslength ss)) (Setq idx 0) (repeat sslngth (setq ename (ssname ss (setq sslngth (1- sslngth)))) (setq edata (entget ename)) (setq xy (cdr (Assoc 38 edata))) (setq xy1(cdr (Assoc 10 edata))) (setq xx(rtos xy 2 3)) (command "text" xy1 2 30 xx "") ) ) Quote
hanhphuc Posted December 11, 2014 Posted December 11, 2014 (edited) i have got it already lisp file but in this lisp file little be mistake. this file was generate only start edge. i need generated with Polyline both of side edge. Try.. (defun c:test (/ ss i ed p [color="red"]sz[/color]) [color="red"](initget 6) (if (not(setq sz (getdist "\nText size : "))) (setq sz (getvar "textsize")))[/color] (prompt "\nSelect Contour.. ") (if (setq ss (ssget ":L" '((0 . "LWPOLYLINE")))) (repeat (setq i (sslength ss)) (setq ed (entget (ssname ss (setq i (1- i))))) (foreach x (list (car (setq p (vl-remove-if ''((x) (/= (car x) 10)) ed))) (last p)) (entmakex (list '(0 . "TEXT")'(8 . "CONTOUR LABEL") (cons 1 (rtos (cdr (assoc 38 ed)) 2 3)) (cons 40[color="red"] sz[/color]) x ) ;_ end of list ) ;_ end of entmakex ) ;_ end of foreach ) ;_ end of repeat ) ;_ end of if (princ) ) ;_ end of defun i hope BIGAL can understand im online now to help OP Edited December 11, 2014 by hanhphuc textsize Quote
hanhphuc Posted December 11, 2014 Posted December 11, 2014 you are welcome, please read this regarding code Tag for newbie http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines Quote
sanju2323 Posted December 11, 2014 Author Posted December 11, 2014 can you make changes in LISP. For example set text height, "2" and select polyline or spline Quote
hanhphuc Posted December 11, 2014 Posted December 11, 2014 #5 updated (in red) you can set default, command: textsize Quote
sanju2323 Posted December 12, 2014 Author Posted December 12, 2014 sir can you give me last time changes in the lisp file? i want to label generate the single time at closest Polyline. Quote
SLW210 Posted December 12, 2014 Posted December 12, 2014 Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. Quote
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.