student21 Posted April 20, 2013 Share Posted April 20, 2013 I found a routine that I would like to use that does what I need it to do except that it puts numbers at vertices but I need it to give civil engineering stations instead starting with 0+00. Can anyone figure out how to code it? (Please see attached) Thanks TEST-12.lsp Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 21, 2013 Share Posted April 21, 2013 Since you're not using Civil 3D (which does all of this for you), why not just setup a typical "Station" block, and insert using the Measure Command, and be sure to select 'Yes' for 'Align to Object' prompt? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 22, 2013 Share Posted April 22, 2013 Just search here for Chainage along a pline theres quite a few that will do what you want. Quote Link to comment Share on other sites More sharing options...
student21 Posted April 23, 2013 Author Share Posted April 23, 2013 I checked all of the "chainage" routines and they only do the stationing at specified lengths. I am looking for a routine that will place "text" stations at the vertices and end points. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 23, 2013 Share Posted April 23, 2013 The version I have may have come from www.Theswamp.com Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 23, 2013 Share Posted April 23, 2013 Try this quickly written program: [color=GREEN];; Station - Lee Mac[/color] [color=GREEN];; Generates station labels at every vertex of selected LWPolylines.[/color] ([color=BLUE]defun[/color] c:station ( [color=BLUE]/[/color] *error* d e h i p s x ) ([color=BLUE]defun[/color] *error* ( msg ) ([color=BLUE]if[/color] ([color=BLUE]=[/color] 'int ([color=BLUE]type[/color] d)) ([color=BLUE]setvar[/color] 'dimzin d)) ([color=BLUE]if[/color] ([color=BLUE]not[/color] ([color=BLUE]wcmatch[/color] ([color=BLUE]strcase[/color] msg [color=BLUE]t[/color]) [color=MAROON]"*break,*cancel*,*exit*"[/color])) ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\nError: "[/color] msg)) ) ([color=BLUE]princ[/color]) ) ([color=BLUE]setq[/color] d ([color=BLUE]getvar[/color] 'dimzin)) ([color=BLUE]setvar[/color] 'dimzin 0) ([color=BLUE]setq[/color] h ([color=BLUE]list[/color] '(00 . [color=MAROON]"TEXT"[/color]) '(72 . 1) '(73 . 2) ([color=BLUE]cons[/color] 40 ([color=BLUE]getvar[/color] 'textsize)) ([color=BLUE]cons[/color] 07 ([color=BLUE]getvar[/color] 'textstyle)) ) ) ([color=BLUE]if[/color] ([color=BLUE]setq[/color] s ([color=BLUE]ssget[/color] '((0 . [color=MAROON]"LWPOLYLINE"[/color]) (-4 . [color=MAROON]"<NOT"[/color]) (-4 . [color=MAROON]"&="[/color]) (70 . 1) (-4 . [color=MAROON]"NOT>"[/color])))) ([color=BLUE]repeat[/color] ([color=BLUE]setq[/color] i ([color=BLUE]sslength[/color] s)) ([color=BLUE]repeat[/color] ([color=BLUE]setq[/color] x ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 90 ([color=BLUE]entget[/color] ([color=BLUE]setq[/color] e ([color=BLUE]ssname[/color] s ([color=BLUE]setq[/color] i ([color=BLUE]1-[/color] i)))))))) ([color=BLUE]setq[/color] p ([color=BLUE]vlax-curve-getpointatparam[/color] e ([color=BLUE]setq[/color] x ([color=BLUE]1-[/color] x)))) ([color=BLUE]entmake[/color] ([color=BLUE]append[/color] h ([color=BLUE]list[/color] ([color=BLUE]cons[/color] 01 (station ([color=BLUE]vlax-curve-getdistatparam[/color] e x))) ([color=BLUE]cons[/color] 10 p) ([color=BLUE]cons[/color] 11 p) ) ) ) ) ) ) ([color=BLUE]setvar[/color] 'dimzin d) ([color=BLUE]princ[/color]) ) ([color=BLUE]defun[/color] station ( x [color=BLUE]/[/color] n ) ([color=BLUE]strcat[/color] ([color=BLUE]itoa[/color] ([color=BLUE]fix[/color] ([color=BLUE]/[/color] x 100.0))) ([color=BLUE]if[/color] ([color=BLUE]minusp[/color] x) [color=MAROON]"-"[/color] [color=MAROON]"+"[/color]) ([color=BLUE]if[/color] ([color=BLUE]<[/color] ([color=BLUE]setq[/color] n ([color=BLUE]abs[/color] ([color=BLUE]rem[/color] x 100.0))) 10.0) ([color=BLUE]strcat[/color] [color=MAROON]"0"[/color] ([color=BLUE]rtos[/color] n 2 2)) ([color=BLUE]rtos[/color] n 2 2) ) ) ) ([color=BLUE]vl-load-com[/color]) ([color=BLUE]princ[/color]) @BIGAL, I think you mean www.theswamp.org Quote Link to comment Share on other sites More sharing options...
student21 Posted May 23, 2013 Author Share Posted May 23, 2013 Thanks Lee Mac, It works. Only one thing to be fixed if you can. In the routine I sent "Test-12.lsp" it would align the station text (1+00) with the irregular line or polyline. Thanks 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.