I'm working on sewer planning, so I have to label a ton of 2D polyline segments with its length, slope, pipe type (material), and pipe profile (radius in mm). All of these information's are stored in .dat file (text file, input file extension for AutoCAD module I'm using). Module is based on AutoCAD Map 2008, also I use Civil 3D 2010.
As you can see, above line segment is printed segment length with suffix "L=", under the segment is slope (in percentage) with suffix "i=" and prefix "%" and type material (PVC SN8).
I would format .dat file to contain only necessary data, and to be .txt off course.
Is it possible to do this in Civil 3D somehow, or it requires writing a LISP?
(I've attached cleaned .txt file. First column is segment length, second pipe material, third pipe radius (profile), and fourth is slope).
Any help is welcome. I'm loosing a lot of time on doing this by hand. I have less then 30 days to finish, so any hour saved is
significant.
All of the modules for surveying and planing are in Map 3D 2008, so I'm using it in 9/10 cases. Civil 3D is mainly used for surveying tools (import/export points, creating surfaces, calculating volume...). I mentioned Civil, because I thought there is some Labeling tool to do this.
I've never used Pipe Network for planing. Also, (if I understood correctly) I need to do all the planning I have done so far, again using Pipe Network in order to be able to label the pipes the way I want?
Maybe I understand a bit more now. Take a pline co-ords lsp this will give all the pline vertices you can then read your dat file and draw the text at the correct location.
eg middle of pt2 pt3 and 3 below same angle as pt2-pt3. I would make a few defuns one for each part of the labelling. I dont have any code that matches a google for "label plines" may help find something that can be patched together quickly. I am in middle of a major project at moment so time is not something I have.
This morning, on my way to work, i got same idea. I think I have a lisp for exporting vertices coord in txt file, somewhere. My idea was to create a lisp (lets call it printAbove) that requires several parameters to print text. For example: text alignment X, text alignment Y, angle, text, layer (or height, color, font). I could easily format my output file to contain these data. Then, use MULTIPLE function on printAbove. Same to do for printUnder. What do you think?
I have been searching for "label polylines", but could't find anything I can use. I appreciate your time you are taking each time to reply. Right now, I'm working on two projects, it takes more then 12 hours of my day, that is why I don't reply immediately, and I apologize for that.
I don't know AutoLISP, started to learn 2/y ago, but could'n manage to find time. I can read most of the code, and do some minor modifications.
Again, thank you for replies
Edit:
I have found that lisp for exporting vertices coord to txt file:
; pline co-ords example; By Alan H(defun getcoords (ent) (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) "Coordinates" ) ) ))(defun co-ords2xy (); convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z(setq len (length co-ords))(setq numb (/ len 2)) ; even and odd check required(setq I 0)(repeat numb(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) )); odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))(setq co-ordsxy (cons xy co-ordsxy))(setq I (+ I 2)))); program starts here(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))(co-ords2xy) ; list of 2d points making pline
Something isn't working properly. As you can see in screenshot, x and y are not grouped in parenthesis in every case. Sometimes there are only X coord, and Y coord is 0.0, and vice versa.
Firstly please modify your post #5 and add CODE TAGS as shown in THIS LINK
Secondly I will not promise that I can help you as best as you looking forward but I will do my best if you can explain your issues very clearly.
So can you explain what is the purpose of the .txt file attached in the first post? Because I can not see anything in common between the txt fie and the attached drawing.
Should the user be asked to select a .txt file then write these data into attributed block as shown in the drawing ?
text file I' attached is "refined" .dat file (.dat file is file dreated for importing in AutoCAD, then used to draw pipe profile view). I made mistake defining column content. Firs column ist length of segment, second AND third are pipe material, fourth is pipe profile, and fifth is slope. Only connection between txt and dwg is segment length, so my idea was to export pline vertices coord in txt, create file for print (in Excel for example, one row to look like: text alignment X, text alignment Y, angle, text, layer (or height, color, font)). Also, profile view (you can see it in UPR Layout of attached dwg in this post) contains information on pipe (2 red parallel lines in "niveleta" Layer represents pipe).
I have deleted attributed block, as they are irrelevant to this matter. To simplify problem: I need to label 2D pline with its length and informations I have in text file. On this project I need do this for 50-60 kilometers of primary Network, hundreds of secondary, and hundreds of tertiary. So it requires a lot of time to be done by hand.
PIPELINE_example6.dwg