lucky9 Posted June 11, 2018 Share Posted June 11, 2018 Need a lisp that would calculate distance between lines in a map and place it at the center of each lines. I need to select all the lines at once instead of selecting each line one by one. Regards, lucky9 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 12, 2018 Share Posted June 12, 2018 Now where is the crystal ball so I can see what you want. Please post a dwg or image. Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 12, 2018 Author Share Posted June 12, 2018 Sample Drawing is attached for your reference.. it would be nice if the lengths are placed similar as it is shown in the drawing. thanks 05 Key Map_Drawing_SAMPLE.dwg Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted June 12, 2018 Share Posted June 12, 2018 (edited) hi you should ask lisp question in AutoLISP forum (defun c:test (/ en d p p2 tx1 tx2) (setvar 'dimasz 15) (while (setq en (car (entsel "\nPick polyline.. "))) (and (wcmatch (cdr(assoc 0 (entget en))) "*LINE") (setq d (vlax-curve-getdistatpoint en (vlax-curve-getendpoint en)) p (vlax-curve-getpointatdist en (* d 0.5)) tx1[color="purple"] "100MM %%C"[/color] tx2 (strcat "L=" (rtos d 2 0) "M") p2 (if (and pointer:marker msg:pointer) ([color="blue"]msg:pointer[/color] (list[color="red"] (trans p 0 1)[/color]) 1 (strcat tx1 "\\P" tx2)) (getpoint p "\nSpecific next point.. ")) ) (vl-cmdf "_leader" "_non" [color="red"](trans p 0 1)[/color] "_non" p2 "" tx1 tx2 "") ) ) (princ) ) visual utility msg:pointer p/s: @BIGAL i noticed you were offline while the OP was online my quick reply didn't mean to hijack. Edited June 12, 2018 by hanhphuc (trans p 0 1) Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 12, 2018 Author Share Posted June 12, 2018 Hi there , I tried your solution when selecting the polyline it does nothing. here is a screen capture. Btw, I post the question in wrong section by mistake if any mod would move this post to the right section would be appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted June 12, 2018 Share Posted June 12, 2018 Hi there , I tried your solution when selecting the polyline it does nothing. here is a screen capture. Btw, I post the question in wrong section by mistake if any mod would move this post to the right section would be appreciated. Thanks did you download the visual utility link provided ? missing routine? pointer:marker msg:pointer i edited previous post, try it still can run without these visual utilities. please retry Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 12, 2018 Author Share Posted June 12, 2018 did you download the visual utility link provided ?missing routine? pointer:marker msg:pointer i edited previous post, try it still can run without these visual utilities. please retry I didn't download it , are you referring to msg:pointer code? Awesome ! Thanks Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 12, 2018 Share Posted June 12, 2018 Hanhphuc I would use the simple check for a library routine. I like the look of the pointer code will have a closer look. (if (not msg:pointer)(Load "msg-pointer")) ; save lisp as say msg-pointer Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted June 12, 2018 Share Posted June 12, 2018 Hanhphuc I would use the simple check for a library routine. I like the look of the pointer code will have a closer look. (if (not msg:pointer)(Load "msg-pointer")) ; save lisp as say msg-pointer Thanks BIGAL it makes sense, if OP keeps this sub different file Quote Link to comment Share on other sites More sharing options...
SLW210 Posted June 12, 2018 Share Posted June 12, 2018 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the most relevant Forum. Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 12, 2018 Author Share Posted June 12, 2018 Thanks BIGAL it makes sense, if OP keeps this sub different file Guys could you please elaborate more... I'm pretty basic in lisp. What is visual utility and how to install it or make it to work? Thank you ! Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 12, 2018 Author Share Posted June 12, 2018 Although, your solution worked pretty awesome! but what is this visual utility thingy? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted June 14, 2018 Share Posted June 14, 2018 Although, your solution worked pretty awesome! but what is this visual utility thingy? it was just my naming for those transient routines. ACAD also has osmode, gridmode , 3dorbit & vslide etc.. example getpoint 'rubber band' (setq [color="red"]p[/color] (getpoint )) (setq p2 (getpoint [color="red"]p[/color]))[color="green"] ; <-- with rubberband [/color] (setq [color="red"]p[/color] (getpoint )) (setq p2 (getpoint ))[color="green"] ; <-- without rubberband you can't see startpoint [/color] you can call any naming as you like. Quote Link to comment Share on other sites More sharing options...
lucky9 Posted June 14, 2018 Author Share Posted June 14, 2018 Thank you! hanhphuc 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.