sanju2323 Posted February 12, 2016 Posted February 12, 2016 This Lisp is measure and putting chainage in the block, but I have to change the chainage rather increment number. Increment block.dwg Increament Block.lsp Quote
BIGAL Posted February 12, 2016 Posted February 12, 2016 You should have asked Tharwat direct via here. He is very helpful. Quote
Tharwat Posted February 13, 2016 Posted February 13, 2016 Hi, Can you explain your goal in a bit more details ? it does not seem clear enough to me to get what you want from the attached drawing. You should have asked Tharwat direct via here. He is very helpful. Thank you BIGAL , it is very kind of you to say that. highly appreciated. Quote
sanju2323 Posted February 13, 2016 Author Posted February 13, 2016 Sir, I have to measure Polyline at 1750 meters, and also put the chainage in the block. But I wanted serial No. instead of chainage. Thank you Quote
Tharwat Posted February 13, 2016 Posted February 13, 2016 Which part of the attribute value represents the chainage? So how would the outcome of the attribute value going to be? give one instance. Quote
sanju2323 Posted February 13, 2016 Author Posted February 13, 2016 Dear sir, Please see screenshot Quote
Tharwat Posted February 13, 2016 Posted February 13, 2016 So you want to insert that attributed block name: MATCH_LINE at every distance of 1750 and replace the distance value with increment number starts with 001 ? Quote
sanju2323 Posted February 13, 2016 Author Posted February 13, 2016 that's right sir, increments block matchline number should be. Quote
Tharwat Posted February 13, 2016 Posted February 13, 2016 Try this. (defun c:Test (/ b s e l d g n a p) ;; Tharwat 13.Feb.2016 ;; (setq b "MATCH_LINE");; Block name (if (and (if (tblsearch "BLOCK" b) t (progn (alert (strcat "Block name <" b "> is not found in drawing !") ) nil ) ) (princ "\nSelect LWpolyline :") (setq s (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) (setq l (vlax-curve-getdistatpoint (setq e (ssname s 0)) (vlax-curve-getendpoint e) ) d 1750. g d n 1 p (vlax-get (vla-get-activelayout (vla-get-ActiveDocument (vlax-get-acad-object)) ) 'Block ) ) ) (repeat (fix (/ l 1750)) (if (setq a (vla-InsertBlock p (vlax-3d-point (vlax-curve-getpointatdist e d)) b 1.0 1.0 1.0 0. ) ) (progn (vla-put-rotation a (angle '(0. 0. 0.) (vlax-curve-getfirstderiv e (vlax-curve-getparamatpoint e (vlax-curve-getpointatdist e d) ) ) ) ) (vla-put-textstring (car (vlax-invoke a 'getattributes)) (strcat "GAIL-MSA-CHOKARI TO UNDERA-AS-" (cond ((< n 10) "00") ((< n 100) "0") (t "") ) (itoa n) ) ) (setq n (1+ n) d (+ d g) ) ) ) ) ) (princ) ) (vl-load-com) Quote
sanju2323 Posted February 14, 2016 Author Posted February 14, 2016 Tharwat, Thanks for your lisp code, it's great. Please you can add the option to polyline manually measure the distance. Quote
Tharwat Posted February 14, 2016 Posted February 14, 2016 Tharwat, Thanks for your lisp code, it's great. Please you can add the option to polyline manually measure the distance. Excellent, try this [uNTESTED] adds. (defun c:Test (/ b s e l d g n a p j) ;; Tharwat 13.Feb.2016 ;; (setq b "MATCH_LINE");; Block name (if (and (if (tblsearch "BLOCK" b) t (progn (alert (strcat "Block name <" b "> is not found in drawing !") ) nil ) ) (princ "\nSelect LWpolyline :") (setq s (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) (setq j (getdist "\nSpecify Distance on LWpolyline to place blocks :")) (setq l (vlax-curve-getdistatpoint (setq e (ssname s 0)) (vlax-curve-getendpoint e) ) d j g d n 1 p (vlax-get (vla-get-activelayout (vla-get-ActiveDocument (vlax-get-acad-object)) ) 'Block ) ) (if (> l j) t (progn (princ (strcat "\nInserted Distance <" (rtos j 2 4) "> is shorter than selected LWpolyline's length !")) nil)) ) (repeat (fix (/ l j)) (if (setq a (vla-InsertBlock p (vlax-3d-point (vlax-curve-getpointatdist e d)) b 1.0 1.0 1.0 0. ) ) (progn (vla-put-rotation a (angle '(0. 0. 0.) (vlax-curve-getfirstderiv e (vlax-curve-getparamatpoint e (vlax-curve-getpointatdist e d) ) ) ) ) (vla-put-textstring (car (vlax-invoke a 'getattributes)) (strcat "GAIL-MSA-CHOKARI TO UNDERA-AS-" (cond ((< n 10) "00") ((< n 100) "0") (t "") ) (itoa n) ) ) (setq n (1+ n) d (+ d g) ) ) ) ) ) (princ) )(vl-load-com) Quote
sanju2323 Posted February 14, 2016 Author Posted February 14, 2016 Thank you very much again, I'll never forget your favor. Quote
Tharwat Posted February 14, 2016 Posted February 14, 2016 Thank you very much again, I'll never forget your favor. You're welcome anytime. Quote
sanju2323 Posted February 16, 2016 Author Posted February 16, 2016 (edited) Hi Tharwat, You can add one more option. "GAIL-MSA-CHOKARI TO UNDERA-AS-" is the name of the drawing, so please add it manually option of asking. Edited March 11, 2016 by sanju2323 Quote
Cristian C. Posted February 15, 2019 Posted February 15, 2019 Hi Tharwat, I want to use your lisp and I get the following error "; error: no function definition: VLAX-CURVE-GETENDPOINT". Can you please help. Thank you! Quote
Tharwat Posted February 15, 2019 Posted February 15, 2019 1 hour ago, Cristian C. said: Hi Tharwat, I want to use your lisp and I get the following error "; error: no function definition: VLAX-CURVE-GETENDPOINT". Can you please help. Thank you! Hi, It seems that your AutoCAD does not load the vl-functions library or it may not loaded with your version, so if you repair your CAD version from Control Panel that should help otherwise you may need to reinstall your version once again. Quote
BIGAL Posted February 17, 2019 Posted February 17, 2019 Is this just the1st stage of setting up an auto sheet routine next step is creating layouts automatically with each sheet section. 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.